Support » Plugin: Amazon Associates Link Builder » The plugin crashed my site

  • Resolved DavidOfMA

    (@davidofma)


    About half an hour ago, Jetpack notified me that it was unable to log into the test site I’m building into which I’ve installed Amazon Associates Link Builder. Trying to view the site or log in returned a 500 error. I checked the error log, and this is what I found:

    [05-Dec-2017 02:44:09 UTC] PHP Fatal error:  Cannot use object of type WP_Error as array in /home/[myrootfolder]/public_html/[websitesubfolder]/wp-content/plugins/amazon-associates-link-builder/ip2country/aalb_maxmind_db_manager.php on line 94
    [05-Dec-2017 02:45:15 UTC] Maxmind_db_manager:get_db:::Forbidden

    I then manually disabled the plugin and was able to log in normally.

    I don’t know enough about PHP to understand what happened here. I had done nothing to the site since this morning. I’d like to continue using the plugin and would appreciate your help in debugging this problem.

    This is the function line 94 is part of:

        private function check_and_update_db() {
            try {
                $response = $this->get_db();
                if ( $response ) {
                    if ( $this->should_update_db( $response["response"] ) ) {
                        $this->update_db( $response );
                    }
                    update_option( AALB_GEOLITE_DB_EXPIRATION_TIME, strtotime( wp_remote_retrieve_header( $response["response"] , 'expires' ) ) );
                }
            }
            catch ( Exception $e ) {
                error_log( "Error in maxmind_db_manager:should_update_db:::" . $e->getMessage() );
            }
        }
    

    Thanks,
    David

Viewing 15 replies - 1 through 15 (of 20 total)
  • Update

    When I checked my plugins, I saW that there was an update available to 1.5.2 from 1.5.1. I manually re-enabled the plugin and updated, and now things seem to work normally.

    Has the above error been corrected, or is there some kind of memory leak or other cumulative error in the plugin that will cause another crash later on?

    Thank you,
    David

    Same issue here with 1.5.2.
    Reverted back to 1.5.1 and 1.5.0: unfortunately I get the same error.

    ATM the plugin is disabled in order to get my website working.

    Please fix.

    I’m seeing the same problem in 1.5.2 in log, although it didn’t crashed anything, all amazon links are working just fine.

    Here is the error (which is recurring on every request):

    [error] 5579#5579: *39896 FastCGI sent in stderr: "PHP message: Error in maxmind_db_manager:get_db:::WP_ERROR: Forbidden" while reading response header from upstream

    Plugin Author Amazon Associates Link Builder

    (@amazonlinkbuilder)

    Hi @nicolaottomano & @bojan121,

    May you please tell us the PHP version on which your WordPress setup is running. You can use plugins like Display PHP version that displays the PHP version on the dashboard.

    Hi @amazonlinkbuilder
    mine is 5.6.25

    Nicola

    I just checked, and although my site is still running with 1.5.2, I’m getting hundreds of error messages like these:

    [05-Dec-2017 03:14:09 UTC] PHP Fatal error:  Cannot use object of type WP_Error as array in /home/davidboo/public_html/transformationspress-test/wp-content/plugins/amazon-associates-link-builder/ip2country/aalb_maxmind_db_manager.php on line 94
    [05-Dec-2017 03:28:13 UTC] Error in maxmind_db_manager:get_db:::WP_ERROR: Forbidden
    [05-Dec-2017 03:28:22 UTC] Error in maxmind_db_manager:get_db:::WP_ERROR: Forbidden
    [05-Dec-2017 03:28:26 UTC] Error in maxmind_db_manager:get_db:::WP_ERROR: Forbidden

    I’m disabling the plugin until this problem is fixed, as it seems likely it will crash my site again at some point. My PHP version is 5.6.

    David

    Correction: PHP is 5.6.32

    The problem happens when you upgrade version 1.5.0 to 1.5.2.

    The problem from this method:

    
    private function get_db() {
            $response = null;
            try {
                $response = $this->customized_download_url( AALB_GEOLITE_COUNTRY_DB_DOWNLOAD_URL );
                if ( is_wp_error( $response ) ) {
                    error_log( "Maxmind_db_manager:get_db:::" . $response->get_error_message() );
                }
            }
            catch ( Exception $e ) {
                error_log( "Error in maxmind_db_manager:get_db:::" . $e->getMessage() );
            }
    
            return $response;
        }
    

    Above method return WP_Error object to method private function check_and_update_db()

    Temporary solution before you update version 1.5.0 to 1.5.2 Please deactivate the plugin and then make the update it.

    Note: In the version 1.5.2 has been fixed. If you got that error go to Cpanel or FTP and remove the plugin Amazon Associates Link Builder and then install again.

    @amazonlinkbuilder

    My PHP version is 7.0.22

    I had the the same thing happen on version 1.5 running php 7.0.2.

    I ended up disabling the plugin in the wp_options table through phpmyadmin which brought the site back up..

    After that I actually updated the plugin to 1.52 and it’s running ok.

    Same happened to me with Plugin Version 1.5.2 and PHP Version 7.0.20

    musingsfromthelastfrontier

    (@musingsfromthelastfrontier)

    The new update to Link Builder that I installed on Sunday caused a fatal error on my site. My site was down ALL day until I realized now that it was inaccessible. Fortunately my web host was able to disable it. I couldn’t even get into the C Panel to deactivate myself. I am NOT updating this plugin again. I can’t trust it not to take my site down again while I’m at work.

    Mine too is broken. And to add to that, I had just made my qualifying sales, so the site went into review. Because the site was broken, Amazon Affiliates rejected my application and won’t review it again.

    I saw the same thing in my logs. Disabled the plugin (Version 1.5.2). Moving on.

    I have tried installing the Amazon Associates Link Builder update from 1.5.1 to 1.5.2 twice with the same results, the error shown below.

    Parse error: syntax error, unexpected ‘[‘ in /home/content/64/10828864/html/blog/wp-content/plugins/amazon-associates-link-builder/ip2country/aalb_maxmind_db_manager.php on line 197

    Please advise on how to resolve this issue. I was not able to do anything but a complete restore once I get this error. Please advise.

Viewing 15 replies - 1 through 15 (of 20 total)
  • The topic ‘The plugin crashed my site’ is closed to new replies.