Archivierung schlägt fehl

Grüße Euch,
ich habe leider einen Fehler, den ich auch schön öfter durch die Suche hier gefunden habe:

Matomo Archive Warnings: 'Got invalid response from API request: ?module=API&method=API.get&idSite=1&period=day&date=last52&format=php&trigger=archivephp. The response was empty. This usually means a server error. A solution to this error is generally to increase the value of \'memory_limit\' in your php.ini file. For more information and the error message please check in your PHP CLI error log file. As this core:archive command triggers PHP processes over the CLI, you can find where PHP CLI logs are stored by running this command: php -i | grep error_log'
'Empty or invalid response \'\' for website id 1, Time elapsed: 1.993s, skipping'
'2 total errors during this script execution, please investigate and try and fix these errors.'
'2 total errors during this script execution, please investigate and try and fix these errors.'

Ich habe auch mein PHP Error Log durchgeschaut, aber da gibt es keinerlei Eintrag dazu. Ich habe extra eine fehlerhafte php angelegt und laufen lassen - der Fehler wurde geloggt. Mein Memory Limit liegt bei 512M, das sollte für meine kleine Hobbyseite mit wenigen Besuchern doch locker genügen.
Ich habe auch mal das hier über die CL versucht:
php console core:archive --force-all-websites --force-all-periods=315576000 --force-date-last-n=1000 --url=123.de, das hat geklappt (komischerweise habe ich jetzt in der Datenbank Tabellen bis 2008_12 obwohl es die Seite erst seit 3 Monaten gibt, aber gut).
Ich nutze PHP Version 7.4.5, es handelt sich um das Matomo WP Plugin und ich nutzte noch Ninja Firewall (aber die habe ich auch schon mal deaktiviert um eine Interferenz auszuschließen).
Wäre dankbar über Hinweise, vermutlich stehe ich auf dem Schlauch…
Viele Grüße
doc

Hallo @docb7 sind noch irgendwelche anderen plugins aktiv?

Könntest du uns den System Report zusenden? Siehe I have an issue with the plugin, how do I troubleshoot and enable debug mode? FAQ - Analytics Platform - Matomo Du kannst den System Report entweder hier im Forum posten (er sollte automatisch anonymisiert sein) oder uns per email zusenden: wordpress at matomo.org

Evtl. hilft es auch das Archivieren manuell zu starten. Könntest du auf Diagnostics -> Troubleshooting gehen und dann auf “Archive Reports” klicken? Funktioniert es dann oder kommt ggf ein Fehler?

Guten Morgen,
das manuelle Archivieren hatte ich auch schon getestet - Fehler:

Matomo Archive Warnings: 'Got invalid response from API request: ?module=API&method=API.get&idSite=1&period=day&date=last52&format=php&trigger=archivephp. The response was empty. This usually means a server error. A solution to this error is generally to increase the value of \'memory_limit\' in your php.ini file. For more information and the error message please check in your PHP CLI error log file. As this core:archive command triggers PHP processes over the CLI, you can find where PHP CLI logs are stored by running this command: php -i | grep error_log'
'Empty or invalid response \'\' for website id 1, Time elapsed: 1.941s, skipping'
'2 total errors during this script execution, please investigate and try and fix these errors.'
'2 total errors during this script execution, please investigate and try and fix these errors.'

Wenn ich das WP-Debug einschalte passiert übrigens was völlig irres:

  1. Im debug.log steht nichts interessantes, wenn ich das manuelle Archivieren anstoße, nur:
