Giter Club home page Giter Club logo

Comments (3)

Aunib avatar Aunib commented on June 16, 2024

I have the same (or a very similar) problem. It ran fine on version 2.1.2.6 last year. My school updated moodle for this school year and it didn't work. I updated the configuration (with moodle-dl -c) and tried again. I got the same error. Then I updated moodle-dl to version 2.3.2.0 and tried again. I got the same error (differently formatted, but the same message) this time. I updated the config file again and the error stayed.

Here the (imho) relevant part of the error message (with the -v flag)

2023-09-01 16:02:48  DEBUG  {request_helper}  Details about the failed request:
URL: https://censored.example.com/webservice/rest/server.php?moodlewsrestformat=json&wsfunction=core_course_get_contents
Body: {'moodlewssettingfilter': 'true', 'moodlewssettingfileurl': 'true', 'courseid': 2951, 'wsfunction': 'core_course_get_contents', 'wstoken': 'censored'}
The following error occurred during execution:
The Moodle System rejected the Request. Details: moodle_exception (Error code: cannotgetcoursecontents, Message: Kursinhalte können nicht geladen werden.)
2023-09-01 16:02:48  DEBUG  {mail_service}  Mail-Notifications not configured, skipping.
2023-09-01 16:02:48  INFO  {telegram_service}  Sending Notification via Telegram...
2023-09-01 16:02:48  DEBUG  {connectionpool}  Starting new HTTPS connection (1): api.telegram.org:443
2023-09-01 16:02:48  DEBUG  {connectionpool}  https://api.telegram.org:443 "POST /CENSORED/sendMessage HTTP/1.1" 200 467
2023-09-01 16:02:48  DEBUG  {xmpp_service}  XMPP-Notifications not configured, skipping.
2023-09-01 16:02:48  ERROR  {main}  Traceback (most recent call last):
  File "/home/moodle-dl/.local/lib/python3.7/site-packages/moodle_dl/main.py", line 536, in main
    choose_task(config, opts)
  File "/home/moodle-dl/.local/lib/python3.7/site-packages/moodle_dl/main.py", line 68, in choose_task
    run_main(config, opts)
  File "/home/moodle-dl/.local/lib/python3.7/site-packages/moodle_dl/main.py", line 136, in run_main
    raise base_err
  File "/home/moodle-dl/.local/lib/python3.7/site-packages/moodle_dl/main.py", line 95, in run_main
    changed_courses = asyncio.run(moodle.fetch_state(database))
  File "/usr/lib/python3.7/asyncio/runners.py", line 43, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.7/asyncio/base_events.py", line 584, in run_until_complete
    return future.result()
  File "/home/moodle-dl/.local/lib/python3.7/site-packages/moodle_dl/moodle/moodle_service.py", line 117, in fetch_state
    course_cores = await core_handler.async_load_course_cores(courses)
  File "/home/moodle-dl/.local/lib/python3.7/site-packages/moodle_dl/moodle/core_handler.py", line 157, in async_load_course_cores
    cores = await asyncio.gather(*async_features)
  File "/home/moodle-dl/.local/lib/python3.7/site-packages/moodle_dl/utils.py", line 64, in run_with_final_message
    result = await load_function(entry)
  File "/home/moodle-dl/.local/lib/python3.7/site-packages/moodle_dl/moodle/core_handler.py", line 166, in async_load_course_core
    return await self.client.async_post('core_course_get_contents', data)
  File "/home/moodle-dl/.local/lib/python3.7/site-packages/moodle_dl/moodle/request_helper.py", line 141, in async_post
    self.check_json_for_moodle_error(resp_json, url, data)
  File "/home/moodle-dl/.local/lib/python3.7/site-packages/moodle_dl/moodle/request_helper.py", line 328, in check_json_for_moodle_error
    + f" Message: {resp_json.get('message', '')})"
moodle_dl.moodle.request_helper.RequestRejectedError: The Moodle System rejected the Request. Details: moodle_exception (Error code: cannotgetcoursecontents, Message: Kursinhalte können nicht geladen werden.)

2023-09-01 16:02:48  DEBUG  {main}  Exception-Handling completed. Exiting...

The current moodle version according to /lib/upgrade.txt is 4.1.5, I don't know the previous version.
If you need more information, I would be happy to provide it
Thank you for the amazing project btw., it saved me a lot of hassle for the last three years.

from moodle-dl.

C0D3D3V avatar C0D3D3V commented on June 16, 2024

@Aunib
That is a completly different issue. Please move it into an own issue.

from moodle-dl.

C0D3D3V avatar C0D3D3V commented on June 16, 2024

Looks like a misconfiguration of your moodle instance, see https://moodle.org/mod/forum/discuss.php?d=343122 or https://moodle.org/mod/forum/discuss.php?d=355334

My guess is that for one of your lessons there is an error on the server. Currentlly moodle-dl has no option to deactivate loading of top level entries like lesson names. We should implement it.

from moodle-dl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.