[urgent problem] moodledata/temp/backup going wild

[urgent problem] moodledata/temp/backup going wild

by Richard van Iwaarden -
Number of replies: 15
Picture of Particularly helpful Moodlers

We have a serieus problem: our folder/moodledata/temp/backup is going crazy. In 24 hours it stores over 300 GB of data while the entire Moodle site is 120 GB of data.

I have search some topics and most of them had to do with automated course backup being enabled. On our site, automated course backup is disabled.

So what is happening here? Cron files look normal, no errors of any kind indicating any problems.

Moodle 3.4.1+ (Build: 20180228) Version 2017111301.07

Average of ratings: -
In reply to Richard van Iwaarden

Re: [urgent problem] moodledata/temp/backup going wild

by Richard van Iwaarden -
Picture of Particularly helpful Moodlers

I did find something now in one of the crons:


--------------------------

Adhoc task failed: core_course\task\course_delete_modules,Coding error detected, it must be fixed by a programmer: The course module 31804 could not be deleted. #0 /home/learn/public_html/backup/util/factories/backup_factory.class.php(65): file_logger->__construct(30, true, true, '/home/learn/moo...')

#1 /home/learn/public_html/backup/controller/backup_controller.class.php(109): backup_factory::get_logger_chain(false, 1, '3e35cb9eb8bf80b...')

#2 /home/learn/public_html/admin/tool/recyclebin/classes/course_bin.php(123): backup_controller->__construct('activity', '31804', 'moodle2', false, 10, '2')

#3 /home/learn/public_html/admin/tool/recyclebin/lib.php(151): tool_recyclebin\course_bin->store_item(Object(stdClass))

#4 /home/learn/public_html/course/lib.php(1185): tool_recyclebin_pre_course_module_delete(Object(stdClass))

#5 /home/learn/public_html/course/classes/task/course_delete_modules.php(66): course_delete_module('31804')

#6 /home/learn/public_html/lib/cronlib.php(181): core_course\task\course_delete_modules->execute()

#7 /home/learn/public_html/lib/cronlib.php(74): cron_run_inner_adhoc_task(Object(core_course\task\course_delete_modules))

#8 /home/learn/public_html/admin/cli/cron.php(61): cron_run()

#9 {main}

------------------------------

Any idea what's going on here? and why it generates 300 GB of temporary data?
In reply to Richard van Iwaarden

Re: [urgent problem] moodledata/temp/backup going wild

by Ken Task -
Picture of Particularly helpful Moodlers

'a course module # cannot be deleted' is key ...

Please see: https://docs.moodle.org/34/en/Recycle_bin

Think I'd turn recyclebin off for now ... also the task related.

To investigate which module it is, check out what's in /moodledata/temp/backup/ to see if there is a directory whose name begins with 3e35cb9eb8bf80b ... see what's in there for a clue.

OR query the database tables related to modules .. mdl_course_modules or other looking for that module id to see what the course id is, go to course and see what's there.

You should be able to remove anything in moodledata/temp/backup/ manually.

'spirit of sharing', Ken

In reply to Ken Task

Re: [urgent problem] moodledata/temp/backup going wild

by Richard van Iwaarden -
Picture of Particularly helpful Moodlers

Thanks Ken!

Even though I have no automated course backup enabled, I also disabled it in 'scheduled tasks'.

For now, only log files are being created from zero bytes. So the ridiculous amount of data is no longer being created.

I will do a search on monday as to what is really causing the problem.

In reply to Ken Task

Re: [urgent problem] moodledata/temp/backup going wild

by Richard van Iwaarden -
Picture of Particularly helpful Moodlers

Hi Ken,

You were spot on, but this is a major Moodle bug.

It had to do with a big folder with photos. It had already been deleted from a course but was still in the recycle bin.

This /moodledata/temp/backup/ folder gets huge. I'm talking about 500 Gb in 2 days time. It just crashes your Moodle (the entire size of this Moodle installation is 120 Gb)

Should I report this bug somewhere?

In reply to Richard van Iwaarden

Re: [urgent problem] moodledata/temp/backup going wild

by Ken Task -
Picture of Particularly helpful Moodlers

Bugs: https://tracker.moodle.org/secure/Dashboard.jspa

But, when filing the issue, you have to provide a way to replicate the problem - description of MDL version + settings ... an since this involves one course, which it self might be large and contain users ... in this case teacher's files ... how does one do that?

I agree that something isn't working ... but bug?   Could be ... but if it were wouldn't there be many 'me too's' posted?

