I keep getting this message after install of D7.

Fatal error: require_once() [function.require]: Failed opening required '/Applications/MAMP/htdocs/webs/drupal-7.0/sites/ate7core/modules/ctools/includes/export-ui.inc' (include_path='.:/Applications/MAMP/bin/php5.3/lib/php') in /Applications/MAMP/htdocs/webs/drupal-7.0/sites/all/modules/ctools/includes/plugins.inc on line 724

Is this a known issue? I have tried a bunch of things, from increasing the memory limit, etc through to crawling through posts.

(this message was recieved by adding php.update to the end of the basic site URL. on localhost).

Its this or the white screen of death. Very frustrating. Going away in a few days wanted to take the laptop and play with D7 (no web access where I'm headed).

Any help/advice would be very much appreciated.

Comments

droplet’s picture

Project: Drupal core » Chaos Tool Suite (ctools)
Version: 7.x-dev » 7.x-1.x-dev
Component: install system » Code
Assigned: alltooeasy » Unassigned

ctools isn't core module

merlinofchaos’s picture

Looking at the files it's trying to include side by side, I see something interesting:

/Applications/MAMP/htdocs/webs/drupal-7.0/sites/ate7core/modules/ctools/includes/export-ui.inc
/Applications/MAMP/htdocs/webs/drupal-7.0/sites/all/modules/ctools/includes/plugins.inc

Note that one of these is in sites/all/modules and the one it can't find is in sites/ate7core/modules -- why would that be?

Do you have two copies of the module installed, perhaps? One in sites/all and one in sites/ate7core?

alltooeasy’s picture

Thanks for flagging this up. We've now moved off of the MAC platform hoping that a mirrored Xp system might work more effectively for the business. But I will def, look into this more for my own work. Much appreciated.

merlinofchaos’s picture

Status: Active » Postponed (maintainer needs more info)
ckng’s picture

Status: Postponed (maintainer needs more info) » Active

Just stumble upon this problem as well. Fresh install with default profile, no module disabled and no contrib module enabled.
Only 1 copy of ctools downloaded inside sites/all/modules/contrib/ctools

require_once(/var/www/d7/sites/all/modules/ctools/includes/export-ui.inc):[warning]
failed to open stream: No such file or directory plugins.inc:787
PHP Fatal error:  require_once(): Failed opening required '/var/www/d7/sites/all/modules/ctools/includes/export-ui.inc' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/d7/sites/all/modules/contrib/ctools/includes/plugins.inc on line 787
Drush command terminated abnormally due to an unrecoverable error.   [error]
Error: require_once(): Failed opening required
'/var/www/d7/sites/all/modules/ctools/includes/export-ui.inc'
(include_path='.:/usr/share/php:/usr/share/pear') in
/var/www/d7/sites/all/modules/contrib/ctools/includes/plugins.inc,
line 787
ckng’s picture

- Clear cache does not solve the problem - NOT OK
- Removed ctools folder, cleared cache - NOT OK

What works for me is
- Removed ctools, views folders and cleared cache - OK
- re-download ctools, views, no more errors..

Notes:
- ctools and views are not enabled
- Views is 7.x-3.x-dev (2012-01-11/1326243394)

merlinofchaos’s picture

My guess is that you've got an artifact of either having multiple copies of CTools or of having moved your copy of CTools and Drupal's module location cache is still pointing to the old location. I don't think there's much that CTools specifically can do about that.

You may have to disable CTools via database (set it to status 0 in the system table) and then re-enable it in the UI once you are sure there is only one copy of it in the system.

kenorb’s picture

StatusFileSize
new201.97 KB

I've the same problem, it happened when I've checkout different git branches couple of times (now I'm on the same codebase&db that it was working before).
The error says:

( ! ) Fatal error: require_once() [function.require]: Failed opening required '/Users/kenorb/Sites/AAT/docroot/profiles/acquia/modules/ctools/includes/export-ui.inc' (include_path='.:/Applications/MAMP/bin/php/php5.3.6/lib/php:/Users/kenorb/Sites/drupal6') in /Users/kenorb/Sites/AAT/docroot/sites/all/modules/contrib/ctools/includes/plugins.inc on line 801

SQL paths are missing:

$ drush sql-query "SELECT name, filename FROM {system} WHERE name LIKE 'ctools%'"
name	filename
ctools	profiles/acquia/modules/ctools/ctools.module
ctools_access_ruleset	profiles/acquia/modules/ctools/ctools_access_ruleset/ctools_access_ruleset.module
ctools_ajax_sample	profiles/acquia/modules/ctools/ctools_ajax_sample/ctools_ajax_sample.module
ctools_custom_content	profiles/acquia/modules/ctools/ctools_custom_content/ctools_custom_content.module
ctools_plugin_example	profiles/acquia/modules/ctools/ctools_plugin_example/ctools_plugin_example.module
ctools_plugin_test	profiles/acquia/modules/ctools/tests/ctools_plugin_test.module

Those paths were correct (cached) on the old branch, but on the current branch aren't (because of Drupal core upgrade, Acquia => Drupal).

Solution to that problem should be rebuilding system table by clearing the cache, but the problem is that there is no way of clearing the cache without experiencing that Fatal error.
See:

$ drush cc all

require_once(/Users/kenorb/Sites/AAT/docroot/profiles/acquia/modules/ctools/includes/export-ui.inc): failed to open stream: No such file or directory plugins.inc:801                          [warning]
Drush command terminated abnormally due to an unrecoverable error.                                                                                                                             [error]
Error: require_once(): Failed opening required '/Users/kenorb/Sites/AAT/docroot/profiles/acquia/modules/ctools/includes/export-ui.inc'
(include_path='.:/Applications/MAMP/bin/php/php5.2.17/lib/php') in /Users/kenorb/Sites/AAT/docroot/sites/all/modules/contrib/ctools/includes/plugins.inc, line 801

When clearing the cache manually (drush sql-query "DELETE FROM {cache}") - it doesn't help, because the error happens before the cache is cleared.
See the attachment with backtrace from Drupal UI, I don't have backtrace from drush.

As workaround this helped:
1. Going as admin directly to: /admin/modules
It should rebuild some stuff.
2. Now clearing the cache: 'drush cc all' should work.

kenorb’s picture

StatusFileSize
new201.97 KB

Re-posting the file, probably hash in the filename broke the upload.

merlinofchaos’s picture

kenorb: Compare your paths carefully:

/Users/kenorb/Sites/AAT/docroot/profiles/acquia/modules/ctools
/Users/kenorb/Sites/AAT/docroot/sites/all/modules/contrib/ctools

Drupal does not handle having two different versions of a module in place elegantly.

kenorb’s picture

kenorb’s picture

Title: Fatal error: require_once() [function.require]: Failed opening required includes/export-ui.inc in includes/plugins.inc on line » Error message on D7 install.

Yes, the module was only in one place at a time, I've checked that. But the path of module is different when switching between the branches.
Every time when I was changing the branch, I've cleared the cache to refresh the paths.
The paths in profiles/acquia/modules/ctools were correct only in the old branch, but not valid in the current branch.
So after changing the branch to current one, system table still had the old paths cached, even the module wasn't there.
When I was trying to clear the cache, I had the CTools Fatal error preventing rebuilding the system table.
So the actual Fatal error is when drush is trying clear the caches.

kenorb’s picture

Title: Error message on D7 install. » Fatal error: require_once() [function.require]: Failed opening required includes/export-ui.inc in includes/plugins.inc on line
merlinofchaos’s picture

Hmm. Okay, that's definitely a pain. Manually updating the system table would solve the problem but isn't exactly a good solution. I'll have to look into the exact flow that rebuilds the system table and see if there's a way to make CTools behave better to at least prevent fatal errors during that process, I guess.

kenorb’s picture

Title: Error message on D7 install. » Fatal error: require_once() [function.require]: Failed opening required includes/export-ui.inc in includes/plugins.inc on line

Issue described step by step (not always reproducible):


kenorbs-MacBook-Air:docroot kenorb$ git checkout dev_20120430_sprint_5
warning: refname 'dev_20120430_sprint_5' is ambiguous.
Already on 'dev_20120430_sprint_5'
kenorbs-MacBook-Air:docroot kenorb$ drush cc all

'all' cache was cleared                                                                                                                                                                        [success]
kenorbs-MacBook-Air:docroot kenorb$ drush eval "echo 'Drupal bootstrapped'"
Drupal bootstrappedkenorbs-MacBook-Air:docroot kenorb$ 
kenorbs-MacBook-Air:docroot kenorb$ drush sql-query "SELECT name, filename FROM {system} WHERE name = 'ctools'"
name	filename
ctools	sites/all/modules/contrib/ctools/ctools.module
kenorbs-MacBook-Air:docroot kenorb$ git checkout charlie_dev_20120327_2
warning: refname 'charlie_dev_20120327_2' is ambiguous.
Switched to branch 'charlie_dev_20120327_2'
kenorbs-MacBook-Air:docroot kenorb$ drush cc all

require_once(/Users/kenorb/Sites/AAT/docroot/sites/all/modules/contrib/ctools/includes/export-ui.inc): failed to open stream: No such file or directory plugins.inc:787                        [warning]
Drush command terminated abnormally due to an unrecoverable error.                                                                                                                             [error]
Error: require_once(): Failed opening required '/Users/kenorb/Sites/AAT/docroot/sites/all/modules/contrib/ctools/includes/export-ui.inc'
(include_path='.:/Applications/MAMP/bin/php/php5.2.17/lib/php') in /Users/kenorb/Sites/AAT/docroot/profiles/acquia/modules/ctools/includes/plugins.inc, line 787
kenorbs-MacBook-Air:docroot kenorb$ drush sql-query "SELECT name, filename FROM {system} WHERE name = 'ctools'"
name	filename
ctools	sites/all/modules/contrib/ctools/ctools.module
kenorbs-MacBook-Air:docroot kenorb$ ls profiles/acquia/modules/ctools/
API.txt			UPGRADE.txt		ctools.api.php		ctools.module		ctools_custom_content	images			page_manager		tests
CHANGELOG.txt		bulk_export		ctools.info		ctools_access_ruleset	ctools_plugin_example	includes		plugins			views_content
LICENSE.txt		css			ctools.install		ctools_ajax_sample	help			js			stylizer
kenorbs-MacBook-Air:docroot kenorb$ drush eval "system_rebuild_module_data();"
require_once(/Users/kenorb/Sites/AAT/docroot/sites/all/modules/contrib/ctools/includes/export-ui.inc): failed to open stream: No such file or directory plugins.inc:787                        [warning]
Drush command terminated abnormally due to an unrecoverable error.                                                                                                                             [error]
Error: require_once(): Failed opening required '/Users/kenorb/Sites/AAT/docroot/sites/all/modules/contrib/ctools/includes/export-ui.inc'
(include_path='.:/Applications/MAMP/bin/php/php5.2.17/lib/php') in /Users/kenorb/Sites/AAT/docroot/profiles/acquia/modules/ctools/includes/plugins.inc, line 787
kenorbs-MacBook-Air:docroot kenorb$ drush sql-query "SELECT name, filename FROM {system} WHERE name = 'ctools'"
name	filename
ctools	sites/all/modules/contrib/ctools/ctools.module
kenorbs-MacBook-Air:docroot kenorb$ drush eval "system_rebuild_module_data();"
require_once(/Users/kenorb/Sites/AAT/docroot/sites/all/modules/contrib/ctools/includes/export-ui.inc): failed to open stream: No such file or directory plugins.inc:787                        [warning]
Drush command terminated abnormally due to an unrecoverable error.                                                                                                                             [error]
Error: require_once(): Failed opening required '/Users/kenorb/Sites/AAT/docroot/sites/all/modules/contrib/ctools/includes/export-ui.inc'
(include_path='.:/Applications/MAMP/bin/php/php5.2.17/lib/php') in /Users/kenorb/Sites/AAT/docroot/profiles/acquia/modules/ctools/includes/plugins.inc, line 787
kenorbs-MacBook-Air:docroot kenorb$ drush sql-query "SELECT name, filename FROM {system} WHERE name = 'ctools'"
name	filename
ctools	sites/all/modules/contrib/ctools/ctools.module
kenorbs-MacBook-Air:docroot kenorb$ drush eval "system_rebuild_module_data();"
require_once(/Users/kenorb/Sites/AAT/docroot/sites/all/modules/contrib/ctools/includes/export-ui.inc): failed to open stream: No such file or directory plugins.inc:787                        [warning]
Drush command terminated abnormally due to an unrecoverable error.                                                                                                                             [error]
Error: require_once(): Failed opening required '/Users/kenorb/Sites/AAT/docroot/sites/all/modules/contrib/ctools/includes/export-ui.inc'
(include_path='.:/Applications/MAMP/bin/php/php5.2.17/lib/php') in /Users/kenorb/Sites/AAT/docroot/profiles/acquia/modules/ctools/includes/plugins.inc, line 787
kenorbs-MacBook-Air:docroot kenorb$ drush cc all

require_once(/Users/kenorb/Sites/AAT/docroot/sites/all/modules/contrib/ctools/includes/export-ui.inc): failed to open stream: No such file or directory plugins.inc:787                        [warning]
Drush command terminated abnormally due to an unrecoverable error.                                                                                                                             [error]
Error: require_once(): Failed opening required '/Users/kenorb/Sites/AAT/docroot/sites/all/modules/contrib/ctools/includes/export-ui.inc'
(include_path='.:/Applications/MAMP/bin/php/php5.2.17/lib/php') in /Users/kenorb/Sites/AAT/docroot/profiles/acquia/modules/ctools/includes/plugins.inc, line 787
kenorbs-MacBook-Air:docroot kenorb$ drush eval "system_rebuild_module_data();"
require_once(/Users/kenorb/Sites/AAT/docroot/sites/all/modules/contrib/ctools/includes/export-ui.inc): failed to open stream: No such file or directory plugins.inc:787                        [warning]
Drush command terminated abnormally due to an unrecoverable error.                                                                                                                             [error]
Error: require_once(): Failed opening required '/Users/kenorb/Sites/AAT/docroot/sites/all/modules/contrib/ctools/includes/export-ui.inc'
(include_path='.:/Applications/MAMP/bin/php/php5.2.17/lib/php') in /Users/kenorb/Sites/AAT/docroot/profiles/acquia/modules/ctools/includes/plugins.inc, line 787

After some playing around on the same branch (charlie_dev_20120327_2 ) I've managed to fix it:

[1]+ drush cc all &
kenorbs-MacBook-Air:docroot kenorb$ drush eval "system_rebuild_module_data();"
'all' cache was cleared                                                                                                                                                                        [success]
[1]+  Done                    drush cc all
kenorbs-MacBook-Air:docroot kenorb$ drush cc all

'all' cache was cleared                                                                                                                                                                        [success]
kenorbs-MacBook-Air:docroot kenorb$ 
kenorbs-MacBook-Air:docroot kenorb$ drush sql-query "SELECT name, filename FROM {system} WHERE name = 'ctools'"
name	filename
ctools	profiles/acquia/modules/ctools/ctools.module
kenorbs-MacBook-Air:docroot kenorb$ drush eval "echo 'Drupal bootstrapped\n'"
Drupal bootstrapped\n
kenorbs-MacBook-Air:docroot kenorb$ 

The problem is difficult to reproduce, sometimes it just works, sometimes is not, weird a stuff.
I could provide some xdebug file, but it's like half a gig.
Basically it shouldn't throw any error during clearing the cache, as mentioned in #1, it isn't part of the core.

UPDATE:
Temporary fix is done in following order:

$ drush sql-query 'DELETE FROM {cache}'
$ drush eval "system_rebuild_module_data();"
alltooeasy’s picture

Hmm, wasn't able to reproduce this. I suspect a bug/module combination (or lack of!)

Moving off of MAMP onto AMP installed Natively seems to have resulted in a generally much smoother dev process.

However the rule here is back up/clone/copy/save etc as much as possible!
I've lost days (weeks!) to this kind of problem.

Thanks so much for the detailed responses.

jlyon’s picture

thim’s picture

Issue summary: View changes
Issue tags: -

I followed jlyon his advice #17 and used the registry_rebuild module and this fixed all the miss Fatal error: require_once()

mediaformat’s picture

+1 registry_rebuild, solved things for me also.

alamp’s picture

+1 register_rebuild works fine for me as well!

My error was

Fatal error: require_once(): Failed opening required '/XX/profiles/opigno_lms/modules/contrib/og/plugins/entityreference/behavior/og_behavior.inc' (include_path='.:/Applications/XAMPP/xamppfiles/lib/php') in XXX/sites/all/modules/ctools/includes/plugins.inc on line 480
pal4life’s picture

Status: Active » Closed (fixed)

+1000 for registry rebuild, worked for me as well.

andrea_london’s picture

after 4 hours of troubleshooting, registry rebulid via drush solved the issue for me, that was what i was looking for
Thanks +1

jonathan.henderson’s picture

Just in case someone has the same problem as me:
I had moved some modules from a multi-site subfolder to the sites/all folder.

I was still receiving the "require_once(): Failed opening required.." errors even after running Registry Rebuild.

I noticed that in the error message the path of the file generating the error was the path that I had moved the module from (i.e. the file didn't actually exist there any more yet the error was still coming from there)

I figured that the APC caching had cached the file in the old location (a guess).

I restarted PHP (php5-fpm in my case) and that fixed it.

Skeptimom’s picture

Registry Rebuild & a drush rr fixed my error upon uploading a SQL dumpfile. HOORAY and thank you.

Anonymous’s picture

#6 worked for me

kikecastillo’s picture

#24 This definitely worked for me. Thanks!

kenorb’s picture

Status: Closed (fixed) » Fixed
nicolas bouteille’s picture

In my case I was trying to include node_clone/clone.pages.inc so I called ctools_include('clone.pages', 'node_clone', ''); but the module name is actually 'clone' not 'node_clone' AAHH! so I had to change it to ctools_include('clone.pages', 'clone', ''); for it to work.
I had a very hard time to find that because by default, when the name of the module does not exist, the path in the error message is path_to_drupal_root//name_of_unknown_module which makes you think you have a copy of the module at your drupal root...
and it turns out that I actually also had a backup of the node_clone module stored in my Drupal root!!! What were the odds!? So I started deleting it and rebuilding the registry but the error would not go away... obviously. Damn you node_clone for not giving the name of your module to your module's folder!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

jenlampton’s picture

Status: Closed (fixed) » Active

Cross linking all the other issues I've found that started because of this change in Ctools 7.x-1.6.
#2461809: Cannot delete custom theme layout directory
#2207147: Fatal error: require_once() panel_context.inc

I'm also changing the status because I don't see a patch in this issue that was committed that fixes this problem. It's still a pretty serious bug IMO. Files that are not being used should not be require_once'd! ESP if it means fatal errors that can not be recovered from w/o a registry rebuild.

aprilr’s picture

I had this issue with commerce (not ctools) after a fresh drupal installation. Running the Registry Rebuild (#17) cleared it up for me.

I did have to run it twice...

Thanks!

yakoub’s picture

temporary workaround :
run this sql query directly to database .

delete from cache where cid like 'ctools_plugin%';

then delete the plugin directory you wish to be removed .

snathaidmhor’s picture

I'm seeing this issue as well on a site with ctools, panels, panels_style_collapsible, that has a panels-layouts plugin in a theme. We are in a central hosting environment using Aegir. On cloning from an existing site to a new site with an updated platform (core and module updates), the clone fails with the following error:

require_once(/var/aegir/is-cluster4/lcb-stage-7.37-spm-051815/sites/lcbweb1.uoregon.edu/themes/uospmtheme/panels-layouts/blank/blank.inc): failed to open stream: No such file or directory plugins.inc:475
Drush command terminated abnormally due to an unrecoverable error. Error: require_once(): Failed opening required '/var/aegir/is-cluster4/lcb-stage-7.37-spm-051815/sites/lcbweb1.uoregon.edu/themes/uospmtheme/panels-layouts/blank/blank.inc' (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/sites/cluster4/lcb-stage-7.37-spm-051815/sites/all/modules/ctools/includes/plugins.inc, line 475

Tried registry rebuild once prior to cloning = no go.
Tried flush cache and registry rebuild once (or twice) prior to cloning = no go OR worked once

If I clone the original production site to the exact same platform and then flush cache and registry rebuild before cloning to the new platform = works every time (so far). However, flushing cache and running registry rebuild once or twice and then cloning straight from a production site to the new platform rarely works.

reg’s picture

I just came across this and got no joy from running "drush rr" unfortunately. My exact error is below:

Fatal error: require_once(): Failed opening required 
  '/sites/all/themes/omega/omega/panels/layouts/grid-3/grid-3.inc' 
  (include_path='.:/usr/share/php5:/usr/share/php5/PEAR') 
  in 
  /sites/all/modules/contrib/__commonly_depended_on/ctools/includes/plugins.inc 
  on line 475

I got this by:

  • Installing the theme cloudy
  • Installing the theme omega which it is dependant on (I believe)
  • Enabling both themes
  • Set default theme to "cloudy"
  • Go to a page or two using the cloudy theme
  • Set default theme to something else (in my case I installed mayo and started using it.)
  • Disable both cloudy and omega
  • Delete the two themes just disabled.
  • Going to any page now creates the error.

Whether doing that on a clean install will reproduce it I don't know but I thought I would give the steps in the hope it makes it reproducible.

reg’s picture

I'm going to copy this over to https://www.drupal.org/node/2466845 because it has the same line number so it might be closer to my problem although I suspect they one of the same.

reg’s picture

Update: In my case running drush rr and clearing all cache didn't fix it however restarting memcached did so I would say in my case it's a problem with memory caching.

capfive’s picture

Here was my case, also #24 fixed my issue

Had a bootstrap theme that I disabled and deleted, it also had some custom panels layouts, and once it removed them, this error came up

[fcgid:warn] [pid 30817] [client 192.168.0.23:54196] mod_fcgid: stderr: PHP Fatal error:  require_once(): Failed opening required '/sites/all/themes/bootstrap_mb/layouts/mb-services/mb-services.inc' (include_path='.:/usr/share/php:/usr/share/pear') in /sites/all/modules/ctools/includes/plugins.inc on line 475, referer: admin/reports/event/8777

Rebuilt the registry and it is now fixed :)

leewillis77’s picture

We've just hit this as well. In our case, the cause is moving a module from sites/all/modules/contrib/ to sites/all/modules/patched/

In our case the module that moved was video_embed_field - however presumably moving the location of any module that implements a ctools plugin would cause this behaviour.

The error in our case is:

require_once(/var/www/site/releases/20150907122422/sites/all/modules/contrib/video_embed_field/plugins/export_ui/video_embed_field_export_ui.inc):  [warning]
failed to open stream: No such file or directory plugins.inc:477

So - it's trying to load the plugin from the old module path (under sites/all/modules/contrib), not the new (sites/all/modules/patched).

Obviously since this error is thrown during a cache clear it makes it difficult to proceed.

yakoub’s picture

temporary workaround :
run this sql query directly to database .

delete from cache where cid like 'ctools_plugin%';

then delete the plugin directory you wish to be removed .

anybody’s picture

Temporary workaround from #40 worked but this problem still exists and is really not nice for themers.

joelhsmith’s picture

In my case, I had moved a Feature module from one folder to another folder. It gave me the same error. Steps to resolve issue for me:
1. Disabled the offending module via drush,
2. drush rr (registry-rebuild),
3. drush cc all,
4. re-enabled the module,
5. drush cc all.

Greennos’s picture

Hi there, I'm sure you can help me with the same failure using very basic comments as I'm quite unfamiliar with command lines. Furthermore, my website is homed at 1and1 and I can't seem to have command lines, unless someone knows how to?
Here is the message i have from my Drupal after updating it from the admin pages:
Fatal error: require_once(): Failed opening required '/homepages/17/d393243800/htdocs/clickandbuilds/Drupal/DrupalOPS/sites/all/themes/omega/omega/panels/layouts/omega/omega.inc' (include_path='.:/usr/lib/php5.4') in /homepages/17/d393243800/htdocs/clickandbuilds/Drupal/DrupalOPS/sites/all/modules/ctools/includes/plugins.inc on line 477

Thanks a lot for help!

kenorb’s picture

@Greennos Try clearing cache, if doesn't help, you've to check if you uploaded all files to the server, so you don't have anything missing. If you've further questions/issues, try asking at: Drupal Answers.

Greennos’s picture

@kenorb
How to clean cache? I've tried the "drush cc all" command line from my ssh without success. It replies the command is not found...

kenorb’s picture

@Greennos You've to find the right ticket to discuss it, or raise a new ticket either at Drupal.org, Drupal Groups or look for existing posts or ask at DA as without knowing your exact error message, it could be anything (missing drush, wrong PATH value, you're not executing in docroot, you're not specifying your site profile, misconfigured drush, etc.), and nobody will answer you here, as you're currently posting it at the bug report of ctools, so your issue I guess is not related this this, and you can easily annoy other people who're subscribe to it.

Hancock Glen’s picture

Fatal error: require_once(): Failed opening required '/home/hancockg/public_html/hancockglen.com/sites/all/modules/ctools-7.x-1.7/ctools/plugins/content_types/node/node.inc' (include_path='.:/opt/alt/php55/usr/share/pear:/opt/alt/php55/usr/share/php') in /home/hancockg/public_html/hancockglen.com/sites/all/modules/ctools-7.x-1.9/ctools/includes/plugins.inc on line 477

This after updating. Happened after trying to update to 1.8 too

robloach’s picture

Status: Active » Needs review
StatusFileSize
new862 bytes
robloach’s picture

StatusFileSize
new862 bytes

This changes the require to an include so you get a warning rather than a fatal error.

yakoub’s picture

you can't change require to include and claim you solved the problem .

reg’s picture

Essentially what you are doing with that change is causing PHP to generate a warning when it can't include the file instead of stopping on a fatal error. That's more dangerous than before.

kenorb’s picture

Status: Needs review » Needs work
ChrisValentine’s picture

Just backed myself into a corner with this one too in trying to update a couple of sites to 7.41 - going round in circles! In fact I just cleared the caches and now I've got nothing at all!

Chris.

fubarhouse’s picture

I've got this issue popping up everywhere now!

I've updated my build scripts to include a couple of drush commands to clean up the module paths, but it basically started for no reason after completely rebuilding some vagrant boxes and it's recovering module locations which are at least 4 months old.

Thanks to those who've provided temporary fixes, but ultimately a proper fix would be good.

mrromios’s picture

Hi all!
I also have this problem everyday)
I think need to just make a file_exist() before require_once().

reg’s picture

@Darth RomiOS: I'm not sure if that's a good solution. If it is rightly expecting the file to be there then ignoring that the file doesn't with file_exists() could just be a way of letting your site degrade.

You might be better off that it stops you to fix the problem. I'm not really sure but checking the code carefully and making sure you fully understand it before making such a change would be a smart move.

mrromios’s picture

@Reg. If you read the description of issue, you can see that the problem related with cache: ctools try to make require_once for cached file paths and fatal error doesn't allow to clear cache via admin page / drush. Checking of file existing (with some warning message if file doesn't exist) can solve this problem. module_load_include. There is good solution i think.

reg’s picture

@Darth RomiOS: Yeah, it has been a while since I read the description, it sounds like you've done your homework so it sound good to me.

I think the only thing I might add as an idea is that adding some code that once a "file is not found" type problem is detected that perhaps writing a routine (or whatever, a call to exiting function etc.) that clears all that cache automatically might be appropriate. Then if the structure of the code allows you could pick up the new/proper/"if it exists" location of the desired file and try again. If it fails on the corrected retry then issue an error.

This way we won't ignore the problem if there really is one and it's not just an outdated cache issue.

mrromios’s picture

@Reg. I think, the main idea of this issue, it is possibility to move ctools plugins without fatal error. So, there are no need extra rewriting. Just replace fatal error on warning to keep site alive :)

yakoub’s picture

consider the temporary fix i wrote at comment #40 .

the required resolution to this problem must include cleaning the cache and not only avoiding generating an error .
because if you keep the cache state inconsistent then other problems might rise that we can not predict .

reg’s picture

I tend to agree. If you know the cache is wrong you need to clear it. If not all of the ctools cache then at least the entry you know is wrong.

I'm not sure what causes the ctools cache to become invalid... if it's modules being moved/added/deleted then probably invalidating the cache entry you found to be wrong would be a nice precision fix but if it's something that can get invalidated just through usage of the site then probably you want to clear all the ctools cache upon finding an error.

mjbragg75’s picture

I wish I had seen items 48/49 two weeks ago. No hair left. (OK, not much before). This is my first "real" engagement (pro-bono, but very visible), and I am way behind now.

For a long time I thought it was the conflict between CTools and Currency (and related modules). And of course I couldn't fix.

In fact, after doing the "include_once" fix, and getting things working, when I upgraded from CTools 7.x-1.5 to 7.x-1.9, it broke again in the same way. Even with Currency gone (my design no longer needs it). So I had to re-apply the "include_once." Was also surprised to see the /currency/currency/ctools.... path re-appear with 1.9.

I will feel more comfortable once there is a different fix.

usama009’s picture

I my case that error comes when i install Commerce Billy Mail 7.x-1.0-beta5 module.
This error also disables my other commerce billy functionality that I installed and disable all blocks which are created by commerce billy module (commerce billy module is already checked).

anybody’s picture

I'm the maintainer of commerce billy mail but I have no clue about a connection of these two problems. Any ideas what might cause this? Does the same problem exist with the latest .dev version of commerce billy mail?

usama009’s picture

Sir Anybody I press back button of a browser and flush all cashes it takes time but clear my problem and then I uninstalled commerce billy, commerce billy mail and commerce reports modules clear cashs, reinstall modules and clear cash again this solves my problem thank you for such a nice module. (I am talking about beta version).

heddn’s picture

Status: Needs work » Needs review
Issue tags: -mamp, -Fatal error: require_once() [function.require]
StatusFileSize
new549 bytes

I've started seeing this (highly annoying) issue a lot in the past 6 months. Finally tracked it down today to this issue. The problem seems to be where a file is renamed or deleted. Let's fix that by checking if it exists first.

yakoub’s picture

i don't see how #66 logic is different than #49 .
both of them are insufficient solution to this problem .

heddn’s picture

If the file doesn't exist, you cannot require it or use it. Period. Magic won't happen to create it. If you rename a ctools plugin or delete one, with the patch in #67, you won't have an inoperable website. Without the patch, the site stops working.

yakoub’s picture

patch by patch of this poor quality solutions will by time lead to module becoming full of holes .
no yet to consider #40, which is the first thread to find the correct solution .

muschpusch’s picture

+ 1 for #49 throwing a warning is correct since some ctools plugin disappeared or has been moved. We face this problem a lot when switching branches. @kenorb you moved the state to needs work. Why? What is the desired behaviour?

kenorb’s picture

@muschpusch This was change as per #50 and #51 concerns. If there are no concerns anymore and it works for more people who tested that patch, change it back to Needs review.

japerry’s picture

Priority: Normal » Critical

Pushing this up to critical. If a module or file is removed/updated it kills sites, especially production ones. The patch in #66 is a decent start.

papagrande’s picture

The patch in #66 works for me, but I added a bit more to prevent the fatal error for page manager users along with a useful message. To keep things moving though, I'd be fine with committing #66.

papagrande’s picture

StatusFileSize
new1.29 KB
new810 bytes

Fixed the paths in my #73 patch and provided an interdiff with #66.

edison_doulos’s picture

Hi, I had a similar issue.

I solved in this way (with Terminal):
1. Locating under my project folder.

2. Running the following commands:
drush sqlq 'truncate table cache'

drush cc all

Note: Drush installation is required, if you are using MAC this guide can be helpful.

yakoub’s picture

@edison_doulos i wrote similar solution in comment #40

mdelreal_ricochet’s picture

#42 did it for me, plugins.inc under /modules/contrib/ctools was trying to include ctools_export_ui.inc from /modules/ctools (which didn't exist) disabling ctools, doing a rr and then clearing the cache and finally reenabling the module solved the problem.

aprilr’s picture

#17 to the rescue once again! :-)

amjad.khan’s picture

the file is missing in the location. added the file and solved the issue.

regards
Amjad Khan
http://ezsolution.mobileaps.in/

joelpittet’s picture

Status: Needs review » Needs work
  1. +++ b/includes/plugins.inc
    @@ -778,7 +778,11 @@
    +      } else {
    

    nit: break the else on to a new line.

  2. +++ b/includes/plugins.inc
    @@ -778,7 +778,11 @@
    +        drupal_set_message(t("The @plugin file is missing.", array('@plugin' => $plugin_definition['file'])), 'error', FALSE);
    

    What about a watchdog() message instead?

fox_01’s picture

#74 fixed it for me. i deleted the ctools plugin file and then after the first drush cc all the message showed up that a files is missing. after the second drush cc all there are no messages anymore.

papagrande’s picture

Status: Needs work » Closed (duplicate)

This got fixed in #1775612: ctools calling missing file with commit #b2acc43 to the dev version.

yakoub’s picture

quote the Exception : "If you have recently removed this plugin then please clear your cache."
if clearing cache solves the problem, this whole issue wouldn't have been opened in the first place !!!
see my comment at comment #40

sandeep.m.das’s picture

The following is essentially the same as described in #75, which is using drush. In my humble shared hosting development server, drush was not available. Those who are not good with drush or unable to access it may find this post useful.

I encountered this error, and the problem was the ctools folder appearing in 2 instances in my site's folder. That is, there were two ctools folders, one inside the modules folder and the other inside the profiles folder. Managed to solve it by:

A. fired up putty and logged into the (shared) server. Navigated into the site's folder. Located all ctools folders by running a find command. Renamed the one inside modules folder. *
B. fired up PHPMyAdmin and logged into the site's Mysql DB.
C. located and truncated every table that has the word cache in its name. I did so by maintaining the foreign key restrainment ON.
D. loaded /update.php in browser. It came up with exceptions as mentioned in #83. I ignored everything and clicked the Retry link.
E. site is back on rails! Cleaned-up my operation by deleting the renamed folder.

NOTES: *If you CAN'T find more than two instance of a culprit module (in step A) the problem could be something else; doing the remaining steps may not help you out.
*Taking a backup copy of your DB is good idea before attempting step A.

ugintl’s picture

Not sure, but I guess https://www.drupal.org/node/2461809#comment-9999253 is the solution

yakoub’s picture

ya, i suggested that solution too : https://www.drupal.org/node/1032054#comment-10302241
but nobody seems to take it seriously .

biggm’s picture

It's worth noting that in my instance receiving this error I consistently fixed it by:

  1. Disable Views -- using Drush in my case
  2. Flush site cache
  3. Re-enable Views