chasecmiller / Crumbls-Cache

Caching for WP via PHPFastCache
4 stars 3 forks source link

issue with object-cache #18

Closed mxmkmarquette closed 7 years ago

mxmkmarquette commented 7 years ago

when i tried to create a new post it turn into loop and then error 500. when i tried to delete plugin it do not delete it.

both was when i was using memcached and memcache.

when removing the object-cache.php i was able to return to create a new post and also delete plugin. but when i tried to post it's telling me this 397 plugin.php

chasecmiller commented 7 years ago

Perfect. Thanks. I have a line dump listed there to help me debug it that was triggered on your end. I'm trying to emulate the 500 error first. The plugin currently does not uninstall advanced-cache.php or object-cache.php.

mxmkmarquette commented 7 years ago

me i just add to install crumbls-cache, with advanced and object-cache, set the thing, then tried to go into the admin bar or in the section to create or add a new post and i got the error 500.

and thank by the way for you hard work and for taking the time you take to make this magnificient plugin work like you are awesome my friend.

chasecmiller commented 7 years ago

Have any error log info on the 500 error? Thanks!

I just pushed an update to get rid of the 397 and line stop right after it to allow deleting by tags.

chasecmiller commented 7 years ago

Adding in a quick dump to loggly to help me debug this. It will hopefully give us enough info to troubleshoot it.

chasecmiller commented 7 years ago

I added in logging. Next time you use the latest, your error logging will temporarily dump over to Loggly so I can get more information about what's going on. Hopefully it works well. Haven't ever used it on a 500.

mxmkmarquette commented 7 years ago

i just activate the big gun to find the problem that's what i get. // Enable WP_DEBUG mode define( 'WP_DEBUG', true );

// Enable Debug logging to the /wp-content/debug.log file define( 'WP_DEBUG_LOG', true );

after have activate // Use dev versions of core JS and CSS files (only needed if you are modifying these core files) define( 'SCRIPT_DEBUG', true );

directly on the page where i had error 500 now i have

Warning: Memcache collision detected, you used both Memcache and Memcached driver in your script, this may leads to unexpected behaviours in /home/madmax/public_html/neufsvies/wp-content/plugins/crumbls_cache/assets/php/phpfastcache/src/phpFastCache/Core/MemcacheDriverCollisionDetectorTrait.php on line 30

Notice: wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.) in /home/madmax/public_html/wp-includes/functions.php on line 4137

Warning: Memcache collision detected, you used both Memcache and Memcached driver in your script, this may leads to unexpected behaviours in /home/madmax/public_html/neufsvies/wp-content/plugins/crumbls_cache/assets/php/phpfastcache/src/phpFastCache/Core/MemcacheDriverCollisionDetectorTrait.php on line 30

Notice: The native Redis extension is installed, you should use Redis instead of Predis to increase performances in /home/madmax/public_html/neufsvies/wp-content/plugins/crumbls_cache/assets/php/phpfastcache/src/phpFastCache/Drivers/Predis/Driver.php on line 58

Notice: Use of undefined constant alpha_length - assumed 'alpha_length' in /home/madmax/public_html/neufsvies/wp-content/plugins/wp-hashed-ids/wp-hashed-ids.php on line 45

Fatal error: Uncaught Error: Call to a member function decrement() on integer in /home/madmax/public_html/neufsvies/wp-content/plugins/crumbls_cache/plugin.php:332 Stack trace: #0 /home/madmax/public_html/neufsvies/wp-content/object-cache.php(181): crumbls\plugins\fastcache\Plugin->editDecrease('cache_increment...', 1, Array) #1 /home/madmax/public_html/neufsvies/wp-content/plugins/advanced-post-cache-master/advanced-post-cache.php(92): wp_cache_incr('cache_increment...', 1, 'cache_increment...') #2 /home/madmax/public_html/neufsvies/wp-content/plugins/advanced-post-cache-master/advanced-post-cache.php(225): Advanced_Post_Cache->flush_cache() #3 /home/madmax/public_html/wp-includes/class-wp-hook.php(300): clear_advanced_post_cache(8765) #4 /home/madmax/public_html/wp-includes/class-wp-hook.php(323): WP_Hook->apply_filters('', Array) #5 /home/madmax/public_html/wp-includes/plugin.php(453): WP_Hook->do_action(Array) #6 /home/madmax/public_html/wp-includes/post.php(5714): do_action('clean_post_cach...', 8765, Object(WP_Post) in /home/madmax/public_html/neufsvies/wp-content/plugins/crumbls_cache/plugin.php on line 332

