From one second to another I receive the follwing Error when I try to open a page in the Drupal Admin (for example for clearing the cache).
Fatal error: Class Drupal\Core\Database\Statement contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Drupal\Core\Database\StatementInterface::fetchObject) in XXXX\core\lib\Drupal\Core\Database\Statement.php on line 21
When I remove the line "implements StatementInterface" than the admin works fine but the Website frontend still doesnt work.. Any idea?
I have no Modules installed. Just the basic drupal 8 standard installtion and I cleare the cache with a database query already but still the same problem.
Comments
Comment #2
cilefen CreditAttribution: cilefen as a volunteer commentedI have not seen this on any 8.0.x version, including 8.0.3. Drupal\Core\Database\Statement contains no abstract methods. Where did you obtain Drupal 8.0.3?
Comment #3
mo86 CreditAttribution: mo86 commentedI downloaded it from this offical site.
So now everything works again. The following happend:
After removing the "implements StatementInterface" line the admin worked again. So still the frontend throwed the follwing error:
Error: Call to undefined method Drupal\Core\Database\Statement::fetchObject() in Drupal\comment\CommentStatistics->read() (line 80 of xxxx\core\modules\comment\src\CommentStatistics.php).
After deactivating the comments module the frontend and admin both worked. Now a few hours and a few new articles later I reactivated the comments module and I also added the StatementInterface implementation back to the Core\Database\Statement.php. Now everything works fine.
Some days you really dont understand whats going on...
Comment #4
daffie CreditAttribution: daffie commented@mo86: Can you tell what your memory limit is for php? I have seen these kind of errors and they can come from a lack of available memory.
Comment #5
jelo CreditAttribution: jelo commentedThis just happened on a number of my dev sites after upgrading to Drupal 7.50. Affected modules/core vary, e.g.
Fatal error: Class SystemQueue contains 4 abstract methods and must therefore be declared abstract or implement the remaining methods
Comment #6
cilefen CreditAttribution: cilefen as a volunteer commentedHave you checked your memory limit and did you delete core/ and vendor/ during the upgrade (you should)?
Comment #7
jelo CreditAttribution: jelo commentedMemory limit is 560MB. I am in D7 so I am not sure what you mean by core/ and vendor/. I did indeed copy all files over the existing files. In another thread I read that sometimes these errors could be caused by opcode caches or memcaches. As it turns out, during the first few minutes I got WSOD on every couple of pageloads. After an hour or so I am unable to reproduce the issues, i.e. it seems to have been some temporary transition after the upgrade.
Comment #8
cilefen CreditAttribution: cilefen as a volunteer commentedSorry, somebody opened this as a D8 issue.
Comment #9
cilefen CreditAttribution: cilefen as a volunteer commented@jelo Certain opcode caches can sometimes hang onto replaced code, even if configured properly.
Comment #10
jelo CreditAttribution: jelo commentedThe reason why I replied here is because I figured it might have been some backported feature from D8 to D7.50, but if the opcode cache might explain this then there may not be an issue at all...
Comment #11
cilefen CreditAttribution: cilefen as a volunteer commentedok
Comment #12
khaldoon_masud CreditAttribution: khaldoon_masud as a volunteer commentedI was getting this error when i used hook_preprocess_node hook in one of my modules. hope it helps.
Comment #13
owenmck CreditAttribution: owenmck commentedI just reproduced this error in XAMPP setup.
Open the admin page /admin/config/system/cron
Run Drupal cron via Windows task scheduler
refresh the admin page.
Also, now appears on the status report page: /admin/reports/status
Comment #14
owenmck CreditAttribution: owenmck commentedComment #15
owenmck CreditAttribution: owenmck commentedThis happened on my localhost scratchpad, running Drupal 8.3.7.
I then got my site back by clearing all the caches manually, stopping MySQL & Apache then restarting them.
Comment #16
flyke CreditAttribution: flyke commentedWhat @owenmck said worked for me as well.
So if you have this problem:
- empty every table starting with cache_
- restart your mamp or xamp or whatever
Comment #17
cizario CreditAttribution: cizario as a volunteer and commentedhi there,
i've got that fatal error with drupal 8.6.0. i simply restarted my Apache server and the issue is resolved with no effort.
sometimes, strange behavior need 'system' reboot.
i've got the idea cause i was working on LARAVEL project and i encountered similar error. Laravel and Drupal 8 are both using Symfony components and sometimes you have to digg deeper.
hope this can help someone else.
Comment #18
cilefen CreditAttribution: cilefen as a volunteer commented@cizario This is likely caused by the PHP opcache configuration on the web server.
Comment #19
MegaChriz CreditAttribution: MegaChriz at WebCoo commentedI'm also experiencing this issue quite often with Acquia Dev Desktop using PHP 7.0.14 on Mac OS X 10.11. Sometimes it happens multiple times a day. It never occurred using PHP 5. In my case it cannot be caused by opcache, since that extension is disabled. Restarting Apache always helps, but for a limited time only.
The issue isn't limited to Drupal however. It seems PHP loses parts of PDO from time to time. Maybe a memory issue in PHP that only occurs with certain configurations? Cause it happens only on my local machine and not on the webhosting server. I have set the memory limit to 512 MB.
It happens outside of Drupal too:
https://github.com/doctrine/dbal/issues/2628
https://bugs.php.net/bug.php?id=72112
https://stackoverflow.com/questions/42503240/intermittent-php-abstract-c...
https://stackoverflow.com/questions/45051541/class-ci-session-files-driv...
Comment #20
g089h515r806 CreditAttribution: g089h515r806 commentedsame issue with xampp.
Comment #21
MegaChriz CreditAttribution: MegaChriz at WebCoo commentedFyi, I haven't had this error for a quite a while. I did upgrade to PHP 7.1.29 in the mean time, so I'm assuming the bug is somewhere between PHP 7.0.14 and PHP 7.1.29.
Comment #22
FinderFees CreditAttribution: FinderFees commentedChriz, you said you hadn't had the error in quite a while. Did you find a work-around for this bug for 7.0.14? I'm on 7.1.29 and currently experiencing this but won't be able to update for, at minimum, a couple of weeks. Just wondering if there is a band-aid I can put in place until being able to update to 7.2.
Comment #23
mfrosch CreditAttribution: mfrosch as a volunteer commentedI did a reboot on windows (xampp) and the problem was gone