Failed to open stream - Debugging

Failed to open stream - Debugging

by IQids Hector -
Number of replies: 11

I have turned debugging on after having had some issues with the site and I get these errors. Only recently I upgraded to moodle version 3.10. 

The first two warning are the same. Any help is appreciated.

Warning: include(C:\Inetpub\vhosts\iqids.gr\eclass.iqids.gr/mod/tiles/version.php): failed to open stream: No such file or directory in C:\Inetpub\vhosts\iqids.gr\eclass.iqids.gr\lib\classes\plugin_manager.php on line 314

Warning: include(C:\Inetpub\vhosts\iqids.gr\eclass.iqids.gr/mod/tiles/version.php): failed to open stream: No such file or directory in C:\Inetpub\vhosts\iqids.gr\eclass.iqids.gr\lib\classes\plugin_manager.php on line 314

Warning: include(): Failed opening 'C:\Inetpub\vhosts\iqids.gr\eclass.iqids.gr/mod/tiles/version.php' for inclusion (include_path='C:\Inetpub\vhosts\iqids.gr\eclass.iqids.gr/lib/pear;.;.\includes;.\pear') in C:\Inetpub\vhosts\iqids.gr\eclass.iqids.gr\lib\classes\plugin_manager.php on line 314

Plugin mod_tiles does not declare valid $plugin->component in its version.php.
  • line 324 of \lib\classes\plugin_manager.php: call to debugging()
  • line 344 of \lib\classes\plugin_manager.php: call to core_plugin_manager->load_present_plugins()
  • line 221 of \lib\classes\plugininfo\base.php: call to core_plugin_manager->get_present_plugins()
  • line 147 of \lib\classes\plugininfo\base.php: call to core\plugininfo\base->load_disk_version()
  • line 100 of \lib\classes\plugininfo\base.php: call to core\plugininfo\base::make_plugin_instance()
  • line 404 of \lib\classes\plugin_manager.php: call to core\plugininfo\base::get_plugins()
  • line 72 of \admin\settings\messaging.php: call to core_plugin_manager->get_plugins_of_type()
  • line 8762 of \lib\adminlib.php: call to require()
  • line 19 of \admin\settings.php: call to admin_get_root()




Average of ratings: -
In reply to IQids Hector

Re: Failed to open stream - Debugging

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

In the Moodle source code folder have you got a folder in the mod folder called tiles? What does it contain?

Moodle doesn't have a mod/tiles folder and I don't know of any plugin that goes in that location. There's a Tiles course format plugin but that goes in course/format/tiles.

Average of ratings: Useful (1)
In reply to Leon Stringer

Απάντηση: Re: Failed to open stream - Debugging

by IQids Hector -
Hi Leon,

no there is no folder called tiles in the mod folder.
In reply to Leon Stringer

Απάντηση: Re: Failed to open stream - Debugging

by IQids Hector -
Hi Leon,
I have tried looking everywhere to find the culprit that is messing up the site. I have turned debugging on and now I am getting this.

Warning: include(C:\Inetpub\vhosts\iqids.gr\eclass.iqids.gr/mod/tiles/version.php): failed to open stream: No such file or directory in C:\Inetpub\vhosts\iqids.gr\eclass.iqids.gr\lib\classes\plugin_manager.php on line 314

Warning: include(C:\Inetpub\vhosts\iqids.gr\eclass.iqids.gr/mod/tiles/version.php): failed to open stream: No such file or directory in C:\Inetpub\vhosts\iqids.gr\eclass.iqids.gr\lib\classes\plugin_manager.php on line 314

Warning: include(): Failed opening 'C:\Inetpub\vhosts\iqids.gr\eclass.iqids.gr/mod/tiles/version.php' for inclusion (include_path='C:\Inetpub\vhosts\iqids.gr\eclass.iqids.gr/lib/pear;.;.\includes;.\pear') in C:\Inetpub\vhosts\iqids.gr\eclass.iqids.gr\lib\classes\plugin_manager.php on line 314
Plugin mod_tiles does not declare valid $plugin->component in its version.php.
line 324 of \lib\classes\plugin_manager.php: call to debugging()
line 344 of \lib\classes\plugin_manager.php: call to core_plugin_manager->load_present_plugins()
line 221 of \lib\classes\plugininfo\base.php: call to core_plugin_manager->get_present_plugins()
line 147 of \lib\classes\plugininfo\base.php: call to core\plugininfo\base->load_disk_version()
line 100 of \lib\classes\plugininfo\base.php: call to core\plugininfo\base::make_plugin_instance()
line 404 of \lib\classes\plugin_manager.php: call to core\plugininfo\base::get_plugins()
line 72 of \admin\settings\messaging.php: call to core_plugin_manager->get_plugins_of_type()
line 8762 of \lib\adminlib.php: call to require()
line 19 of \admin\settings.php: call to admin_get_root()