mxmkmarquette commented 7 years ago

but the bug happen even if i just use memcache OR memcached.

mxmkmarquette commented 7 years ago

and on my index is blank now and

phpFastCache\Drivers\Memcache\Item Object ( [fetched] => [driver] => object(phpFastCache\Drivers\Memcache\Driver) [key] => eff8c606309c715c01a18793258c8e1a [data] => [expirationDate] => DateTime Object ( [date] => 2017-04-11 12:36:45.000000 [timezone_type] => 3 [timezone] => UTC ) [tags] => Array ( ) [removedTags] => Array ( ) [isHit] => )

chasecmiller commented 7 years ago

Yeah, it is complaining about memcache and memcached being installed at the same time. That can cause conflicts with PHP.

The real error there that is breaking is decrement on integer. Looking at it now.

chasecmiller commented 7 years ago

I just submitted a new push to finalize the two methods that were breaking, which handle increasing and decreasing numbers in the cache. The warnings are not a big deal at the moment.

mxmkmarquette commented 7 years ago

perfect gonna test it right now.

chasecmiller commented 7 years ago

Sorry, if you just pulled, hit it again. I had left a debug line in there that would be breaking your page.

chasecmiller commented 7 years ago

I'm seeing a few errors, but with the quick and dirty error reporting, it's hard to know exactly where they are coming from. Most of them appear to be from a theme or other plugin. Next time I submit a push, I'll make the logger include the filename so we can get more relevant information.

OT. You're getting a few thousand warnings about a constant not being defined, it's named alpha_length

mxmkmarquette commented 7 years ago
[11-Apr-2017 14:00:03 UTC] PHP Fatal error:  Uncaught phpFastCache\Exceptions\phpFastCacheCoreException: The driverRead method returned an unexpected variable type: string in /home/madmax/public_html/neufsvies/wp-content/plugins/crumbls_cache/assets/php/phpfastcache/src/phpFastCache/Core/StandardPsr6StructureTrait.php:61
Stack trace:
#0 /home/madmax/public_html/neufsvies/wp-content/plugins/crumbls_cache/plugin.php(301): phpFastCache\Core\DriverAbstract->getItem('transientdoing_...')
#1 /home/madmax/public_html/neufsvies/wp-content/object-cache.php(157): crumbls\plugins\fastcache\Plugin->read('transientdoing_...')
#2 /home/madmax/public_html/wp-includes/option.php(637): wp_cache_get('transientdoing_...', 'transient')
#3 /home/madmax/public_html/wp-includes/cron.php(266): get_transient('doing_cron')
#4 /home/madmax/public_html/wp-includes/cron.php(367): spawn_cron(1491919203.3819)
#5 /home/madmax/public_html/wp-includes/class-wp-hook.php(298): wp_cron('')
#6 /home/madmax/public_html/wp-includes/class-wp-hook.php(323): WP_Hook->apply_filters(NULL, Array)
# in /home/madmax/public_html/neufsvies/wp-content/plugins/crumbls_cache/assets/php/phpfastcache/src/phpFastCache/Core/StandardPsr6StructureTrait.php on line 61
mxmkmarquette commented 7 years ago

right now that's what i'm getting

chasecmiller commented 7 years ago

And that's on a memcached transient it looks like. Let me switch to memcached and see what I can do there.

mxmkmarquette commented 7 years ago