[08-May-2020 05:54:00 UTC] Matomo: Add tracking code. Blog ID: 1
[08-May-2020 05:56:11 UTC] Matomo: Scheduled tasks archive data
[08-May-2020 05:56:48 UTC] Matomo: Scheduled tasks archive data
[08-May-2020 05:57:06 UTC] Matomo: Add tracking code. Blog ID: 1
[08-May-2020 05:57:10 UTC] Matomo: Add tracking code. Blog ID: 1
[08-May-2020 05:57:10 UTC] Matomo: Add tracking code. Blog ID: 1
[08-May-2020 05:57:15 UTC] Matomo: Add tracking code. Blog ID: 1
[08-May-2020 05:57:20 UTC] Matomo: Add tracking code. Blog ID: 1
[08-May-2020 05:57:22 UTC] Matomo: Add tracking code. Blog ID: 1
[08-May-2020 05:57:23 UTC] Matomo: Add tracking code. Blog ID: 1
[08-May-2020 06:00:28 UTC] Matomo: Scheduled tasks archive data
  1. Wenn ich das manuelle Archivieren anstoße, kommt im WP Debug Mode nicht mehr die Troubleshoot-Seite mit der o.g. Fehlermeldung, sondern es wird nur der HTML-Code der Seite ausgegeben (nicht gerendert, quasi als würde ich mir den Quelltext anzeigen lassen wollen).

Und ja, es sind noch einige Plugins aktiviert - die stehen im Systemreport:

				  # Matomo

* Matomo Pluginversion: 1.0.6
* Config existiert und ist beschreibbar.: Ja ("$ABSPATH/wp-content/uploads/matomo/config/config.ini.php" )
* JS Tracker existiert und ist beschreibbar.: Ja ("$ABSPATH/wp-content/uploads/matomo/matomo.js" )
* Plugin-Verzeichnisse: Yes ([{"pluginsPathAbsolute":"$ABSPATH\/wp-content\/plugins\/matomo\/plugins","webrootDirRelativeToMatomo":"..\/"}])
* Tmp-Verzeichnis schreibbar: Yes ($ABSPATH/wp-content/cache/matomo)
* Matomo Version: 3.13.5
* Matomo Blog idSite: 1

## Endpoints

* Matomo JavaScript Tracker URL:  ($site_url/wp-content/uploads/matomo/matomo.js)
* Matomo JavaScript Tracker - WP Rest API:  ($site_url/wp-json/matomo/v1/hit/)
* Matomo HTTP Tracking API:  ($site_url/wp-content/plugins/matomo/app/matomo.php)
* Matomo HTTP Tracking API - WP Rest API:  ($site_url/wp-json/matomo/v1/hit/)

## Crons

* Server-Zeit: 2020-05-08 06:10:23
* Blog-Zeit: 2020-05-08 08:10:23 (Die nachfolgenden Daten werden in der Blog-Zeitzone angezeigt)
* Sync users & sites: Next run: 2020-05-08 23:24:58 (15 Stunden 14 Minuten) ( Last started: 2020-05-07 23:30:51 (-8 Stunden 39 Minuten). Last ended: 2020-05-07 23:30:51 (-8 Stunden 39 Minuten). Interval: daily)
* Archive: Next run: 2020-05-08 08:24:58 (14 Minuten 35s) ( Last started: 2020-05-08 07:32:29 (-37 Minuten 54s). Last ended: 2020-05-06 22:26:21 (-1 Tage 9 Stunden). Interval: hourly)
* Update GeoIP DB: Next run: 2020-05-28 23:32:00 (20 Tage 15 Stunden) ( Last started: 2020-04-28 23:41:46 (-9 Tage 8 Stunden). Last ended: 2020-04-28 23:41:47 (-9 Tage 8 Stunden). Interval: matomo_monthly)

## Vorgeschriebene Prüfungen

* PHP-Version >= : ok 
* PDO Erweiterung: ok 
* PDO\MYSQL Erweiterung: ok 
* MYSQLI Erweiterung: ok 
* Weitere erforderliche Anforderungen: ok 
* Erforderliche Funktionen: ok 
* Benötigte PHP Konfiguration (php.ini): ok 
* Verzeichnisse mit Schreibzugriff: ok 
* Verzeichnisse mit Schreibzugriff auf Tag Manager: ok 

## Optionale Prüfungen

