The backup of a course download with 0 bytes.

The backup of a course download with 0 bytes.

by Francisco Gómez -
Number of replies: 8

I backup a course and when I try to download it, it downloads with 0 bytes

However, other courses download well.

I see the course that has been backed up but there is no way to download it. 

I can restore it in the same moodle site but I can't download it to restore it in another moodle installation because it downloads with 0 bytes. Is there any way to locate it in moodledata?


Some idea,

Thank you.

Average of ratings: -
In reply to Francisco Gómez

Re: The backup of a course download with 0 bytes.

by Ken Task -
Picture of Particularly helpful Moodlers

That's odd!

If one can restore, the backup on the same server without error but not download the .mbz file ... that's really strange.

Gotta ask ... how are you downloading?

Locating in moodledata/filedir is kinda involved ... making DB query to find file by filename extension ... .mbz ... and contenthash.

Then with whatever you have to browse files, in moodledata/filedir/ do a find for the 'contenthash' value.

Will be in something like:

moodledata/filedir/xx/yy/xxyybunchoflettersnumbers

where xxyybunchoflettersnumbers is the contenthash seen in query.

'SoS', Ken

Average of ratings: Useful (1)
In reply to Ken Task

Re: The backup of a course download with 0 bytes.

by Francisco Gómez -
I am using a local server with Xampp on windows 10 64 bits version 2004 and Xampp with PHP 7.4.8. I have checked that this also happens when downloading large files, whether they are pdf or from the folder resource when I select download full folder. Until a few months ago the entire folder was downloaded and now only download the compressed folder with 0 bytes is downloaded.

A few months ago I also downloaded the backup of a course completely, but something has changed, either in the last version of Moodle (Moodle 3.9.1+ (Build: 20200723) or in the configuration of Xampp, that now the big files are downloaded with 0 bytes.

For example, I have just downloaded a backup of a course entirely of 7.32 MB. But in other courses where the backup is, for example, 37.7MB already downloads it to 0 bytes. However in the local server with Xampp it restores it perfectly. The only way that I have found to take that backup is following your recommendations in this forum, that is to go to moodledata and although the files are encrypted I can locate them by the date of creation and by the size. For example the backup of the 37.7 megas course that from Moodle with Xampp, when I download it goes down to 0 bytes. I found the backup of the course in moodledata in the path: moodledata\filedir\1c\e7 and with the name: 1ce7b42d8962f33ffe0c1cc04386d73c91fe39f4 and I see that it is the backup that I just generated by the date of modification and by the size that matches, I rename 1ce7b42d8962f33ffe0c1cc04386d73c91fe39f4 namecourse. mbz and I can take it to the installation I have in a professional hosting provider.

This is the only solution I have for now to rescue the backups and restore them in other Moodle sites. Still, I haven't found how to download big files, so if a pdf is too big I have to cut it up or put it outside moodle with a link to it, still inside the Xampp server and it works, and yet inside Moodle big files are downloaded at 0 bytes. I manage two Moodle platforms, one in local with Xampp and another one in a professional hosting with x86_64-redhat-linux-gnu host with Nginx server and it restores correctly.

But I am just a school teacher specialized in teaching English in a Primary School and representative of computer media, but I am not a computer specialist. Let's see if some of our IT colleagues in this forum can help us because 3 or 4 months ago the local Xampp installation was working perfectly; then it's possible that this happened or because of an update of Xampp or Moodle or a misconfiguration of Xampp or Moodle.

I'm intrigued to know why this behaviour might be happening.

Has this ever happened to anyone before and been resolved?

Greetings from Murcia.
In reply to Ken Task

Re: The backup of a course download with 0 bytes.

by Francisco Gómez -
In ERROR XAMPP\apache\logs\error.log I have found this:
[Sun Jul 26 20:21:58.304204 2020] [php7:notice] [pid 14672:tid 896] [client 188.114.110.34:60388] Use of subplugins.php has been deprecated. Please update your …
campus/mod/hotpot' plugin to provide a subplugins.json file instead
But I have updated the hotpot mod and big files download 0 bytes
In reply to Francisco Gómez

Re: The backup of a course download with 0 bytes.

by Ken Task -
Picture of Particularly helpful Moodlers

Not a Windows person myself, but your Moodle (the xampp local host) is a moodle so you should be able to turn on Debugging all the way to developer to see if that Moodle is complaining about anything else.

Also, in your PHP info page of the Moodle found in site admin -> server should show php settings for many things ... post_max and upload_max .... you are looking for settings related to file size.

Might look at:

https://docs.moodle.org/39/en/File_upload_size#Windows_XP_and_Server_2003_Instructions

even if you running xampp and the directions above are for XP and Server 2003 they should be similar, I would think ... but here again ... what does a non-Windows user know! smile

'SoS', Ken

In reply to Ken Task

Re: The backup of a course download with 0 bytes.

by Francisco Gómez -
in php_error_log I get this:
Notice: session_start(): A session had already been started - ignoring in H:\xampp\htdocs\inicio\campus\lib\classes\session\handler.php on line 45

And in 'H:/xampp/htdocs/inicio/xmlrpc.php' not found or unable to stat

Any idea?

I do not have any problem to upload files, only to download big files.

Thank you in advance.
In reply to Francisco Gómez

Re: The backup of a course download with 0 bytes.

by Ken Task -
Picture of Particularly helpful Moodlers

Cron job running?

The first error mention could be a result the cron job/task that checks sessions ... and cleans them up ... syncs them ... isn't working.

The other ...

And in 'H:/xampp/htdocs/inicio/xmlrpc.php' not found or unable to stat

Not found ... well you could browse files to see if that's true, right?

or unable to stat ... is php-xmlrpc extension to php installed?

Your PHP info page at the top does show what extensions running ...

Ok yeah I understand you have no issue uploading ... it's 0 byte downloads ... still though, humor me ... what are those settings ... plus other settings like memory for a script to use, how long a script can run ...

Like I said ... don't run Windows ... maybe I should back out of this and let a true Windows person take over.   Anyone?

'SoS', Ken

In reply to Ken Task

Re: The backup of a course download with 0 bytes.

by Colin Fraser -
Picture of Documentation writers Picture of Testers
Been a very long time since I have played around with Xampp but if I recall, there was a 10MB limitation in the Xampp config files that caused this problem. I don't think I got around it, but it took the gloss of Xampp at that time.
Having said that, my installation of Xampp collapsed with one problem begetting another and another and another until it was unusable. Every time I got it working again, another problem came up, unrelated to the first and so on, just cascading until I gave up in disgust. So my experience with Xampp is pretty negative.
The positive I took from that was the setting up of a WAMP server which ultimately became my test site, it took a bit of fiddling around to get it right, but not a great deal of time with the help of a couple of Moodle Docs, YouTube and some sites. I understand the Bitnami WAMP is an all in one that works better than Xampp so you might want to check that out. I found it's all about controlling the environment, which was difficult in Xampp, but easier when I set up my own server. That was on a windows 7 desktop PC. (I'm now using virtual machines these days, easier to maintain without wrecking my desktop using Win7, Win10 and nginx.)
In reply to Colin Fraser

Re: The backup of a course download with 0 bytes.

by Francisco Gómez -
The solution was in:
https://tracker.moodle.org/browse/MDL-69355



Editing the file "lib/filelib.php" which is in en   :\xampp\htdocs\moodle\lib


Simply by adding a two 0's to if ($filesize > 100000000) {
So it looks like this if ($filesize > 1000000000) {
Xampp is restarted and everything is resolved.
You can now download all types of files larger than 10 megs.

Greetings,
Francisco