Forums | Mahara Community

Support /
Images lost after upgrading


Peter Westebbe's profile picture
Posts: 6

16 November 2017, 7:31 PM

I need urgent help. After trying to upgrade from 17.4.4 to 17.10.0 mahara crashed. Therefore I set it back to 17.4. but now all images and pdf got lost. They seem to be there but the links are broken. What can I do?

Robert Lyon's profile picture
Posts: 344

17 November 2017, 7:59 AM

Hi Peter,

The first thing I'd check is the dataroot of the site (as defined by $cfg->dataroot in the config.php file) as part of the upgrade involved clearing some cached information from the dataroot and if the web process didn't have correct permissions to do thing it may have caused problems.

Make sure the permissions on the directory are correct, eg

 drwxr-xr-x 14 www-data www-data 4096 Nov 14 16:04 mydataroot

If the dataroot permissions are fine and the files exist under the sub directories of mydataroot/artefact/file/originals/ as expected then I'm not sure what the problem might be as there are no major differences between 17.04 and 17.10.0 when it comes to data storage.

One thing to check is id of the file that is not being shown exists in the dataroot. This can be done by finding the modulo of the file id to know what directory it is stored in. So [id]%256 = directory.

Eg if an image file is id = 12345 we can check if the file exists in the dataroot by going 12345 modulo 256, which equals  57 and then look in the mydataroot/artefact/file/originals/57/ directory for file 12345

Also check if the resized version of images are being created correctly. this formula is a bit more complicated as it involves knowing what size the image needs to be, eg if it's a 24x24 thumbnail from Content -> Files list then the resized file for id 12345 would live at resized/f/d/a/fdacd00fb5c1a4b8dfc54c4140605527.12345

The formula can be seen in lib/file.php on lines 518-528.

Cheers

Robert

Peter Westebbe's profile picture
Posts: 6

18 November 2017, 3:32 AM

Hi Robert,

thank you very much for your help. But whatever I try, I get the same result. It looks like this:

Image message.PNG

Cheers Peter

Robert Lyon's profile picture
Posts: 344

21 November 2017, 7:22 AM

Hi Peter,

It does look like a file permission problem.

If you are using a linux based OS you should be able to do the following to set the correct permissions


1) Go to the place of your dataroot (as definded in config.php)
cd /path/to/dataroot/folder/

2) Make sure the artefact directory and all of it's subdirectories are owned by the account that servers web pages (in Ubuntu's case it is www-data)
chown -R www-data:www-data artefact/

3) Make all of the subdirectories in artefact directory have correct directory permissions
find /path/to/dataroot/folder/artefact/ -type d -exec chmod 700 {} \;

4) Make all of the files in artefact directory have correct file permissions
find /path/to/dataroot/folder/artefact/ -type f -exec chmod 600 {} \;

Cheers

Robert

Peter Westebbe's profile picture
Posts: 6

25 November 2017, 6:19 AM

Hi Robert,

first the problem is solved. After removing the german language package off the dataroot folder all the images and files reapeared. Probably there is a bug in the translation file. Reinstalling a former version of the langauge package solved the problem.

Nevertheless it's impossible to install 17.10 with or without language package. Updating failed. Installing completly new is working but after connecting to the msql database it failed again.

For now we are happy with 17.4.4 but still hoping for an update to 17.10

Do you have any idea what we can do?

Thank you

Cheers

Peter

Robert Lyon's profile picture
Posts: 344

07 December 2017, 11:05 AM

Hi Peter,

Are you able to find out what errors occur on upgrade from 17.04.4 to 17.10.0 ?

If you can look in the error log and paste examples of the errors here I can take a look into the problem

Cheers

Robert

6 results