perfect no problemo my friend take your time... there no hurry and also i don't know if it's a bug but like if i switch from memcached to memcache for anything, the config.php don't update, i need to delete it then it get autogenerated and it add some field.

also what's the difference between ip and host into the cache... like do i need to setup both or just one.

chasecmiller commented 7 years ago

You're going to get to ignore both of those pretty soon. I'm adding multiserver support right now.

mxmkmarquette commented 7 years ago

wow things becoming real up in here!!!

chasecmiller commented 7 years ago

Right now, it's ugly. The GUI is ready for some more clean ups. There is a field called servers for memcache and memcached. Format would be like this:

server.com:port,serverip:port,etc

You can do as many as you want. That provides memcache(d) server settings. If none are provided, it defaults to 127.0.0.1:11211

Pushing now.

mxmkmarquette commented 7 years ago

ok but me my server like memcache, memcached and redis are all on 127.0.0.1:11211, 127.0.0.1:11212 and 127.0.0.1:6379 so what will i enter like bot madmax.quebec:port,ip:port,etc

chasecmiller commented 7 years ago

That's correct. For now. I'll end up making a multiline field, but just haven't gotten there yet.

mxmkmarquette commented 7 years ago

is that normal that my config.php look like this

<?php return array (
  'crumbls_cache_type_page' => 
  array (
    'type' => 'memcache',
    'compress_data' => 'true',
    'path' => '/home/madmax/public_html/neufsvies/wp-content/cache/crumbls/',
    'host' => '127.0.0.1',
    'port' => '11211',
    'servers' => '127.0.0.1:11211',
  ),
  'crumbls_cache_type_object' => 
  array (
    'type' => 'crumbls_cache_type_page',
    'compress_data' => 'true',
    'path' => '/home/madmax/public_html/neufsvies/wp-content/cache/crumbls/',
    'host' => '127.0.0.1',
    'port' => '11211',
  ),
  'crumbls_cache_type_transient' => 
  array (
    'type' => 'memcached',
    'compress_data' => 'true',
    'path' => '/home/madmax/public_html/neufsvies/wp-content/cache/crumbls/',
    'host' => '127.0.0.1',
    'port' => '11211',
    'servers' => '127.0.0.1:11212',
  ),
);
chasecmiller commented 7 years ago

Just to check, you're running memcache and memcached? It's saying memcache for pages and object cache, but transients get memcached.

mxmkmarquette commented 7 years ago

i'm running memcache for page cache, inherit from page for object and memcached on port 11212 for memcached, and i have a lot's of difficulty to access either a new post or the admin section

mxmkmarquette commented 7 years ago

let me test if i use all one or all the other

mxmkmarquette commented 7 years ago

if i set all memcache, it's slow like it's taking around 7 secondes to load a page, but when it's render i can go back and forth and it's fast as hell, but i cannot add post.

when i tried to add a new post it give me error 503 backend error and accessing /wp-admin/ is slow as hell.

chasecmiller commented 7 years ago

Have a log of the 503?

What if you switch to 100% memcached? Just for testing a theory.

I don't know enough about regular memcache, but from what Google results say, it sounds like the server is dropping off. Looking into it a little now.

mxmkmarquette commented 7 years ago

if i set all memcached it's more rapid take about 5 second to load instead of 7 to 10 second a new page like if i open a post in a new tab or if i go on page 2, but i still cannot add a new post cause it's like it's timeout but error 503

Error 503

Backend fetch failed

Request ID 1491929280.10038690 capture

and what is strange is that i can edit post and update them but not add/create a new post

mxmkmarquette commented 7 years ago

and i tried to activate the wp debug and else and all what contain the debug.log

is this thing:

[11-Apr-2017 16:53:48 UTC] PHP Notice:  wp_enqueue_script was called <strong>incorrectly</strong>. Scripts and styles should not be registered or enqueued until the <code>wp_enqueue_scripts</code>, <code>admin_enqueue_scripts</code>, or <code>login_enqueue_scripts</code> hooks. Please see <a href="https://codex.wordpress.org/Debugging_in_WordPress">Debugging in WordPress</a> for more information. (This message was added in version 3.3.0.) in /home/madmax/public_html/wp-includes/functions.php on line 4137
[11-Apr-2017 16:53:52 UTC] PHP Notice:  wp_enqueue_script was called <strong>incorrectly</strong>. Scripts and styles should not be registered or enqueued until the <code>wp_enqueue_scripts</code>, <code>admin_enqueue_scripts</code>, or <code>login_enqueue_scripts</code> hooks. Please see <a href="https://codex.wordpress.org/Debugging_in_WordPress">Debugging in WordPress</a> for more information. (This message was added in version 3.3.0.) in /home/madmax/public_html/wp-includes/functions.php on line 4137
[11-Apr-2017 16:53:59 UTC] PHP Notice:  wp_enqueue_script was called <strong>incorrectly</strong>. Scripts and styles should not be registered or enqueued until the <code>wp_enqueue_scripts</code>, <code>admin_enqueue_scripts</code>, or <code>login_enqueue_scripts</code> hooks. Please see <a href="https://codex.wordpress.org/Debugging_in_WordPress">Debugging in WordPress</a> for more information. (This message was added in version 3.3.0.) in /home/madmax/public_html/wp-includes/functions.php on line 4137
[11-Apr-2017 16:53:59 UTC] PHP Notice:  wp_enqueue_script was called <strong>incorrectly</strong>. Scripts and styles should not be registered or enqueued until the <code>wp_enqueue_scripts</code>, <code>admin_enqueue_scripts</code>, or <code>login_enqueue_scripts</code> hooks. Please see <a href="https://codex.wordpress.org/Debugging_in_WordPress">Debugging in WordPress</a> for more information. (This message was added in version 3.3.0.) in /home/madmax/public_html/wp-includes/functions.php on line 4137
[11-Apr-2017 16:54:08 UTC] PHP Notice:  wp_enqueue_script was called <strong>incorrectly</strong>. Scripts and styles should not be registered or enqueued until the <code>wp_enqueue_scripts</code>, <code>admin_enqueue_scripts</code>, or <code>login_enqueue_scripts</code> hooks. Please see <a href="https://codex.wordpress.org/Debugging_in_WordPress">Debugging in WordPress</a> for more information. (This message was added in version 3.3.0.) in /home/madmax/public_html/wp-includes/functions.php on line 4137
[11-Apr-2017 16:54:29 UTC] PHP Notice:  wp_enqueue_script was called <strong>incorrectly</strong>. Scripts and styles should not be registered or enqueued until the <code>wp_enqueue_scripts</code>, <code>admin_enqueue_scripts</code>, or <code>login_enqueue_scripts</code> hooks. Please see <a href="https://codex.wordpress.org/Debugging_in_WordPress">Debugging in WordPress</a> for more information. (This message was added in version 3.3.0.) in /home/madmax/public_html/wp-includes/functions.php on line 4137
[11-Apr-2017 16:54:41 UTC] PHP Notice:  wp_enqueue_script was called <strong>incorrectly</strong>. Scripts and styles should not be registered or enqueued until the <code>wp_enqueue_scripts</code>, <code>admin_enqueue_scripts</code>, or <code>login_enqueue_scripts</code> hooks. Please see <a href="https://codex.wordpress.org/Debugging_in_WordPress">Debugging in WordPress</a> for more information. (This message was added in version 3.3.0.) in /home/madmax/public_html/wp-includes/functions.php on line 4137
[11-Apr-2017 16:54:46 UTC] PHP Notice:  wp_enqueue_script was called <strong>incorrectly</strong>. Scripts and styles should not be registered or enqueued until the <code>wp_enqueue_scripts</code>, <code>admin_enqueue_scripts</code>, or <code>login_enqueue_scripts</code> hooks. Please see <a href="https://codex.wordpress.org/Debugging_in_WordPress">Debugging in WordPress</a> for more information. (This message was added in version 3.3.0.) in /home/madmax/public_html/wp-includes/functions.php on line 4137
[11-Apr-2017 16:54:54 UTC] PHP Notice:  wp_enqueue_script was called <strong>incorrectly</strong>. Scripts and styles should not be registered or enqueued until the <code>wp_enqueue_scripts</code>, <code>admin_enqueue_scripts</code>, or <code>login_enqueue_scripts</code> hooks. Please see <a href="https://codex.wordpress.org/Debugging_in_WordPress">Debugging in WordPress</a> for more information. (This message was added in version 3.3.0.) in /home/madmax/public_html/wp-includes/functions.php on line 4137
[11-Apr-2017 16:55:20 UTC] PHP Notice:  wp_enqueue_script was called <strong>incorrectly</strong>. Scripts and styles should not be registered or enqueued until the <code>wp_enqueue_scripts</code>, <code>admin_enqueue_scripts</code>, or <code>login_enqueue_scripts</code> hooks. Please see <a href="https://codex.wordpress.org/Debugging_in_WordPress">Debugging in WordPress</a> for more information. (This message was added in version 3.3.0.) in /home/madmax/public_html/wp-includes/functions.php on line 4137
[11-Apr-2017 16:55:32 UTC] PHP Notice:  wp_enqueue_script was called <strong>incorrectly</strong>. Scripts and styles should not be registered or enqueued until the <code>wp_enqueue_scripts</code>, <code>admin_enqueue_scripts</code>, or <code>login_enqueue_scripts</code> hooks. Please see <a href="https://codex.wordpress.org/Debugging_in_WordPress">Debugging in WordPress</a> for more information. (This message was added in version 3.3.0.) in /home/madmax/public_html/wp-includes/functions.php on line 4137

