• Resolved demon11c

    (@demon11c)


    Site: https://www.yudemenrecords.com

    I just upgraded to 2.3.1 and it seemed to be ok at first. However after the upgrade, there was a button I had to click which I dont remember exactly what it was but it asked me to backup my DB before pressing it. I DID backup (so I should have a working backup), but immediately after clicking that button, my site went completely dead with the 500 Internal Server Error message.

    I have tried to rename/remove the woocommerce folder from the plugin directory, but this does not make any difference.

    Want to know if there is an easy fix before restoring from backup and if not, what is the best procedure to restore from backup. It must be from the command line since I cannot even get to my admin page.

    Please help!

    https://www.ads-software.com/plugins/woocommerce/

Viewing 15 replies - 1 through 15 (of 22 total)
  • Plugin Contributor Mike Jolley (a11n)

    (@mikejolley)

    Hey,

    Before doing anything, see what is causing the 500. You should either check your server error logs, or enable WP_DEBUG https://codex.www.ads-software.com/WP_DEBUG

    Once you have a useful error, if its not obvious whats causing it, post it here for us.

    Thanks

    Thread Starter demon11c

    (@demon11c)

    Thanks. Found it:

    .htaccess: </IfModule> without matching <IfModule> section

    But that is strange, I dont know why that file would change. I only upgraded WooCommerce…

    Plugin Contributor Mike Jolley (a11n)

    (@mikejolley)

    WC does trigger a permalinks refresh – maybe that triggered the htaccess file to be updated? We never write to htaccess directly.

    Thread Starter demon11c

    (@demon11c)

    Something definitely happened there. I completely removed the .htaccess file, then ran the woocommerce update and it’s back with the following contents:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress

    Also, I believe it added the above to my existing .htaccess file initially which caused the problem.

    I dont have time to look into this further at the moment. Will check back later.

    Plugin Contributor Mike Jolley (a11n)

    (@mikejolley)

    Thats the default WordPress htaccess – it should be there. Flushing permalinks will set that if writable.

    Thread Starter demon11c

    (@demon11c)

    Ok but surely this is a problem. I cant be the only one updating the .htaccess file. Also it needs to be writable because another plugin is writing to it.

    Plugin Contributor Mike Jolley (a11n)

    (@mikejolley)

    WooCommerce doesn’t touch htaccess directly. Never. So if you do have a problem, the cause is elsewhere. As I said, it just triggered a refresh.

    Thread Starter demon11c

    (@demon11c)

    Hmmm… ok but as soon as I hit that update/refresh button aftet upgrading to 2.3.1, boom. 500 error.

    Plugin Contributor Mike Jolley (a11n)

    (@mikejolley)

    Are you certain that the 500 is from htaccess? Server error logs will have more details..

    Thread Starter demon11c

    (@demon11c)

    99%. I saw the error in the log file so I removed .htaccess and the site immediately came back.

    It does make sense that it was .htaccess since this issue caused the site to be completely inaccessible. I can look into the logs in a bit more detail later though.

    Thread Starter demon11c

    (@demon11c)

    I just had a thought…

    If I remember correctly, that refresh button after the 2.3.1 upgrade is present on all pages until you click it.

    If another plugin was updated at the same time (and caused the .htaccess rewrite) I may not have seen the effects (ie: 500 error) until the next mouse click. If that next mouse click was the Woocommerce refresh button then it would have looked like it was a Woocommerce upgrade issue, but in fact may not have been at all.

    I cannot verify this until later (no access at the moment).

    Will let you know.

    I’m came here looking for answers to the same issue. My client gets the error when someone tries to create an account on checkout (I’ve disabled that for now). A quickie solution was to rename the .htacess file, which allows me to see the site again. I changed the permalinks back to default, saved, then back to what it should be, save. All looks good, new .htacess file gets created. I test it, it goes out to PayPal like it’s supposed to. Client’s customer goes in, does the “create account” thing, blows up. I pulled the old .htaccess file (the bad one) and the new one into Kaleidescope to compare and it is exactly what demonc11 is showing, it’s being rewritten every time.

    This is only happening since the update. However, I uploaded the WooCommerce version right before the latest one and it crashes, too.

    Here’s the difference, fwiw:

    “Clean” code:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress

    “Bad” code that gives error:

    ## BEGIN WordPress<<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress

    Also, it may be worth noting the code in the .htaccess file the 1st time it crashed (the above bad code is after the last time):

    RewriteEngine On
    
    # BEGIN WordPrRewr<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
    Thread Starter demon11c

    (@demon11c)

    As yet I have been unable to confirm whether my issue was related to the Woocommerce upgrade. If Mike is saying that Woocommerce does not touch .htaccess, I think my theory above may be more likely…

    Hello, I have the same problem.

    Has anyone been able to find the solution to the problem?

Viewing 15 replies - 1 through 15 (of 22 total)
  • The topic ‘500 Internal Server Error after upgrade to 2.3.1’ is closed to new replies.