Forums | Mahara Community

Support /
File not Found after Export Portfolio


Chris Poette's profile picture
Posts: 6

04 February 2022, 2:19

I am currently running Ubuntu 20.04 with PHP 7.4.  I am running the latest version of Mahara  21.10.  When I run the export of my portfolio it appears  in the export queue and then several minutes later I get an email with a link to my export.   When I click on the url I get "The page you are looking for could not be found.  File not found.  Your export file only exists for 24 hours after it was created."

I poked around in my datadirectory and found an export folder with several other numerically named folders.  I was trying the export out as 'admin' and assumed I was numeric folder number 1.  I can a see zip file that was properly data stamped located in that folder.  

Any ideas would greatly be appreciated.  Thank you in advance.     

Robert Lyon's profile picture
Posts: 762

06 February 2022, 9:21

Hi Chris,

The location of the file will be recorded in the export_archive table as a combination of filepath + filename.

So what I'd do is:

1) Find the id= value in the email link, for example id = 5

2) Run the following command in Database to find out what path it expects (using the correct id value), for example:

SELECT CONCAT(filepath, '', filename) AS fullpath FROM export_archive WHERE id = 5;

3) Check on the server that the file actually exists at that fullpath and that the file is actually readable by the web process, for example on Ubuntu this would be 'www-data', so you could try something like (where /fullpath/file.zip is the value returned from step (2):

sudo -u www-data ls -l /fullpath/file.zip

It should show permission similar to

-rw-rw-r-- 1 www-data www-data

Let me know if any of that helps?

Cheers

Robert

Chris Poette's profile picture
Posts: 6

08 February 2022, 8:47

Robert,

I think your pointing me in the right direction.  The file does get created as I stated earlier but the permissions are wrong for retrieval (the link that mahara sends out).  If I chmod 777 - R to that data directory I am able to get the export.  Though as soon as I gen up a new export I cannot retrieve it until I chmod again.  Not a linux expert I know enough to get around.  Is there a way I can have Mahara or apache write the file so everyone can have access.  Thanks again for you help.  

Kristina Hoeppner's profile picture
Posts: 4736

16 February 2022, 9:20

Hi Chris,

It's puzzling that your permissions for the folder (?) are reset. Can you please check what the permissions are and who owns:

  • the folder
  • newly added files

We suspect that your folder permissions are correct, but that any files that are placed in the folder are not owned by www-data and thus wouldn't be accessible.

Thank you

Kristina

Chris Poette's profile picture
Posts: 6

19 February 2022, 9:30

Kristina,

The permissions or ownership seem to be wrong.  Mahara is writting that export folder as root.  If I change ownership to www-data is works fine.  Thoughts?

drwx------ 4 root root 4096 Feb 18 14:54 1645214041

Kristina Hoeppner's profile picture
Posts: 4736

21 February 2022, 8:58

Hi Chris,

Yes, that should do it. Since the web server needs to write to the directory, the folder and files need to be owned by www-data. So:

sudo chown www-data:www-data /yourdirectory


Best,
Kristina

6 results