even when it's timeout 503

chasecmiller commented 7 years ago

Yeah, the enqueue isn't a problem with our code and wouldn't cause a 503. The 503 is coming from the cache server either not responding or responding too slowly it looks like.

https://www.quora.com/What-does-Error-503-Backend-fetch-failed-mean-and-why-would-it-appear

mxmkmarquette commented 7 years ago

yeah and everything is working good on my side cause if i switch from like crumbls to like wp-ffpc or bat cache witch is a memcached and memcache caching plugin i got no problemo.

chasecmiller commented 7 years ago

I'm having a hard time duplicating it. I am getting 0.20 responses left and right. Posting with some adjustments.

mxmkmarquette commented 7 years ago

maybe you can log into mine and check or i don't know i can provide root access maybe it will tell you what's wrong with that cause me i don't know where to check i tried to activate the debug log and it's telling me nothing that worth investigate.

mxmkmarquette commented 7 years ago

and the last error i have is.

[11-Apr-2017 19:25:56 UTC] PHP Fatal error:  Uncaught Error: Call to a member function getItem() on null in /home/madmax/public_html/neufsvies/wp-content/plugins/crumbls_cache/plugin.php:238
Stack trace:
#0 /home/madmax/public_html/neufsvies/wp-content/advanced-cache.php(17): crumbls\plugins\fastcache\Plugin->advancedCache()
#1 /home/madmax/public_html/wp-settings.php(84): include('/home/madmax/pu...')
#2 /home/madmax/public_html/wp-config.php(125): require_once('/home/madmax/pu...')
#3 /home/madmax/public_html/wp-load.php(37): require_once('/home/madmax/pu...')
#4 /home/madmax/public_html/wp-blog-header.php(13): require_once('/home/madmax/pu...')
#5 /home/madmax/public_html/index.php(17): require('/home/madmax/pu...')
#6 {main}
  thrown in /home/madmax/public_html/neufsvies/wp-content/plugins/crumbls_cache/plugin.php on line 238
[11-Apr-2017 19:34:02 UTC] PHP Warning:  Memcache collision detected, you used both Memcache and Memcached driver in your script, this may leads to unexpected behaviours in /home/madmax/public_html/neufsvies/wp-content/plugins/crumbls_cache/assets/php/phpfastcache/src/phpFastCache/Core/MemcacheDriverCollisionDetectorTrait.php on line 30
chasecmiller commented 7 years ago

