Can not read file, either file does not exist or there are permission problems

Can not read file, either file does not exist or there are permission problems

by Luna Llena -
Number of replies: 4

I upgrade to moodle 2.6.2 from 2.6 and when I need to restore a class I found this error:

 

Debug info: [dataroot]/filedir/4f/c8/4fc869fe3da2d82bd00ef71386f8cd1069f405f3
Error code: storedfilecannotread
Stack trace:

    line 419 of \lib\filestorage\stored_file.php: file_exception thrown
    line 690 of \lib\filestorage\tgz_packer.php: call to stored_file->get_content_file_handle()
    line 167 of \lib\filestorage\mbz_packer.php: call to tgz_packer::is_tgz_file()
    line 103 of \lib\filestorage\mbz_packer.php: call to mbz_packer->get_packer_for_read_operation()
    line 254 of \backup\util\ui\restore_ui_stage.class.php: call to mbz_packer->extract_to_pathname()
    line 237 of \backup\util\ui\restore_ui_stage.class.php: call to restore_ui_stage_confirm->extract_file_to_dir()
    line 72 of

Please anyone help me!

 

Average of ratings: -
In reply to Luna Llena

Re: Can not read file, either file does not exist or there are permission problems

by Darko Miletić -

Does the actual file exist or not?

In reply to Darko Miletić

Re: Can not read file, either file does not exist or there are permission problems

by Francesc Delis -

Hello!!!

I have upgrading in local from moodle 1.9 firts to 2.2 and then to 2.7 with the latest version of wamp. Everything worked fine. Then I uploaded de whole site to my server and now I can't acces to the file system (server files, recent files, legacy course files in server files, ...) The message is the same:

"Can not read file, either file does not exist or there are permission problems"

I put the site in development mode, try to acces to the files and the error message is


Can not read file, either file does not exist or there are permission problems
Debug info:[dataroot]/filedir/11/1a/111a0cadc25389596d7549f6f1b1d833a559a901 Error code: storedfilecannotread
Stack trace
* line 588 of /lib/filestorage/stored_file.php: file_exception thrown
* line 237 of /lib/filebrowser/file_info_stored.php: call to stored_file->get_imageinfo()
* line 229 of /repository/local/lib.php: call to file_info_stored->get_imageinfo()
* line 146 of /repository/local/lib.php: call to repository_local->get_node()
* line 94 of /repository/local/lib.php: call to repository_local->get_non_empty_children()
* line 100 of /repository/repository_ajax.php: call to repository_local->get_listing()

I have checked if the files are present in the filedir directory and they are there but moodle can't see them.
Can anybody help me with this problem?
Thank you
In reply to Francesc Delis

Re: Can not read file, either file does not exist or there are permission problems

by Francesc Delis -

Solved!

The path to access to [dataroot] was not well defined in the config.php file. I change it to the correct one and now everything works fine.

See you!

Average of ratings: Useful (1)
In reply to Francesc Delis

Re: Can not read file, either file does not exist or there are permission problems

by Sathya A -

If u have the backup of the mdl_files table which was working earlier, import it and then try it.

It works like a charm for me smile