* Tracker-Status: ok 
* Speicherlimit: ok 
* Zeitzone: ok 
* Öffnen einer URL: ok 
* PageSpeed deaktiviert: ok 
* GD > 2.x + Freetype (graphics): ok 
* Andere Erweiterungen: ok 
* Andere Funktionen: ok 
* Dateisystem: ok 
* Archiv Cron: ok 
* Letzter erfolgreicher Abschluss der Archivierung: ok 
* Maximale Packetgröße: ok 
* Standorterkennung: ok 
* Update über HTTPS: ok 
* Schreibbarer JavaScript-Tracker ("/matomo.js"): ok 
* Supports Async Archiving: Yes
* Location provider ID: geoip2php
* Location provider available: Yes
* Location provider working: Yes
* Had visit in last 5 days: Yes

## Matomo Settings

* Track mode: default
* Track codeposition: footer
* Track api endpoint: default
* Track js endpoint: default
* Version history: 1.0.6, 1.0.5, 1.0.4, 1.0.3
* Core version: 3.13.5
* Last tracking settings update: 1588887051
* Last settings update: 1588887051

## Logs

* Warning archive_main: 2020-05-08 07:32:34 (2 total errors during this script execution, please investigate and try and fix these errors. => CronArchive.php:606; CronArchive.php:599; CronArchive.php:331; Access.php:644; CronArchive.php:335; ScheduledTasks.php:225; class-wp-hook.php:285; class-wp-hook.php:311; plugin.php:544; wp-cron.php:138;)
* Warning archive_errors: 2020-05-08 07:32:34 ('Got invalid response from API request: ?module=API&method=API.get&idSite=1&period=day&date=last30&format=php&trigger=archivephp. The response was empty. This usually means a server error. A solution to this error is generally to increase the value of \'memory_limit\' in your php.ini file.  For more information and the error message please check in your PHP CLI error log file. As this core:archive command triggers PHP processes over the CLI, you can find where PHP CLI logs are stored by running this command: php -i | grep error_log' 'Empty or invalid response \'\' for website id 1, Time elapsed: 4.544s, skipping' '2 total errors during this script execution, please investigate and try and fix these errors.' => ScheduledTasks.php:238; class-wp-hook.php:285; class-wp-hook.php:311; plugin.php:544; wp-cron.php:138;)
* Warning archive_main: 2020-05-08 08:01:21 (2 total errors during this script execution, please investigate and try and fix these errors. => CronArchive.php:606; CronArchive.php:599; CronArchive.php:331; Access.php:635; CronArchive.php:335; ScheduledTasks.php:225; SystemReport.php:85; SystemReport.php:143; class-wp-hook.php:287; class-wp-hook.php:311; plugin.php:478; admin.php:254;)
* Warning archive_errors: 2020-05-08 08:01:21 ('Got invalid response from API request: ?module=API&method=API.get&idSite=1&period=day&date=last52&format=php&trigger=archivephp. The response was empty. This usually means a server error. A solution to this error is generally to increase the value of \'memory_limit\' in your php.ini file.  For more information and the error message please check in your PHP CLI error log file. As this core:archive command triggers PHP processes over the CLI, you can find where PHP CLI logs are stored by running this command: php -i | grep error_log' 'Empty or invalid response \'\' for website id 1, Time elapsed: 1.689s, skipping' '2 total errors during this script execution, please investigate and try and fix these errors.' => ScheduledTasks.php:238; SystemReport.php:85; SystemReport.php:143; class-wp-hook.php:287; class-wp-hook.php:311; plugin.php:478; admin.php:254;)
* Warning archive_main: 2020-05-08 08:05:21 (2 total errors during this script execution, please investigate and try and fix these errors. => CronArchive.php:606; CronArchive.php:599; CronArchive.php:331; Access.php:635; CronArchive.php:335; ScheduledTasks.php:225; SystemReport.php:85; SystemReport.php:143; class-wp-hook.php:287; class-wp-hook.php:311; plugin.php:478; admin.php:254;)
* Warning archive_errors: 2020-05-08 08:05:21 ('Got invalid response from API request: ?module=API&method=API.get&idSite=1&period=day&date=last52&format=php&trigger=archivephp. The response was empty. This usually means a server error. A solution to this error is generally to increase the value of \'memory_limit\' in your php.ini file.  For more information and the error message please check in your PHP CLI error log file. As this core:archive command triggers PHP processes over the CLI, you can find where PHP CLI logs are stored by running this command: php -i | grep error_log' 'Empty or invalid response \'\' for website id 1, Time elapsed: 1.941s, skipping' '2 total errors during this script execution, please investigate and try and fix these errors.' => ScheduledTasks.php:238; SystemReport.php:85; SystemReport.php:143; class-wp-hook.php:287; class-wp-hook.php:311; plugin.php:478; admin.php:254;)

