[Resolved] 400 error on import from library

Home Forums Support [Resolved] 400 error on import from library

Home Forums Support 400 error on import from library

  • This topic has 69 replies, 18 voices, and was last updated 3 years ago by Elvin.
Viewing 15 posts - 16 through 30 (of 70 total)
  • Author
    Posts
  • #865267
    Terence

    @Tom, I just installed the same child theme on a new domain on the same server [ https://unlevel.co.uk/ ]. This time though I disconnected WP Redis before installing the site content. However, the problem is back. The same 400 error message and sidebar which isn’t working as it should do. Any ideas what I could try to fix it? It only happens with GeneratePress and its not showing any reasons why its happening in the console.

    #865491
    Tom
    Lead Developer
    Lead Developer

    What happens if you rename the object-cache.php file that was causing problems previously?

    #865526
    Terence

    This time nothing changes.

    The theme/sidebar stays broken even with browser and system cache purged.

    Very strange.

    I am going to reset and reinstall.

    #865552
    Terence

    I reset the site which deactivated all plugins/cache etc.

    … reinstalled the child-theme without a problem and no 404 message.

    … reactivated the WP Redis and most of the sidebar and header/menu content disappeared.

    … renamed the /wp-content/object-cache.php file /wp-content/@object-cache.php and the sidebar came back.

    The problem exists at https://unlevel.co.uk/ on a fresh install with just WP-Redis, GP Premium and a GeneratePress child-theme enabled.

    It seems the only way I can avoid this problem is to reinstall the site entirely, only without the WP Redis caching.

    #866048
    Terence

    I deleted the site and the database then reinstalled WP afresh, only without WPRedis this time.

    Importing the Marketer child theme was no problem and the sidebar and header/navigation worked as it’s supposed to.

    However, I need to have this site cached and, as the server is already running a global redis cache server, and as there is no easy way to manually configure WPRedis post installation, I have again reinstalled the site with caching.

    Even though I deactivated the caching before importing the Marketer child theme the importer throws a 400 error and the sidebar doesn’t work as its supposed to.

    STATUS: GeneratePress runs fine on its own but Marketer child theme is broken when WPRedis is activated.

    #866277
    Tom
    Lead Developer
    Lead Developer

    Is this the plugin you’re using?: https://wordpress.org/plugins/wp-redis/

    So you imported the site without it, all worked well.

    Then you activated the plugin, and the site broke?

    #866501
    Terence

    Yes, that’s the plugin. The plugin is installed and activated by EasyEngine when the script, or rather Docker, installs and configures the NginX server.

    If I have EasyEngine install the NginX server without setting the caching switch, Docker doesn’t install the global Redis cache, nor the WPRedis and NginX Helper [https://wordpress.org/plugins/nginx-helper/] plugins. In which case, all is well and the GeneratePress imports the child theme without error and the theme functions as you intended it.

    However if the server is installed using the --cache switch then I get a 400 error on import and the sidebar of child theme won’t function as you designed it.

    I can give you access to the VPS or the site, if you want to see from the inside.

    #866508
    Terence

    This is all done for me by EasyEngine/Docker…

    == Installation ==
    
    This assumes you have a PHP environment with the [required PhpRedis extension](https://github.com/phpredis/phpredis) and a working Redis server (e.g. Pantheon). WP Redis also works with Predis via [humanmade/wp-redis-predis-client](https://github.com/humanmade/wp-redis-predis-client).
    
    1. Install <code>object-cache.php</code> to <code>wp-content/object-cache.php</code> with a symlink or by copying the file.
    2. If you're not running on Pantheon, edit wp-config.php to add your cache credentials, e.g.:
    
            $redis_server = array(
                'host'     => '127.0.0.1',
                'port'     => 6379,
                'auth'     => '12345',
                'database' => 0, // Optionally use a specific numeric Redis database. Default is 0.
            );
    
    3. Engage thrusters: you are now backing WP's Object Cache with Redis.
    4. (Optional) To use the <code>wp redis</code> WP-CLI commands, activate the WP Redis plugin. No activation is necessary if you're solely using the object cache drop-in.
    5. (Optional) To use the same Redis server with multiple, discreet WordPress installs, you can use the <code>WP_CACHE_KEY_SALT</code> constant to define a unique salt for each install.
    6. (Optional) To use true cache groups, with the ability to delete all keys for a given group, register groups with <code>wp_cache_add_redis_hash_groups()</code>, or define the <code>WP_REDIS_USE_CACHE_GROUPS</code> constant to true to enable with all groups. However, when enabled, the expiration value is not respected because expiration on group keys isn't a feature supported by Redis.
    7. (Optional) On an existing site previously using WordPress' transient cache, use WP-CLI to delete all (<code>%_transient_%</code>) transients from the options table: <code>wp transient delete-all</code>. WP Redis assumes responsibility for the transient cache.
    
    == WP-CLI Commands ==
    #866616
    Tom
    Lead Developer
    Lead Developer

    I guess I still don’t understand why the import can’t be done with caching off and then turn the caching on once the import is done. Importing is a one-time thing – so once it’s done you should never have to do it again, and the caching shouldn’t get in the way.

    Are there any more details about the 400 error in your error_log file?

    #866661
    Terence

    Its not possible to switch the caching off because its server-level, not site-level caching.

    And even if were possible to switch off, the theme will not run correctly when it is switched back on.

    EasyEngine installs Docker on the VPS, which in turn sets up the NginX and global Redis server which has a global cache shared by each of the sites.

    The site’s WPRedis plugin only provides access to the global Redis server cache.

    Because of the close integration, each site’s WPRedis plugin has to be installed and configured by Docker when it first creates each site.

    Deactivating the WPRedis plugin makes no difference. I still get the 400 error on installing the child-theme and it won’t run correctly.

    It doesn’t do it with any other theme I have used. It also doesn’t do it, for example, with plain vanilla GeneratePress together with Elementor.

    It only exhibits this problem when I try to install all the clever stuff you have built into the Marketer child theme.

    And as for the logs, the only thing I see that I don’t understand is this…

    #866700
    Terence

    I reset the WordPress site again but set GeneratePress, GP Pro and the WP Redis and NginX Helper plugins to automatically reactivate post reset.

    I then cleared the cache, deactivated both the WP Redis and NginX Helper plugins and reinstalled the Marketer child theme.

    This time, no 400 error and the site ran perfectly from the get-go, and continued to work even once I reactivated the WP Redis and NginX Helper plugins.

    I simply cannot explain it.

    #867271
    Tom
    Lead Developer
    Lead Developer

    Definitely strange, but I’m glad you found a workaround 🙂

    #1129167
    Eric

    This is still broken and that workaround doesn’t seem practical at all.

    Tom, can you please try to reproduce the issue with the following and hopefully you may have a solution or suggestion to get this working properly.

    1) Install WordPress using EasyEngine w/ caching (I’m using a Digital Ocean droplet)
    ee site create example.com –type=wp –admin-user=USERNAME –admin-pass=PASSWORD –ssl=le –cache –le-mail=EMAIL

    2) Login to the backend, install and activate the Generate Press theme. Install the Generate Press premium plugin.

    3) Install any site-library theme with the demo content. You’ll notice at this point the demo content install times out with a 404

    This results in a site with partially loaded demo content, purging the redis cache doesn’t fix this either.

    #1129282
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    Can you share more details about the error? You should find them in the error_log file.

    Is it possible to completely disable any caching until the site is imported?

    #1133100
    Eric

    It doesn’t seem possible to disable cache. Here’s the error log output!

    #0 /var/www/htdocs/wp-content/plugins/wp-redis/object-cache.php(1109): Redis->connect(‘127.0.0.1’, 6379, 1, ”, 100)
    #1 /var/www/htdocs/wp-content/plugins/wp-redis/object-cache.php(1008): WP_Object_Cache->prepare_client_connection(Array)
    #2 /var/www/htdocs/wp-content/plugins/wp-redis/object-cache.php(1330): WP_Object_Cache->_connect_redis()
    #3 /var/www/htdocs/wp-content/plugins/wp-redis/object-cache.php(158): WP_Object_Cache->__construct()
    #4 /var/www/htdocs/wp-includes/load.php(579): wp_cache_init()
    #5 /var/www/htdocs/wp-settings.php(123): wp_start_object_cache()
    #6 /var/www/htdocs/wp-admin/setup-config.php(33): require(‘/var/www/htdocs…’)
    #7 {main}
    thrown in /var/www/htdocs/wp-content/plugins/wp-redis/object-cache.php on line 1109
    PHP message: PHP Fatal error: Uncaught Error: Call to undefined function wp_kses_normalize_entities() in /var/www/htdocs/wp-includes/formatting.php:4316
    Stack trace:
    #0 /var/www/htdocs/wp-includes/class-wp-fatal-error-handler.php(190): esc_url(‘https://wordpre…&#8217;)
    #1 /var/www/htdocs/wp-includes/class-wp-fatal-error-handler.php(147): WP_Fatal_Error_Handler->display_default_error_template(Array, false)
    #2 /var/www/htdocs/wp-includes/class-wp-fatal-error-handler.php(52): WP_Fatal_Error_Handler->display_error_template(Array, false)
    #3 [internal function]: WP_Fatal_Error_Handler->handle()
    #4 {main}
    thrown in /var/www/htdocs/wp-includes/formatting.php on line 4316″ while reading response header from upstream, client: 128.90.169.19, server: example.com, request: “GET /wp-admin/setup-config.php?step=1&language=
    en_GB HTTP/1.1”, upstream: “fastcgi://173.31.0.3:9000”, host: “example.com”
    2020/01/14 19:52:44 [error] 6#6: *13965 access forbidden by rule, client: 52.61.80.183, server: example.com, request: “GET /.env HTTP/1.1”, host: “example.com”

Viewing 15 posts - 16 through 30 (of 70 total)
  • You must be logged in to reply to this topic.