I use TAC from 2011-11-16 and Drupal 7.9.
When, rebuilidng content permissions, at 98%, the following error appears:

Fatal error: spl_autoload() [function.spl-autoload]: Class Database could not be loaded in database.inc on line 2412

Sometimes there is no error, So perhaps limited resources are the prolem. I have around 10.000 records in node_access.

I'll try again with dev from dec-4.

Comments

johnv’s picture

Project: Content Taxonomy » Taxonomy Access Control

Oops, wrong module..

xjm’s picture

Category: bug » support

Thanks @johnv. Usually errors during node access rebuild are caused by a corrupt node or user record. (Also, TAC uses the core node access system, so the problem might occur with any access control module.) Couple questions:

  1. What database are you using?
  2. Is it possible to provide a backtrace or log messages from just before the error occurs?
johnv’s picture

xjm, I'm using mysql. There are no (!) messages in the log. I am not familiar with backtracing - my IDE consists of Editpad/notepad..

xjm’s picture

Hmm, in that case, I'd suggest backing up your database in a state that sometimes triggers the error, and maybe testing in a local or development environment.

Here's a handy article on how to get backtraces:
http://www.lullabot.com/articles/quick-and-dirty-debugging
Be sure to read the comments as well, as they include some good tips. You can also use the devel module to add backtraces more easily (and without hacking core), but that adds a performance overhead, so it could make matters worse.

Basically we want to figure out if there's a specific node record that's causing the problem, or whether it's just limited resources as you suggest.

johnv’s picture

OK, it might take a while, but i'll be back with more info.

johnv’s picture

Status: Active » Postponed (maintainer needs more info)

I am not sure if this error belongs to this module.
I have the same error every time I generate a Views display, which only differs slightly from another display, that is working fine....

johnv’s picture

Project: Taxonomy Access Control » Drupal core
Version: 7.x-1.x-dev » 7.9
Component: Code » node system
Status: Postponed (maintainer needs more info) » Active

Above error happens also when only the module Node access user reference is used, so this seems to be a core issue.
This is the line of code:

function db_merge($table, array $options = array()) {
  if (empty($options['target']) || $options['target'] == 'slave') {
    $options['target'] = 'default';
  }
  return Database::getConnection($options['target'])->merge($table, $options);
}
johnv’s picture

More info: The function db_merge is calle 1 time for table cache and 20 times for table cache_field .
So I cleared my caches (thus the table), but during 'Rebuild content access', the table again grows happily to 14,099 lines, until Rebuilding stalls at 95%. Then, in db_merge, the error occurs.

Is cache_field too big? can I avoid caching during Rebuild permissions?

johnv’s picture

Title: Fatal error: spl_autoload(): Class Database could not be loaded in database.inc on line 2412 » Rebuild permissions generates Fatal error: spl_autoload(): Class Database could not be loaded in database.inc on line 2412

During the execution of Rebuild permissions, I executed cache_clear_all('*', 'cache_field', TRUE); using devel/php page. At 95%, there were only around 500 lines in the table.
Same result.. :-(

xjm’s picture

Version: 7.9 » 8.x-dev
Status: Active » Postponed (maintainer needs more info)

Like I mentioned earlier, this is usually tied to corrupt data, so I'm not sure there's a core bug. Can you try executing node_access_rebuild(FALSE) from drush and see if that resolves the issue? Also, it's hard to guess what the problem might be without a backtrace that shows the data object being processed, etc.

johnv’s picture

Can't find a good spot for backtracing..
I thought this might be another symptom of the same problem: #1375748: Too many node_access-records
But apparently it is normal behaviour that every node gest 1 line in node_access table.

johnv’s picture

xjm, thanks for your help. I have a successful rebuild-run. I am not sure about the cause, but I used your hint about the corrupt data. This is what I did:
- I learned that node_access-rebuild rebuilds starting with lowest nid, in chunks of 20 nodes.
- So I checked the highest nid in node_access table;
- edited and saved the next 25 nodes; (none of them seamed erroneous)
- waited until non-peak hours, to make sure server has lowest capacity-needs;
- flushed all caches;
- did a Rebuild --> Success!

I will have to do some more runs to be sure that this was the root cause, but for now I am happy.

I think current issue-status is OK for the moment...

johnv’s picture

FYI, Today I tried again a rebuild.
First time, I got the same Fatal error: spl_autoload(). I did a cache-flush and after that, the rebuild was OK. Strange... just a normal short of memory??

johnv’s picture

Issue summary: View changes

.

cilefen’s picture

Category: Support request » Bug report
Issue summary: View changes
Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

I think this has been running smoothly with D8 releases whose platforms meet requirements.