Upgrade: 2.7.1 -> 2.7.2: File store path does not exist and can not be created

Upgrade: 2.7.1 -> 2.7.2: File store path does not exist and can not be created

by Andrew Valencik -
Number of replies: 2

Hello,

I had Moodle 2.7.1 running on Ubuntu 14.04, which was installed via:

git clone --depth=1 -b MOODLE_27_STABLE --single-branch git://git.moodle.org/moodle.git /var/www/moodle

I attempted to upgrade to 2.7.2+ via a simple git fetch and git pull.

The git operations proceeded fine. The web interface said it was going to update the database, that seemed to work fine, it checked and succeeded in updating two plugins (that where installed by default, not separately by me).

Upon clicking continue I am now greeted with:

Coding error detected, it must be fixed by a programmer: File store path does not exist and can not be created.

I cannot load any moodle page.

I have reset file permissions with no change.
  chown -R root /var/www/moodle  #(also tried www-data which apache2 uses)
  chmod -R 0755 /var/www/moodle
  find /var/www/moodle -type f -exec chmod 0644 {} \;

I have tried to rerun install.php from the CLI and I get the same error.


From apache's error.log during the time I was trying to upgrade:

[Fri Sep 26 20:35:04.852335 2014] [:error] [pid 26644] [client 111.11.111.111:53950] PHP Warning:  sha1_file(/srv/moodledata/cache/core_component.php): failed to open stream: Permission denied in /var/www/moodle/lib/classes/component.php on line 186, referer: http://moodle.our.site/admin/index.php?confirmupgrade=1&confirmrelease=1&confirmplugincheck=1&cache=0


Please let me know if you have any help our suggestions.


Average of ratings: -
In reply to Andrew Valencik

Re: Upgrade: 2.7.1 -> 2.7.2: File store path does not exist and can not be created

by Andrew Valencik -

I think I've narrowed down the issue to the mysql database.

I have wiped out /var/www/moodle, and started fresh with
git clone --depth=1 -b MOODLE_27_STABLE --single-branch git://git.moodle.org/moodle.git /var/www/moodle

Right after this I can go to my site and see the install.php interface.

As soon as I give it the correct database credentials I get the same error as before:
Coding error detected, it must be fixed by a programmer: File store path does not exist and can not be created.

If I give the config.php the wrong dbuser, or something, I get a 'Database connection failed' error. 

Presumably starting with a fresh database would wipe an user accounts and course settings?

Unfortunately, we do not have recent course backups, so this is not an option.


Are there any tools to check/verify the database, or repair it?

In reply to Andrew Valencik

Re: Upgrade: 2.7.1 -> 2.7.2: File store path does not exist and can not be created

by Andrew Valencik -

I tracked the error down to the following line of code:

https://github.com/moodle/moodle/blob/master/cache/stores/file/lib.php#L642

Above it I added the following two lines:

$andrewsPath = $this->path;
Print "andrewsPath is $andrewsPath";

I saved the file and loaded the moodle site in a browser and got very helpful error message telling me the path that was failing was

srv/moodledata/cache/cachestore_file/default_application/core_config/

A simple chown -R www-data /srv/moodledata fixed everything.

(I had previously checked /srv/moodledata and several further down directories to find the permissions were as expected, readable and writable by www-data. However three files in srv/moodledata/cache/cachestore_file/default_application/core_config/ had changed to root:root with timestamps suggesting they happened during the upgrade.)


Best of luck to anyone else who runs into this error.

If a moderator could mark the thread as solved, that would be appreciated.

Cheers.


Average of ratings: Useful (6)