Backup error opening file for 2.3.3

Backup error opening file for 2.3.3

by James Klaas -
Number of replies: 16

I have been trying to back up courses on a Moodle 2.3.3  and I get the following debug info when I try to any kind of backup:


Error code: error_opening_file
$a contents: /home/learning/moodle/moodle2/temp/backup/c152ab51401407cda1745379b5f48577.log

Stack trace:

  • line 46 of /backup/util/loggers/file_logger.class.php:      base_logger_exception thrown
  • line 65 of /backup/util/factories/backup_factory.class.php: call to      file_logger->__construct()
  • line 109 of /backup/controller/backup_controller.class.php: call to      backup_factory::get_logger_chain()
  • line 84 of /backup/backup.php: call to      backup_controller->__construct()

Also  I have had a marked increase of Automated backup status error messages. I can't think of anything that has changed.

Thanks for any help.

Jim

Average of ratings: -
In reply to James Klaas

Re: Backup error opening file for 2.3.3

by Ken Task -
Picture of Particularly helpful Moodlers

Just a guess ... given the info shared ... guessing remotely hosted and a Linux flavor of some sort.

Check ownership/permissions on your data folder recursively (is that moodle2 inside the code directory 'moodle'?).

[data]/temp/backup needs to be writable by the web server user.

Also wonder about how much space one has left?  Running cron often enough?  With version 2 of Moodle, cron must run in order to 'empty the trash'.

'spirit of sharing', Ken

In reply to Ken Task

Re: Backup error opening file for 2.3.3

by James Klaas -

Thanks Ken, I will try this and report back.

Jim

In reply to Ken Task

Re: Backup error opening file for 2.3.3

by James Klaas -

Hi Ken,

It was a problem of a lack of disk space.

I so appreciate the help!

Jim

In reply to James Klaas

Re: Backup error opening file for 2.3.3

by Ken Task -
Picture of Particularly helpful Moodlers

Good! Glad to help!  Feel free to rate posting 'Useful'! ;)

Ken


In reply to Ken Task

Re: Backup error opening file for 2.3.3

by connie swiderski -

hi ken,

i am having the same ossue with backup and error/error_opening_file but with 3.0

any suggestions on addressing?

connie

In reply to connie swiderski

Re: Backup error opening file for 2.3.3

by Ken Task -
Picture of Particularly helpful Moodlers

@Connie ... had a little info from James ... like a clip of debugging.   Please provide.   Can't do Vulcan mind melds! ;)  But can Google ... we talking hosted at Region 11?

'spirit of sharing', Ken


In reply to Ken Task

Re: Backup error opening file for 2.3.3

by connie swiderski -

hi ken,

i left region 11 several years ago, moved on to region 10 and then retired last january. i am doing some contract work for 10 now since they just lost their moodle tech. this backup appears to be an issue they had since upgrading to 3 recently. i did notice that the cron has not run in 24 hrs at least. at this time i do not have access to server to check on that. will monitor since the error is exactly as you helped on this orginal posting. any other suggestions besides the possible space issue?

In reply to Ken Task

Re: Backup error opening file for 2.3.3

by connie swiderski -

it appears image did not copy plus this is the results of the cron run. appears could not empty the trash. not knowing their moodle server set up at this time, not sure where to look to solve this error from cron run. please explain to an uninformed admin and hopefully point down a good rabbit trail. thanks, any help is appreciated.

Attachment 2016-07-23_6-47-57.png
Attachment 2016-07-23_7-05-51.png
In reply to connie swiderski

Re: Backup error opening file for 2.3.3

by Ken Task -
Picture of Particularly helpful Moodlers

Will contact you via PM ... other info/discussion related (maybe).

At the bottom of what you've shared it says 'Service not available' - a 503 error and does suggest one of two reasons ... server set to maintenance mode or 'capacity problem'.   Another admin user ... or something scripted ... could have put the site into the maintenace mode.   You'll have to check apache logs and other logs in Moodle to see if that were true or not.   Multiple admins always has potential issues cause you can't see them and they are not informed of another admin level user doing something/anything on the system in real time.

The other item 'capacity problem' could be a space problem ... Moodle doesn't have any tool for you to see if there is a space left where moodledata resides.

Just so I understand ... you were attempting to restore a course from a 2.3.3 version of Moodle to a 3.0.highest?    Is that correct?

The basic process for restore .... .mbz file is uploaded (or acquired from a repo), it is then un-compressed (un-tarred/gzipped) in at temporary directory located in moodledata/temp/backup/ ... that a8ca .... _bunch_of_letters_numbers directory.   At the same time Moodle opens a log file by the same name ... a8ca...dotlog.   When moodle steps through it's restore process it records what plan/stage it was executing to that .log file.    In your error, that's what was un-available - that a8ca...log file.

Moodle 3 now has a task list ... that's tied to cron jobs .. one of them is to 'clean up' temp areas of the data directory and tables related to things like backups/restores.

Search for 'task' in Site Admin menu and see if there is something turned on that might have kicked in when you were manually restoring a course.

A sure sign that disk is full ... users can't login.   Moodle now defaults to using 'sessions' in files rather than DB.   If disk where moodledata resides is full that is also where one finds the 'sessions' directory to store those small session files.   No space.   Can't write to sessions ... can't login.