I'll PM you with an offer (no $ so no one slap me around for offering assistance) on how we might solve.

'spirit of sharing', Ken

In reply to Ken Task

Re: [urgent problem] moodledata/temp/backup going wild

by Richard van Iwaarden -
Picture of Particularly helpful Moodlers

I replied to your PM...

I also found this: MDL-32547

Might be related, but don't know.

We upgraded from Moodle 3.1to 3.4 on February 19. Before then, this problem was not present. Which makes sense as M3.1 does not have a recylebin.


My best guess is that this happened:


  1. There was a course (there always is smile )
  2. A teacher created a backup of this course and restored it as a new course
  3. The teacher found the Moodle-folder in the course that contained many photos and deleted it (so it went to the recyclebin)

What happened next is unknown... but somehow Moodle keeps trying to restore this course to moodledata/temp/backup.


Another scenario is this:

  1. The teacher first deleted the big folder from course X. Moodle put the folder in the recycle-bin.
  2. The teacher then made a backup of this course (question: on backup of a course, does the recycle-bin of that course also gets backed up?)
  3. The teacher then tries to restore the course. I can't find out if this restore succeeded or failed (or failed partly)

After that, Moodle started filling up moodledata/temp/backup with backups.


Moodle seemed to be stuck in a loop. Somehow it looks like it's making backups of backups of backups. The folders in moodledata/temp/backup look like this:


Folder PATH listing

├───2b506a5343aa6d14e0d9d6cea5f25b8f

│   ├───activities

│   │   └───folder_26628

│   └───files

│       ├───00

│       ├───02

│       ├───04

│       ├───05

│       ├───06

│       ├───09

│       ├───0a

│       ├───0b

│       ├───0d

│       ├───0f

│       ├───17

│       ├───1b

│       ├───1d

│       ├───1e

│       ├───1f

│       ├───20

│       ├───25

│       ├───26

│       ├───27

│       ├───28

│       ├───29

│       ├───2c

│       ├───2e

│       ├───31

│       ├───37

│       ├───39

│       ├───3a

│       ├───3c

│       ├───3d

│       ├───46

│       ├───49

│       ├───4b

│       ├───4d

│       ├───54

│       ├───5b

│       ├───5c

│       ├───64

│       ├───66

│       ├───68

│       ├───69

│       ├───6a

│       ├───6b

│       ├───70

│       ├───72

│       ├───76

│       ├───78

│       ├───81

│       ├───83

│       ├───88

│       ├───8b

│       ├───8e

│       ├───92

│       ├───93

│       ├───94

│       ├───9a

│       ├───9b

│       ├───9d

│       ├───a1

│       ├───a5

│       ├───a7

│       ├───aa

│       ├───ac

│       ├───af

│       ├───b0

│       ├───b6

│       ├───ba

│       ├───bb

│       ├───bd

│       ├───bf

│       ├───c0

│       ├───c1

│       ├───ca

│       ├───cd

│       ├───d0

│       ├───d4

│       ├───dc

│       ├───dd

│       ├───df

│       ├───e0

│       ├───e2

│       ├───e4

│       ├───ea

│       ├───eb

│       ├───ec

│       ├───ed

│       ├───f0

│       ├───f3

│       ├───f4

│       ├───f5

│       ├───f9

│       └───ff

└───ffb68b5cbd31fc3679bd665ddcd21395

    ├───activities

    │   └───folder_26628

    └───files

        ├───00

        ├───02

        ├───04

        ├───05

        ├───06

        ├───09

        ├───0a

        ├───0b

        ├───0d

        ├───0f

        ├───17

        ├───1b

        ├───1d

        ├───1e

        ├───1f

        ├───20

        ├───25

        ├───26

        ├───27

        ├───28

        ├───29

        ├───2c

        ├───2e

        ├───31

        ├───37

        ├───39

        ├───3a

        ├───3c

        ├───3d

        ├───46

        ├───49

        ├───4b

        ├───4d

        ├───54

        ├───5b

        ├───5c

        ├───64

        ├───66

        ├───68

        ├───69

        ├───6a

        ├───6b

        ├───70

        ├───72

        ├───76

        ├───78

        ├───81

        ├───83

        ├───88

        ├───8b

        ├───8e

        ├───92

        ├───93

        ├───94

        ├───9a

        ├───9b

        ├───9d

        ├───a1

        ├───a5

        ├───a7

        ├───aa

        ├───ac

        ├───af

        ├───b0

        ├───b6

        ├───ba

        ├───bb

        ├───bd

        ├───bf

        ├───c0

        ├───c1

        ├───ca

        ├───cd

        ├───d0

        ├───d4

        ├───dc

        ├───dd

        ├───df

        ├───e0

        ├───e2

        ├───e4

        ├───ea

        ├───eb

        ├───ec

        ├───ed

        ├───f0

        ├───f3

        ├───f4

        ├───f5

        ├───f9

        └───ff