I spoke to the host and they said that it is an issue within moodle and that everything is fine on their side.
Do you have any suggestions?

Thank you.
In reply to IQids Hector

Re: Απάντηση: Re: Failed to open stream - Debugging

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

Try purging caches: under Site administration ▸ Development ▸ Purge caches click Purge all caches. Does that fix it?

Average of ratings: Useful (1)
In reply to Leon Stringer

Απάντηση: Re: Απάντηση: Re: Failed to open stream - Debugging

by IQids Hector -
Yes, I got rid of all the debugging messages by purging the caches, but whenever I try importing questions using the Aiken format, I get the error
Invalid permissions detected when trying to create a directory. Turn debugging on for further details.

Plus when running cron (don't know if this helps) I get this 
Fatal error: Uncaught Error: Call to a member function real_escape_string() on null in C:\Inetpub\vhosts\iqids.gr\eclass.iqids.gr\lib\dml\mysqli_native_moodle_database.php:1140
Stack trace:
#0 C:\Inetpub\vhosts\iqids.gr\eclass.iqids.gr\lib\dml\mysqli_native_moodle_database.php(1269): mysqli_native_moodle_database->emulate_bound_params('SELECT RELEASE_...', Array)
#1 C:\Inetpub\vhosts\iqids.gr\eclass.iqids.gr\lib\dml\moodle_database.php(1671): mysqli_native_moodle_database->get_records_sql('SELECT RELEASE_...', Array, 0, 0)
#2 C:\Inetpub\vhosts\iqids.gr\eclass.iqids.gr\lib\classes\lock\mysql_lock_factory.php(161): moodle_database->get_record_sql('SELECT RELEASE_...', Array)
#3 C:\Inetpub\vhosts\iqids.gr\eclass.iqids.gr\lib\classes\lock\lock.php(107): core\lock\mysql_lock_factory->release_lock(Object(core\lock\lock))
#4 C:\Inetpub\vhosts\iqids.gr\eclass.iqids.gr\lib\classes\lock\lock.php(121): core\lock\lock->release()
#5 [internal function]: core\lock\lock->__destruct()
#6 {main}
  thrown in C:\Inetpub\vhosts\iqids.gr\eclass.iqids.gr\lib\dml\mysqli_native_moodle_database.php on line 1140

In reply to IQids Hector

Re: Απάντηση: Re: Απάντηση: Re: Failed to open stream - Debugging

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

Well you can enable debugging and post details here (or in a new discussion if it's not related to this issue).

But it sounds like it goes back to this reply: Moodle's PHP scripts read and write to files in Moodledata as a user account. This user account must have the correct access. I have no experience of managed hosting using Windows Server so I don't know how to set this up. The site cron should be run as the same user account otherwise this can be trying to read and write files in Moodledata as a different user account.

Average of ratings: Useful (1)
In reply to Leon Stringer

Απάντηση: Re: Απάντηση: Re: Απάντηση: Re: Failed to open stream - Debugging

by IQids Hector -
Yes, I ran cron and got this.

Fatal error: Uncaught Error: Call to a member function real_escape_string() on null in C:\Inetpub\vhosts\iqids.gr\eclass.iqids.gr\lib\dml\mysqli_native_moodle_database.php:1140
Stack trace:
#0 C:\Inetpub\vhosts\iqids.gr\eclass.iqids.gr\lib\dml\mysqli_native_moodle_database.php(1269): mysqli_native_moodle_database->emulate_bound_params('SELECT RELEASE_...', Array)
#1 C:\Inetpub\vhosts\iqids.gr\eclass.iqids.gr\lib\dml\moodle_database.php(1671): mysqli_native_moodle_database->get_records_sql('SELECT RELEASE_...', Array, 0, 0)
#2 C:\Inetpub\vhosts\iqids.gr\eclass.iqids.gr\lib\classes\lock\mysql_lock_factory.php(161): moodle_database->get_record_sql('SELECT RELEASE_...', Array)
#3 C:\Inetpub\vhosts\iqids.gr\eclass.iqids.gr\lib\classes\lock\lock.php(107): core\lock\mysql_lock_factory->release_lock(Object(core\lock\lock))
#4 C:\Inetpub\vhosts\iqids.gr\eclass.iqids.gr\lib\classes\lock\lock.php(121): core\lock\lock->release()
#5 [internal function]: core\lock\lock->__destruct()
#6 {main}
thrown in C:\Inetpub\vhosts\iqids.gr\eclass.iqids.gr\lib\dml\mysqli_native_moodle_database.php on line 1140
In reply to IQids Hector

Απάντηση: Re: Απάντηση: Re: Απάντηση: Re: Failed to open stream - Debugging

by IQids Hector -
I turned on debuggind (developer mode) and got all this.

Format plugin format_flexible is not found. Using default format_topics
line 126 of \course\format\lib.php: call to debugging()
line 187 of \course\format\lib.php: call to format_base::get_format_or_default()
line 35 of \course\format\lib.php: call to format_base::instance()
line 2683 of \lib\modinfolib.php: call to course_get_format()
line 544 of \lib\modinfolib.php: call to section_info->__construct()
line 417 of \lib\modinfolib.php: call to course_modinfo->__construct()
line 2168 of \lib\modinfolib.php: call to course_modinfo::instance()
line 1124 of \lib\completionlib.php: call to get_fast_modinfo()
line 73 of \completion\classes\progress.php: call to completion_info->get_activities()
line 210 of \course\classes\external\course_summary_exporter.php: call to core_completion\progress::get_course_progress_percentage()
line 62 of \course\classes\external\course_summary_exporter.php: call to core_course\external\course_summary_exporter::get_course_progress()
line 125 of \lib\classes\external\exporter.php: call to core_course\external\course_summary_exporter->get_other_values()
line 157 of \blocks\timeline\classes\output\main.php: call to core\external\exporter->export()
line ? of unknownfile: call to block_timeline\output\main->block_timeline\output\{closure}()
line 153 of \blocks\timeline\classes\output\main.php: call to array_map()
line 46 of \blocks\timeline\classes\output\renderer.php: call to block_timeline\output\main->export_for_template()
line 461 of \lib\outputrenderers.php: call to block_timeline\output\renderer->render_main()
line 61 of \blocks\timeline\block_timeline.php: call to plugin_renderer_base->render()
line 341 of \blocks\moodleblock.class.php: call to block_timeline->get_content()
line 235 of \blocks\moodleblock.class.php: call to block_base->formatted_contents()
line 1181 of \lib\blocklib.php: call to block_base->get_content_for_output()
line 1239 of \lib\blocklib.php: call to block_manager->create_block_contents()
line 642 of \lib\outputrenderers.php: call to block_manager->ensure_content_created()
line 83 of \theme\adaptable\layout\includes\head.php: call to core_renderer->standard_head_html()
line 130 of \theme\adaptable\layout\includes\header.php: call to require_once()
line 30 of \theme\adaptable\layout\dashboard.php: call to require_once()
line 1374 of \lib\outputrenderers.php: call to include()
line 1304 of \lib\outputrenderers.php: call to core_renderer->render_page_layout()
line 165 of \my\index.php: call to core_renderer->header()
In reply to Leon Stringer

Απάντηση: Re: Απάντηση: Re: Απάντηση: Re: Failed to open stream - Debugging

by IQids Hector -
I ran cron again and got this message.

!!! Εντοπίστηκε λάθος κώδικα, πρέπει να φτιαχτεί από προγραμματιστή: A lock was created but not released at:
[dirroot]\lib\classes\task\manager.php on line 684

Code should look like:

$factory = \core\lock\lock_config::get_lock_factory('type');
$lock = $factory->get_lock(491278967d11403a238dac60dd1e34b471eb5e09);
$lock->release(); // Locks must ALWAYS be released like this.

!!!
!!
Error code: codingerror !!
!! Stack trace: * line 122 of \lib\classes\lock\lock.php: coding_exception thrown
* line 73 of \lib\cronlib.php: call to core\lock\lock->__destruct()
* line 81 of \admin\cron.php: call to cron_run()
!!

Do you think I should reinstall moodle? Maybe this would help solve all the issues I am having.
In reply to IQids Hector

Re: Απάντηση: Re: Απάντηση: Re: Απάντηση: Re: Failed to open stream - Debugging

by Heather P -
Did you get anywhere with the above about the lock only I have exactly the same issue. I too was thinking about installing a later version of Moodle in the hope that it took the issue away, but when I looked at the code in the above file it looked the same in both versions to me.
In reply to Leon Stringer

Απάντηση: Re: Απάντηση: Re: Απάντηση: Re: Failed to open stream - Debugging

by IQids Hector -
Ok. So , I reinstalled moodle once again. This time I try to upload a file using AIKEN format and I get a bit more info on the error.

Invalid permissions detected when trying to create a directory. Turn debugging on for further details.

More information about this error

Debug info: C:\Windows\TEMP/requestdir/taXP is not writable, check permissions.
Error code: invaliddatarootpermissions
Stack trace:
line 1565 of \lib\setuplib.php: invalid_dataroot_permissions thrown
line 1645 of \lib\setuplib.php: call to make_writable_directory()
line 1675 of \lib\setuplib.php: call to get_request_storage_directory()
line 89 of \question\import.php: call to make_request_directory()

Do you have any suggestions as to what I need to do here?
Thank you.