C0D3D3V / Moodle-DL

Moodle-DL downloads course content fast from Moodle (eg. lecture pdfs)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Too long filename results in telegram error

jonas-t-s opened this issue · comments

Avoid duplicates

  • Bug is not already reported in another issue

Describe the bug

I have a Manjaro linux with moodle-dl from the AUR. The moodle-folder is on a NTFS-Formated-Drive. This raises an OSERROR [Errno 36] File name too long.

If telegram-notifications is active, it raises an Error, that the request entity is too Large.

Funnily enough, I can create the file using the touch command.

Steps to reproduce the issue

  1. Have an NTFS-Drive mounted on Linux
  2. Find a long path and let it download with moodle-dl

cleaned_moodle_downloader.log

Technical details

  • OS: Manjaro - Linux.

Expected behavior

File is saved where it should be

Possible Fix

No clue.

The problem seems to be an inline pdf.
I see this because the error is: OSError: [Errno 36] File name too long: "...."(75 chars): application/pdf;base64,...

I guess somehow a file is tried to be generated with an filename that contains the complete pdf. Currently we do not support inline pdfs only inline images so maybe the inline images code got confused. You need to give me more information, where this file is located. An uncleaned version of the log would already help since there is the location of the file noted normally. You can contact me via mail or discord if you do not want to post it here.

Hi there, I just started my debugger and searched if I find the error. So my current findings are:

I see something interesting: Everything is correct until we reach Line 123 in results_hanlder.py.
Here we enter elif module_modname.startswith(('folder')) and go to if module_modname in self.course_fetch_addons:

This somehow breaks everything. I would assume that it is a problem with a false classification of this file entity.

Okey I found an ad-hoc-solution, which enables the program functions again. Disable Telegram notifications and run the bot. The OS-Error is caught, whilst the telegram error isn't caught. After it is run, activate telegram notifications again. This allows the use of an updated state.
Note: This only solves the problem really temporarily and may end with inconsistent local copies to online. (Whilst I note, that this did not happen here in my case, it may not be appropriate for all solutions)

I fixed the error that the telegram notification service crashes , the fix will be in the next release.
But I still have to investigate why the filename was so long in first place, so I will keep this issue open.

I think you are right btw, the file gets probably wrongly classified. The whole classifier stands on very shaky legs and really needs a rework.

Fix is released