In reply to Richard van Iwaarden

Re: [urgent problem] moodledata/temp/backup going wild

by Ken Task -
Picture of Particularly helpful Moodlers

The file structure in a backup  kinda mimics what's in filedir ...

This: ffb68b5cbd31fc3679bd665ddcd21395 is the only file there ... it's in files/ff/

It might be linked to in another course.   Search mdl_files table for 'contenthash' or other to see if ffb68b5cbd31fc3679bd665ddcd21395 actually exist in another course.

You might check also what it a.

cd moodledata/filedir/

find ./ -name ffb6ro8b5cbd31fc3679bd665ddcd21395

Probably in ff/b6/

file -b ffb6ro8b5cbd31fc3679bd665ddcd21395 will give a clue as to mimetype.

'spirit of sharing', Ken

In reply to Ken Task

Re: [urgent problem] moodledata/temp/backup going wild

by Richard van Iwaarden -
Picture of Particularly helpful Moodlers
In reply to Richard van Iwaarden

Re: [urgent problem] moodledata/temp/backup going wild

by Iván Sibillà García -

Hi Richard,

We have the same problem and with the same version of Moodle (3.4.1), but we use Oracle as a database.

We have performed the steps you mentioned (the 1st was already), and everything solved:
1. Disabled the backups in the Moodle scheduled task (Site administration Server Scheduled tasks)
2. Disabled the Recycling Bin (Site administration Plugins Admin tools Recycle bin)

Likewise, we would need to have activated the "Recycling Bin"... have you finally been able to solve the issue or is there some MDL- that has solved it?

Thanks for everything.

In reply to Iván Sibillà García

Re: [urgent problem] moodledata/temp/backup going wild

by Richard van Iwaarden -
Picture of Particularly helpful Moodlers

Hi Iván,

We upgraded to Moodle 3.5. After that, I turned on the recycle bin again (not automated backups) and things got normal.

I didn't do anything special. Might have been fixed in 3.5?

Hope it will fix your problem to!

In reply to Richard van Iwaarden

Re: [urgent problem] moodledata/temp/backup going wild

by ricardo guerra -

I'm using the same version, 3.5.1 and I have the same problem sad

We're turn off recycle bin today... 


In reply to ricardo guerra

Re: [urgent problem] moodledata/temp/backup going wild

by Andy Hill -
Hi Guys,

Just stumbled across this post and having major issues in Moodle 3.7+ whereby its creating 20gb of data in 24 hrs and crashing my moodle site. I have checked my moodledata/temp/backup and had a look at one of the many files and its labeled up as a quiz_87 in an activities folder.

Any ideas on how to solve this or is this a bug etc?

Thanks
Andy
In reply to Andy Hill

Re: [urgent problem] moodledata/temp/backup going wild

by Ken Task -
Picture of Particularly helpful Moodlers
@Andy Hill ... got automated backups turned on?   Turn it off.  Then manually remove anything in moodledata/temp/backup/ ... that's the area moodle uses to build backup (.mbz) files.
Manually removing does no harm to site and does re-claim space your server might need immediately.

'spirit of sharing', Ken
Average of ratings: Useful (1)
In reply to Ken Task

Re: [urgent problem] moodledata/temp/backup going wild

by Jean-Marc Doucet -
Picture of Particularly helpful Moodlers Picture of Testers
Hi,
I have the same problem ... and my automated backups is turn OFF triste
My host provider want to kill me every day..... LOL .....
They have set up a cron task that deletes the content of the temp directory:
rm /home/my-moodle/moodledata/temp/backup/* -rf
The task will be started every 6 hours.
But it's not a permanent solution.
I need help to be fixed on my moodle.

Moodle 3.7+ (Build: 20190628)
In reply to Jean-Marc Doucet

Re: [urgent problem] moodledata/temp/backup going wild

by Jean-Marc Doucet -
Picture of Particularly helpful Moodlers Picture of Testers
Hi,
I finally have a clue : [tempdir]/backup/ is not writable ....
I don't understand why this is possible?

Some help please ?