Will check after work. Thanks!

mxmkmarquette commented 7 years ago

thanks to you my friend and have a good one.

mxmkmarquette commented 7 years ago

i think i found the error when i tried to go into new -> post

i have this.

Fatal error: Uncaught Error: Class 'phpFastCache\Drivers\1\Driver' not found in /home/madmax/public_html/neufsvies/wp-content/plugins/crumbls_cache/assets/php/phpfastcache/src/phpFastCache/CacheManager.php:114 Stack trace: #0 /home/madmax/public_html/neufsvies/wp-content/plugins/crumbls_cache/admin.php(223): phpFastCache\CacheManager::getInstance('Apc', Array) #1 /home/madmax/public_html/neufsvies/wp-content/plugins/crumbls_cache/admin.php(82): crumbls\plugins\fastcache\Admin->getSupported() #2 /home/madmax/public_html/wp-includes/class-wp-hook.php(298): crumbls\plugins\fastcache\Admin->actionAdminInit('') #3 /home/madmax/public_html/wp-includes/class-wp-hook.php(323): WP_Hook->apply_filters(NULL, Array) #4 /home/madmax/public_html/wp-includes/plugin.php(453): WP_Hook->do_action(Array) #5 /home/madmax/public_html/wp-admin/admin.php(154): do_action('admin_init') #6 /home/madmax/public_html/wp-admin/post-new.php(10): require_once('/home/madmax/pu...') #7 {main} thrown in /home/madmax/public_html/neufsvies/wp-content/plugins/crumbls_cache/assets/php/phpfastcache/src/phpFastCache/CacheManager.php on line 114

chasecmiller commented 7 years ago

Awesome. That's what we are looking for. Can you paste your config.php again? It makes it sound like it's loading a blank config file, which will return a 1 in php.

mxmkmarquette commented 7 years ago
<?php return array (
  'crumbls_cache_type_page' => 
  array (
    'type' => 'memcached',
    'compress_data' => 'true',
    'path' => '/home/madmax/public_html/neufsvies/wp-content/cache/crumbls/',
    'host' => '127.0.0.1',
    'port' => '11211',
    'servers' => '127.0.0.1:11211',
  ),
  'crumbls_cache_type_object' => 
  array (
    'type' => 'memcached',
    'compress_data' => 'true',
    'path' => '/home/madmax/public_html/neufsvies/wp-content/cache/crumbls/',
    'host' => '127.0.0.1',
    'port' => '11211',
    'servers' => '127.0.0.1:11211',
  ),
  'crumbls_cache_type_transient' => 
  array (
    'type' => 'memcached',
    'compress_data' => 'true',
    'path' => '/home/madmax/public_html/neufsvies/wp-content/cache/crumbls/',
    'host' => '127.0.0.1',
    'port' => '11211',
    'servers' => '127.0.0.1:11212',
  ),
);
chasecmiller commented 7 years ago

Had to look at the source and I was off base there. At that point, it's asking the cachemanager from php to validate any cache types. Doing a little digging right now.

chasecmiller commented 7 years ago

If you still wanted to set me up with ssh or even ftp, we can dig through this pretty quick. I changed the logging functionality a little to give me more info about what this variable returns.

mxmkmarquette commented 7 years ago

ok regive your email i'll send you the details there without any problem my friend

chasecmiller commented 7 years ago

chase@crumbls.com

Thanks!

mxmkmarquette commented 7 years ago

send my friends :)

mxmkmarquette commented 7 years ago

by the way the cache seems to cache the group "transient" but does it cache also "site-transient" could be a great addition if not.

like combining both of those groupe into the transient option

chasecmiller commented 7 years ago

Was breaking due to a warning that was triggered due to memcache and memcached running in tandem. Changed warning to admin warning. Pushed.

mxmkmarquette commented 7 years ago

good job bro you the best