But, one could have enough space left where moodledata resides to begin the restore process, but after the .mbz file is un-compressed and the restore process begins ... opps!  No space left.

Only way to know for sure would require access to the server out side of Moodle ... ssh sorta thing.

Sooooo ... not enough info to say for sure.

'spirit of sharing', Ken


In reply to Ken Task

Re: Backup error opening file for 2.3.3

by connie swiderski -

thanks what awesome information.

here is what I know,

not set in maintance mode so ok there.

everyone can still login so ok there

what I was attempting was to do a backup of a course within the newly upgraded site  3.0. not working for any course I try. also tried to import data from course into empty shell of a course. same error on both operations. this error appears immediately when you click backup... no processing going on, on import it does let you select the course you want to import from but once selected this error immediately.

I also noted that in statistics you can view course logs but no processing for the statistic analysis has occurred since the upgrade was done so leads me to think cron has not completely run since the upgrade. that was june 5.

wish I had server access so I could delete data in the temp folder or at least increase capacity.

Thanks again and talk later.

Connie

Hey you still attending TxDLA?

In reply to connie swiderski

Re: Backup error opening file for 2.3.3

by Ken Task -
Picture of Particularly helpful Moodlers

Suggest, next time, don't piggy-back on another posting ... subject line for this thread about restoring a backup from a 2.3 .. and from what you've just shared, not the same situation.

Anyhooooo ... not good that cron hasn't been run since June 5 (if am reading you right there).    You can, however, set cron up to be run via browser with a password.

Do that ... set cron to be run with password ... then use your browser to run it.

http://site/admin/cron.php?password=whateveryougave

That might time out ... ie, not complete ... that's ok ... give it a minute or two then try it again.

Too bad you've not command line access to it ... can do that easily ...

cd /pathto/moodlecode/admin/cli/

php cron.php [ENTER]

and those task can also be run from the command line individually ... rather than having to run the entire package (cron/task  list).

Even if cron doesn't complete all the way ... you might see errors which give you more hints as to what might need fixin' since the upgrade.    And, one could attempt to run it again .... several times as a matter of fact.   One of the routines that needs running is the emptying of the trash - thus freeing up space.

Haven't been to TxDLA in years.   Have been retired for years myself.   Used to cause there was a demand for how to install an AMP stack and Moodle back then.

The former tech ... Gary Yates ... he now gone?

'spirit of sharing', Ken

In reply to Ken Task

Re: Backup error opening file for 2.3.3

by connie swiderski -

well second time to type this. got an error message about the database. hope better for this post.

thanks for the tip. i have never posted to a moodle forum. i always find the answer to my issues in other posts.

garry left just this last week. plano but not sure isd or company.

i have run the cron many many times now and most tasks have run. i will continue to run it.

the backup problem is still not working. exact same error message.

thanks for your assistance.

In reply to connie swiderski

Re: Backup error opening file for 2.3.3

by Ken Task -
Picture of Particularly helpful Moodlers

Same exact error message? .... which one?   The cron error (service not available) or the error on can't find a .log file in [tempdir]/backup/bunchoflettersnumbers.log

Check php info link from site admin -> Server -> phpinfo

Looking for temp directory settings ... if any found.

If ya had command line, I'd suggest removing/erasing any all files/directories in /pathtomoodledata/temp/backup/

'spirit of sharing', Ken




In reply to Ken Task

Re: Backup error opening file for 2.3.3

by connie swiderski -

sorry should have been clearer, backup error.....  error/error_opening_file when doing a backup of a course in 3.0

no more error messages of anykind when i run the cron.

ya that is what i would do is erase everything in the backup folder you outlined. there are network techs at the center that have server access that i will ask them to delete files or give me access.

no mention of temp at all in phpinfo

garry knew of this backup problem and had found no solution either but i do not knpw what he had looked at.


In reply to connie swiderski

Re: Backup error opening file for 2.3.3

by Ken Task -
Picture of Particularly helpful Moodlers

Had been in contact with him late June early July.   He was stepping through upgrading via git.   Git deals with the code directory/DB and the only way to get a current moodle code directory under 'git' is via command line.    This to say he was probably logged on as root user when working on it.   

The upgrade via git doesn't touch (shouldn't touch) the moodledata directory, but he may have reset ownerships/permissons on the moodledata directory for some reason.   moodledata on a typical CentOS server has pretty liberal ownerships and permissions on it and all directories/files contained there in (which would include the temp/backup directory and files.    Sounds now like code can't create that log file in moodledata/temp/backup/ ... which would be the first step in backing up or even restoring ... thus can't read it.

Do you have a backup of some sort you could attempt to restore ... a tinker/small course would do ... just testing restore and if successful would be removing it anyway.

chown apache:apache /pathto/moodledata -R

and

chmod ugo+rw /pathto/moodledata -R

will take care of that.

Of course, without seeing actual apache logs (error, etc.) above is an 'educated guess'.

Sent you a PM ... please check and respond there.

'spirit of sharing', Ken


In reply to Ken Task

Re: Backup error opening file for 2.3.3

by connie swiderski -

Ken,

Thanks for sharing about the Task, new to me. that shows that no tasks have been run since that last upgrade and are needing attention ASAP it says. Houston we have a bigger problem, than they thought but hopefully can be cleared with solving the disk space, temp folder.