# WordPress

* Home URL: $site_url
* Site URL: $site_url
* WordPress Version: 5.4.1
* Number of blogs: 1
* Multisite Enabled: No
* Network Enabled: No
* WP_DEBUG: No
* WP_DEBUG_DISPLAY: Yes
* WP_DEBUG_LOG: Yes
* DISABLE_WP_CRON: -
* FORCE_SSL_ADMIN: Yes
* WP_CACHE: Yes
* CONCATENATE_SCRIPTS: -
* COMPRESS_SCRIPTS: -
* COMPRESS_CSS: -
* ENFORCE_GZIP: -
* WP_LOCAL_DEV: -
* DIEONDBERROR: -
* WPLANG: -
* Permalink Structure: /%postname%/
* Possibly uses symlink: No
* Compatible content directory: Yes

# WordPress Plugins


## MU Plugins

* 0-ninjafirewall.php: 1.0

## Plugins

* Antispam Bee: 2.9.2
* Autoptimize: 2.7.1
* Avatar Privacy: 2.3.4
* Code Snippets: 2.14.0
* Contact Form 7: 5.1.7
* Duplicate Post: 3.2.4
* Easy Updates Manager: 9.0.3 (Network enabled)
* Honeypot for Contact Form 7: 1.14.1
* Honeypot for WP comment: 1.0.0
* Insert PHP Code Snippet: 1.3.1
* Matomo Analytics - Ethical Stats. Powerful Insights.: 1.0.6
* Modern Footnotes: 1.3.9
* Newsletter: 6.6.4
* NextGEN Gallery: 3.3.5
* NinjaFirewall (WP Edition): 4.1.1 (Network enabled)
* Popup Maker: 1.10.1
* Post Type Switcher: 3.2.0
* Redirection: 4.7.1
* Shariff Wrapper: 4.6.5
* ShortPixel Image Optimizer: 4.18.0
* Smash Balloon Instagram Feed: 2.4.1
* SSL Insecure Content Fixer: 2.7.2
* TablePress: 1.11
* Ultimate Addons for Gutenberg: 1.14.10
* UpdraftPlus - Backup/Restore: 1.16.23
* WP-Polls: 2.75.4
* wp-worthy: 1.5.4.1
* WP Super Cache: 1.7.1
* WP ULike: 4.2.1
* WP YouTube Lyte: 1.7.11
* Yoast SEO: 14.0.4
* Active Plugins: 31 (antispam-bee autoptimize avatar-privacy code-snippets contact-form-7-honeypot contact-form-7 duplicate-post honeypot-for-wp-comment insert-php-code-snippet instagram-feed matomo modern-footnotes newsletter ninjafirewall popup-maker post-type-switcher redirection shariff shortpixel-image-optimiser ssl-insecure-content-fixer stops-core-theme-and-plugin-updates tablepress ultimate-addons-for-gutenberg updraftplus wordpress-seo wp-polls wp-super-cache wp-ulike wp-worthy wp-youtube-lyte nextgen-gallery)

# Server

