Results 1 to 10 of 10

Thread: Blank Screen and ERR_CONNECTION_CLOSED on WordPress Astra Theme Customizer

  1. #1
    dactiloscopia is offline Junior Member
    Join Date
    Oct 2013
    Posts
    8

    Unhappy Blank Screen and ERR_CONNECTION_CLOSED on WordPress Astra Theme Customizer

    Hello,

    I am experiencing a blank screen and ERR_CONNECTION_CLOSED errors (status 200 OK) specifically when trying to use the WordPress Astra Theme Customizer. These errors appear in the browser console for admin-ajax.php and various Astra JS files.

    I have already attempted the following without success:

    • Increased PHP Memory Limit to 512M and max_execution_time to 300.
    • Added SubstituteMaxLineLength 20M to .htaccess as suggested by Astra documentation (https://wpastra.com/docs/blank-screen/).
    • Set define( 'CONCATENATE_SCRIPTS', false ); in wp-config.php.
    • Disabled all other plugins.
    • Attempted to force-disable Astra’s modern React controls via filters.


    Could you please check if there is a ModSecurity rule, Proxy buffer limit or any other thing on my account that is terminating these connections?

    Thank you!

  2. #2
    alemoppo is offline AlterVista Staff
    Join Date
    Feb 2010
    Location
    IT
    Posts
    780

    Default

    Hello,

    I'm trying to reproduce the issue. Could you please confirm that the problem occurs on this page?


    Did the error appear on this page, simply by refreshing it?

    Many thanks,

    Bye!

  3. #3
    dactiloscopia is offline Junior Member
    Join Date
    Oct 2013
    Posts
    8

    Default

    Not exactly. The problem is on the Astra theme's Customizer page. See below.



    Note blank middle part (where live blog content is supposed to be), and errors reported by Console.

    The error seems to be known to the Astra theme developers and described in their help article "The Blank Screen in the Customizer Area", where they say The most common reasons are:
    * Low PHP memory limit
    * Low resources allocation on your account by your hosting provider
    * Poor performance on your hosting account
    * Resource limit exhaustion

  4. #4
    alemoppo is offline AlterVista Staff
    Join Date
    Feb 2010
    Location
    IT
    Posts
    780

    Default

    I'm sorry, but I'm unable to reproduce the issue on my side.



    Are you using WordPress AlterVista or the original WordPress? (it looks like the original one to me).
    How did you install the theme: by uploading a .zip file, or via the administration panel by searching for "Astra" in the "Themes" section?

    Have you tried temporarily deactivating all the plugins?


    Bye!

  5. #5
    dactiloscopia is offline Junior Member
    Join Date
    Oct 2013
    Posts
    8

    Default

    Try a small self-contained test case to reproduce the "net::ERR_CONNECTION_CLOSED 200 (OK)" error.



    The test suit consists of 4 files (conveniently created for me by an LLM):


    1. index.php
    Code:
    <!DOCTYPE html>
    <html>
    <head>
        <meta charset="UTF-8">
        <title>Phase 3 – Minimal Astra Failure Reproduction</title>
    
        <!-- These two CSS bundles alone should trigger ERR_CONNECTION_RESET -->
        <link rel="stylesheet" href="css-bundle.php?size=300&cb=1">
        <link rel="stylesheet" href="css-bundle.php?size=300&cb=2">
    </head>
    <body>
        <h1>Phase 3 – Minimal Test</h1>
        <p>If Altervista resets connections, it will happen immediately on page load.</p>
    
        <!-- This JS bundle is the main trigger (Astra-like minified JS) -->
        <script src="big-bundle.php?size=3400&cb=1"></script>
    </body>
    </html>
    2. big-bundle.php. This is the Astra‑like minified JS generator.
    Code:
    <?php
    @set_time_limit(0);
    
    $size_kb = intval($_GET['size'] ?? 3400);
    $bytes_target = $size_kb * 1024;
    
    @ini_set('output_buffering', 'off');
    @ini_set('zlib.output_compression', 0);
    while (ob_get_level()) { ob_end_clean(); }
    
    header("Content-Type: application/javascript");
    header("Cache-Control: no-cache, no-store, must-revalidate");
    
    $chunk = '';
    for ($i = 0; $i < 150; $i++) {
        $chunk .= "!(function(a,b){try{var c='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=',d='"
            . bin2hex(random_bytes(16))
            . "',e={k1:'v',k2:{nested:true,id:" . rand(1,9999) . "}};console.log(a,b,c,d,e);}catch(f){}})('"
            . bin2hex(random_bytes(12))
            . "'," . rand(1,999999) . ");";
    }
    $chunk_len = strlen($chunk);
    
    $bytes_sent = 0;
    while ($bytes_sent < $bytes_target) {
        $remaining = $bytes_target - $bytes_sent;
        $to_send = ($remaining >= $chunk_len) ? $chunk_len : $remaining;
        echo substr($chunk, 0, $to_send);
        $bytes_sent += $to_send;
        flush();
        if (connection_aborted()) exit;
    }
    exit;
    3. css-bundle.php
    Code:
    <?php
    @set_time_limit(15);
    
    $size_kb = intval($_GET['size'] ?? 300);
    $bytes_target = $size_kb * 1024;
    
    header("Content-Type: text/css");
    header("Cache-Control: no-cache, no-store, must-revalidate");
    
    $chunk = '';
    for ($i = 0; $i < 400; $i++) {
        $class = 'c' . bin2hex(random_bytes(3));
        $chunk .= ".{$class}{color:#" . bin2hex(random_bytes(3)) . ";background:#" . bin2hex(random_bytes(3)) . ";padding:" . rand(0,50) . "px;margin:" . rand(0,50) . "px;border-radius:" . rand(0,25) . "px;}\n";
    }
    $chunk_len = strlen($chunk);
    
    $bytes_sent = 0;
    while ($bytes_sent < $bytes_target) {
        $remaining = $bytes_target - $bytes_sent;
        $to_send = ($remaining >= $chunk_len) ? $chunk_len : $remaining;
        echo substr($chunk, 0, $to_send);
        $bytes_sent += $to_send;
        flush();
        if (connection_aborted()) exit;
    }
    exit;
    4. .htaccess
    Code:
    # Increase limits
    <IfModule mod_substitute.c>
        SubstituteMaxLineLength 10M
    </IfModule>
    
    # Disable gzip to ensure we see the raw TCP stream failure. Disable gzip so we see raw truncation
    <IfModule mod_env.c>
        SetEnv no-gzip 1
    </IfModule>
    
    
    # Disable buffering if possible
    <IfModule mod_php.c>
        php_flag output_buffering Off
    </IfModule>
    Place in one folder and point browser to index.php. Watch ERR_CONNECTION_CLOSED errors in Chrome Inspector > Console.

  6. #6
    alemoppo is offline AlterVista Staff
    Join Date
    Feb 2010
    Location
    IT
    Posts
    780

    Default

    Thanks for sharing the test.

    I tried your code, but I’m not able to reproduce the issue you’re describing with the Astra theme (you can try it here if you have the problem, in case please also try from other devices or connections).





    This test seems to assume that very large JS/CSS files could be the cause. However, on my side the issue appears to be caused by the generated output itself: the script truncates the JavaScript at an arbitrary byte length, producing syntactically invalid code. I don’t see the same behavior you report with Astra.

    The generated JS is not guaranteed to be valid: the script is cut exactly at the byte size specified by the size parameter, without ensuring that strings or statements are properly closed. In fact, Chrome DevTools reports:
    Uncaught SyntaxError: Unexpected end of input
    So this test does not reflect how a real Astra JS bundle is delivered.

    If the problem happens specifically when accessing Appearance > Customize with the Astra theme, I’d like to reproduce that exact scenario.
    Please provide as many details as possible (steps, browser, fresh Astra install or not, plugins, settings, etc.), otherwise I can’t reliably investigate or report this to the AlterVista technical team.

    I can also ask the technical team to check your site directly, so please let me know if you are still experiencing this issue or if it was resolved by changing the theme or applying other fixes.

    Bye!
    Last edited by alemoppo; 01-03-2026 at 01:09 PM.

  7. #7
    dactiloscopia is offline Junior Member
    Join Date
    Oct 2013
    Posts
    8

    Default

    Hello.

    I confirm that when accessing your test case https://alemoppo.altervista.org/LABS/Astra/index.php I see exactly the same "Uncaught SyntaxError: Unexpected end of input (at big-bundle.php?size=3400&cb=1:1:3481601)" error in Chrome > Inspect > Console as seen in your screenshot. I wonder if we use exactly the same types of hosting accounts for testing? As an insider, you may be using an account with more resources; as a free customer, my account may be much more limited on resources.

    I have for you a smaller, much more focused test case that reproduces the problem:

    (a) https://dactiloscopia.altervista.org...size=2400&cb=1 throws ERR_CONNECTION_RESET:


    (b) https://dactiloscopia.altervista.org...size=2000&cb=1 gives no errors:


    For the reference here's the updated complete test case. (Now the scripts do NOT cut exactly at the byte size specified by the size parameter, but ensure the JS or CSS strings or statements are properly closed.)

    1. .htaccess
    Code:
    # .htaccess
    
    
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress
    
    # # av:php5-engine
    AddHandler av-php84 .php
    
    
    # av:PHP-upload
    php_value upload_max_filesize 20M
    php_value post_max_size 20M
    php_value max_input_time 300
    # PHP-upload
    
    
    # Manually added by me 2025-12-30 to resolve the issue with blank Astra customizer options on the website 
    
    # Prevent the server from timing out during heavy Ajax calls (additional change recommended by Gemini):
    <IfModule mod_php.c>
        php_value max_input_vars 5000
        php_value memory_limit 512M
    </IfModule>
    
    # Try to force the connection to stay open
    <IfModule mod_headers.c>
        Header set Connection keep-alive
    </IfModule>
    
    # ENF OF manually added by me 2025-12-30
    
    # Per article  https://wpastra.com/docs/blank-screen/ - increase the limit for internal string processing:
    <IfModule mod_substitute.c>
        SubstituteMaxLineLength 20M
    </IfModule>
    
    # Disable gzip to ensure we see the raw TCP stream failure. Disable gzip so we see raw truncation
    <IfModule mod_env.c>
        SetEnv no-gzip 1
    </IfModule>
    
    
    # Disable buffering if possible
    <IfModule mod_php.c>
        php_flag output_buffering Off
    </IfModule>
    2. index.php
    Code:
    <!DOCTYPE html>
    <html>
    <head>
        <meta charset="UTF-8">
        <title>Phase 3 – Minimal Astra Failure Reproduction</title>
    
        <!-- These two CSS bundles alone should trigger ERR_CONNECTION_RESET -->
        <link rel="stylesheet" href="css-bundle.php?size=300&cb=1">
        <link rel="stylesheet" href="css-bundle.php?size=300&cb=2">
    </head>
    <body>
        <h1>Phase 3 – Minimal Test</h1>
        <p>If Altervista resets connections, it will happen immediately on page load.</p>
    
        <!-- This JS bundle is the main trigger (Astra-like minified JS) -->
        <script src="big-bundle.php?size=3400&cb=1"></script>
    </body>
    </html>
    3. big-bundle.php
    Code:
    <?php
    @set_time_limit(0);
    
    $size_kb = intval($_GET['size'] ?? 3400);
    $bytes_target = $size_kb * 1024;
    
    @ini_set('output_buffering', 'off');
    @ini_set('zlib.output_compression', 0);
    while (ob_get_level()) ob_end_clean();
    
    header("Content-Type: application/javascript");
    header("Cache-Control: no-cache, no-store, must-revalidate");
    
    // Deterministic, syntactically valid JS statement
    $statement_template = "!(function(i){console.log('IDX_'+i);})(%d);";
    $statement_len = strlen(sprintf($statement_template, 0));
    
    $bytes_sent = 0;
    $i = 0;
    
    while ($bytes_sent < $bytes_target) {
        $line = sprintf($statement_template, $i++);
        echo $line;
        $bytes_sent += strlen($line);
    
        flush();
        if (connection_aborted()) exit;
    }
    
    exit;
    4. css-bundle.php
    Code:
    <?php
    @set_time_limit(0);
    
    $size_kb = intval($_GET['size'] ?? 300);
    $bytes_target = $size_kb * 1024;
    
    @ini_set('output_buffering', 'off');
    @ini_set('zlib.output_compression', 0);
    while (ob_get_level()) ob_end_clean();
    
    header("Content-Type: text/css");
    header("Cache-Control: no-cache, no-store, must-revalidate");
    
    // Deterministic CSS rule
    $rule_template = ".c%05d{color:#%06X;background:#%06X;padding:%dpx;margin:%dpx;}\n";
    
    $bytes_sent = 0;
    $i = 0;
    
    while ($bytes_sent < $bytes_target) {
        // Deterministic pseudo-values
        $color1 = $i % 0xFFFFFF;
        $color2 = ($i * 7) % 0xFFFFFF;
        $padding = $i % 50;
        $margin  = ($i * 3) % 50;
    
        $line = sprintf($rule_template, $i, $color1, $color2, $padding, $margin);
        echo $line;
        $bytes_sent += strlen($line);
        $i++;
    
        flush();
        if (connection_aborted()) exit;
    }
    
    exit;
    Of course, the test case https://dactiloscopia.altervista.org...size=2400&cb=1 doesn't use all four files, only uses .htaccess and big-bundle.php.

    I am trying to give you a minimal case showing the error, because it is more difficult to reproduce the whole WP installation (hundreds of files and dependencies on the database) than a test case with just two files (.htaccess and big-bundle.php).

  8. #8
    alemoppo is offline AlterVista Staff
    Join Date
    Feb 2010
    Location
    IT
    Posts
    780

    Default

    It seems I cannot reproduce the error using your link. I can reproduce it with 5000 size.






    Anyway I'm going to check your case with the technical team.
    I'll post updates there.

    Bye!

  9. #9
    alemoppo is offline AlterVista Staff
    Join Date
    Feb 2010
    Location
    IT
    Posts
    780

    Default

    Could you please try with Firefox? I can't reproduce the error with Firefox, but only with Chrome. That suggests to me that the problem may not be server-related, as we should see the same behavior across all clients.

    Bye!

  10. #10
    dactiloscopia is offline Junior Member
    Join Date
    Oct 2013
    Posts
    8

    Default

    Interesting. I can't reproduce the error with Firefox, even with size=16000 (https://dactiloscopia.altervista.org...ize=16000&cb=1).
    Astra customizer works with Firefox.

    Both Chrome and Edge give error with size=2400 (https://dactiloscopia.altervista.org...size=2400&cb=1).
    Astra customizer does not work with Chrome or Edge.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

SEO by vBSEO