• Resolved Mark Howells-Mead

    (@markhowellsmead)


    The following error is occurring with every CRON execution across multiple websites. It happens from time to time and I receive hundreds of emails from all of the websites I manage. The problem usually resolves itself after a few days with no interaction from me, but the flood of emails is very inconvenient.

    Fatal error: Uncaught Exception: GeoIP2AutoUpdater: failed to unzip '[[WEBROOT]]/wp-content/cache/matomo/latest/DBIP-City.mmdb.gz.download' after downloading 'https://download.db-ip.com/free/dbip-city-lite-2024-05.mmdb.gz': The downloaded file is not a valid geolocation database. Please re-check the URL or download the file manually. in [[WEBROOT]]/wp-content/plugins/matomo/app/plugins/GeoIp2/GeoIP2AutoUpdater.php:156

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 20 total)
  • Plugin Support dizzyatinnocraft

    (@dizzyatinnocraft)

    Hi @markhowellsmead, it looks like when Matomo tries auto updating your geolocation database, the download of the database fails, resulting in a corrupt file that can’t be used.

    Can you post the system report located at ‘Matomo Analytics > Diagnostics > System report’? And can you tell me if you have a special setup for your WordPress cron and if all of your websites are on the same server?

    Can you also try clicking the “Install/Update Geo-IP DB” button on the ‘Matomo Analytics > Diagnostics > Troubleshooting’ page? (If it works it will simply reload the page, there’s currently no success notification.)

    Plugin Support dizzyatinnocraft

    (@dizzyatinnocraft)

    Hi @markhowellsmead, are you able to answer my questions in the previous message?

    Plugin Support dizzyatinnocraft

    (@dizzyatinnocraft)

    Hi @markhowellsmead, I can’t help further without more details, so I’m marking this as resolved. Note that we have scheduled some work to avoid sending fatal errror emails when this type of failure occurs. You can track the progress of that work in this issue: https://github.com/matomo-org/matomo-for-wordpress/issues/1110

    Thread Starter Mark Howells-Mead

    (@markhowellsmead)

    I’ve clicked on the button and nothing happens. Where shall I send the troubleshooting report?

    Plugin Support dizzyatinnocraft

    (@dizzyatinnocraft)

    Hi @markhowellsmead, you can post it here, in a new issue on https://github.com/matomo-org/matomo-for-wordpress/issues or you can email dizzy (at) innocraft (dot) com.

    Do you have an answer to my question about your server’s wp cron setup?

    Thread Starter Mark Howells-Mead

    (@markhowellsmead)

    All of the websites are on different servers but all have identical setups.
    The cron is set up using server’s standard crontask process, which we’ve been using for over 15 years.
    The error messages stopped on 11th May, with no change to the process or the software.

    I’ll email you now with the contents of the System Report.

    Plugin Support dizzyatinnocraft

    (@dizzyatinnocraft)

    Hi @markhowellsmead, I see this error in the file you emailed “Error while fetching data: cURL error 28: Operation timed out after 3600000 milliseconds with 17979927 out of 50284387 bytes received”. It seems, sometimes, on your servers, the download of the 50mb database takes far too long (in this case, it aborts after 1 hour).

    It’s possible this was an issue with the geolocation database provider that they eventually resolved, but regardless it’s a network or server configuration issue. We’ll make sure these errors are handled better in the next release so you won’t get spammed with emails, but to resolve the above problem if it reoccurs, you will need to talk to your hosting provider.

    Thread Starter Mark Howells-Mead

    (@markhowellsmead)

    This is still an issue and appears to occur on the 1st day of every month. There are no performance issues with the multiple web servers on which the various websites are hosted.

    Plugin Support dizzyatinnocraft

    (@dizzyatinnocraft)

    @markhowellsmead were you able to find out why your server is not able to finish the 50mb download?

    Thread Starter Mark Howells-Mead

    (@markhowellsmead)

    Using wget on the command line, the file (50.28 Mb) is downloaded in 0.3s.

    Plugin Support dizzyatinnocraft

    (@dizzyatinnocraft)

    Can you try the following on the server to see if it’s a PHP configuration issue? Run the following script and see if it downloads the file successfully:

    <?php
    
    $ch = curl_init("https://download.db-ip.com/free/dbip-city-lite-2024-06.mmdb.gz");
    $fp = fopen("test.db", "w");
    
    curl_setopt($ch, CURLOPT_FILE, $fp);
    curl_setopt($ch, CURLOPT_HEADER, 0);
    
    curl_exec($ch);
    if(curl_error($ch)) {
        fwrite($fp, curl_error($ch));
    }
    curl_close($ch);
    fclose($fp);

    Use the same PHP CLI executable that your crontask process uses to run it.

    With your WordPress setup are you also able to initiate the WP cron from the CLI?

    Thread Starter Mark Howells-Mead

    (@markhowellsmead)

    Yes, that works fine. Yes, the WP cron has been using CLI for several years.

    Plugin Support dizzyatinnocraft

    (@dizzyatinnocraft)

    @markhowellsmead I was asking if you could initiate the WP cron manually to see if you could reproduce the error.

    Thread Starter Mark Howells-Mead

    (@markhowellsmead)

    The cronjob runs every five minutes. I’ve executed it manually on the command line and no error messages (or emails) are generated.

    Plugin Support dizzyatinnocraft

    (@dizzyatinnocraft)

    @markhowellsmead Are you using wp-cli (https://wp-cli.org/) to run the cron? If you run the cron by itself, and the monthly download task has already completed, it won’t run it unless the task is due. If you’re using wp-cli, you can run wp cron event run matomo_scheduled_geoipdb.

    If the error occurs reliably when executing the scheduled task directly, despite not occurring when downloading the file via wget or php curl directly, then we can look into it further.

Viewing 15 replies - 1 through 15 (of 20 total)
  • You must be logged in to reply to this topic.