* Server Info: Apache
* PHP OS: Linux
* PHP Version: 7.4.5
* PHP SAPI: fpm-fcgi
* PHP Binary Name: php-fpm
* PHP Found Binary: php -q
* Timezone: UTC
* WP timezone: +02:00
* Locale: de_DE
* User Locale: de_DE
* Memory Limit: 512M (At least 128MB recommended. Depending on your traffic 256MB or more may be needed.)
* Max Memory Limit: 512M
* Time: 1588918223
* Max Execution Time: 30
* Max Post Size: 256M
* Max Upload Size: 262144000
* Max Input Vars: 1000
* Disabled PHP functions: Yes (opcache_get_status)
* zlib.output_compression is off: Yes
* Curl Version: 7.58.0, OpenSSL/1.1.1
* Suhosin installed: No

# Database

* MySQL Version: 5.5.5
* Mysqli Connect: Yes
* Force MySQL over Mysqli: No
* DB Prefix: wpbb2_
* DB CHARSET: utf8
* DB COLLATE: 
* Uses Socket: No
* Uses IPv6: No
* Erforderliche Berechtigungen: OK

# Browser

* Browser: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:76.0) Gecko/20100101 Firefox/76.0
* Language: de,en-us,en

	

Vielen Dank schon mal für die Hilfe. Und vielleicht noch als mögliche Fehlerquelle: ich habe die Datenbank mal umgezogen, von einer anderen Domain. Die Wordpress Plugins habe ich aber frisch installiert.
Viele Grüße

Wenn ich das manuelle Archivieren anstoße, kommt im WP Debug Mode nicht mehr die Troubleshoot-Seite mit der o.g. Fehlermeldung, sondern es wird nur der HTML-Code der Seite ausgegeben (nicht gerendert, quasi als würde ich mir den Quelltext anzeigen lassen wollen).

Ich habe das gleiche vor kurzem von jemand anders auch beschrieben bekommen. Ich glaube, nachdem einmal das WP_DEBUG aktiviert wurde für kurze Zeit, funktionierte es danach und wir konnten nicht genau heraus finden was es war.

Das gute ist, mit der gleichen PHP version und gleichen Plugins kann ich es reproduzieren. Das NextGenGallery plugin verursacht das Problem und ich bin schon am schauen was genau hier passiert. Ich werde dich auf dem Laufenden halten.

@docb7 besteht die Möglichkeit dass du Dateien in deinem WordPress ändern kannst? Falls ja, kannst du in der Datei wp-content/plugins/matomo/app/core/CliMulti/RequestCommand.php diese Änderung machen? Fix archive error "Empty or invalid response" by tsteur · Pull Request #271 · matomo-org/wp-matomo · GitHub

Dies sollte den Fehler beheben.

Servus, klar, ich kann alles ändern, allerdings verstehe ich den Lösungsweg nicht ganz. Die RequestCommand.php habe ich auf, aber ich kapiere nicht so ganz, was ich da ändern soll. Ich finde da keinen Aufruf mit -q.
Viele Grüße

Hallo @docb7,

Die Änderung kannst du hier sehen:

diff --git a/app/core/CliMulti/RequestCommand.php b/app/core/CliMulti/RequestCommand.php
index e6cf6eba..5f4e77bb 100644
--- a/app/core/CliMulti/RequestCommand.php
+++ b/app/core/CliMulti/RequestCommand.php
@@ -81,6 +81,10 @@ protected function execute(InputInterface $input, OutputInterface $output)
         if (!empty($process)) {
             $process->finishProcess();
         }
+        
+        while (ob_get_level()) {
+	        echo ob_get_clean();
+        }
     }
 
     private function isTestModeEnabled()

Es geht also darum nach der Zeile 83 diesen Block einzufügen:

        while (ob_get_level()) {
	        echo ob_get_clean();
        }

Sorry für die späte Rückmeldung, ich habe keine Nachricht über die Antwort bekommen und das Problem glatt vergesse :wink: Super, herzlichen Dank, so funktioniert das einwandfrei! Großes Kino!

PS: kleine Ergänzung: im WP Debug-Modus kommt beim manuellen Archivieren immer noch die HTML-Quellcode Seite raus.