Local plugin: install and uninstall error

Local plugin: install and uninstall error

by Matt Checkerson -
Number of replies: 2

Hello, dear community.

I created local plugin. And I added db for this plugin. After adding db, when I try to install or delete this plugin, I see error:

"Cannot read file. Either the file does not exist or there is a permission problem."

This error shows already after actions(install, delete), when press button "Upgrade Moodle database now".

When plugin worked without any tables in DB - errors wasn`t.

How I can fix this problem? Maybe need add some more data about table?

Thanks a lot for help


Average of ratings: -
In reply to Matt Checkerson

Re: Local plugin: install and uninstall error

by Luis de Vasconcelos -

What Debugging level is Moodle set to? Change it to "Developer" if it's not already set to that. It might give you a more useful error message, like which file it cannot read.

Have you updated the \local\your_local-plugin\db\install.xml file with the correct database structure info?

In reply to Luis de Vasconcelos

Re: Local plugin: install and uninstall error

by Matt Checkerson -
Well, I cheked error in "Developer mode":


Debug info: [dataroot]/filedir/8c/96/8c96a486d5801e0f4ab8c411f561f1c687e1f865 
Error code: storedfilecannotread
×Stack trace:
  • line 187 of \lib\filestorage\stored_file.php: file_exception thrown
  • line 871 of \lib\filestorage\stored_file.php: call to stored_file->update()
  • line 424 of \lib\filelib.php: call to stored_file->set_source()
  • line 9194 of \lib\adminlib.php: call to file_prepare_draft_area()
  • line 7516 of \lib\adminlib.php: call to admin_setting_configstoredfile->output_html()
  • line 7491 of \lib\adminlib.php: call to admin_output_new_settings_by_page()
  • line 7491 of \lib\adminlib.php: call to admin_output_new_settings_by_page()
  • line 7491 of \lib\adminlib.php: call to admin_output_new_settings_by_page()
  • line 7491 of \lib\adminlib.php: call to admin_output_new_settings_by_page()
  • line 7491 of \lib\adminlib.php: call to admin_output_new_settings_by_page()
  • line 29 of \admin\upgradesettings.php: call to admin_output_new_settings_by_page()

With install.xml all is normal.