How to troubleshoot the error ‘Oops, there was a problem with the request’ for Matomo On-Premise
The error, ‘Oops, there was a problem with the request’, is displayed in the Matomo interface when trying to load reports, access settings, or perform other actions. It is often accompanied by an HTTP 400
, 403
, or 500
response, or a JavaScript error message from the request to your Matomo On-Premise server.
- To diagnose the issue, open your browser’s developer tools (F12 > Inspect > Network) and check the failed request.
- The status code and response details will help identify whether the problem is related to permissions, server configuration, caching, or other factors.
- Check the Console and Network tabs for JavaScript errors, such as forbidden request types.
The steps below will help you systematically troubleshoot and resolve the issue. If the error persists, reviewing Matomo’s and your web server’s logs will provide further information into the root cause.
1. Check the browser console for details
In the browser’s developer tools (Console and Network tabs), look for JavaScript errors or failed requests. These errors can help pinpoint the issue:
-
403 Forbidden error usually indicates permissions issues or security blocks that may be caused by:
- ModSecurity rules blocking requests (common on shared hosting).
- If using Cloudflare or another Web Application Firewall (WAF), check for blocked requests in its security dashboard.
.htaccess
or Nginx rules restricting access.- File or directory permissions preventing access.
-
500 Internal Server error indicates a server-side issue, often related to:
- PHP errors (e.g., missing dependencies, syntax issues).
- Incorrect
.htaccess
ornginx.conf
settings. - Insufficient PHP memory limits.
- Check Matomo logs for more details:
tail -f /path/to/matomo/tmp/logs/matomo.log
- Check the web server error logs for PHP-related issues:
tail -f /var/log/apache2/error.log # Apache tail -f /var/log/nginx/error.log # Nginx
-
CORS (Cross-Origin Resource Sharing) errors
- If Matomo is hosted on a different domain than the tracked site, the browser may block requests due to CORS restrictions.
- Check if errors mention CORS policy violations.
- If needed, allow cross-origin requests by modifying
config/config.ini.php
:
[General] enable_cors = 1
- CSRF (Cross-Site Request Forgery) errors
- If Matomo logs indicate CSRF token issues, the session may have expired, or browser settings may be blocking session cookies.
- Ensure that cookies are not blocked by browser settings or extensions.
2. Clear cache (browser and Matomo)
- Open your browser settings and clear cached files and cookies. Use a hard refresh (
Ctrl + Shift + R
on Windows/Linux orCmd + Shift + R
on macOS). - Test in an incognito/private window to rule out cached data issues.
- In Matomo, run the
./console cache:clear
command. Read more on clearing cache in Matomo. - If you use a reverse proxy (e.g., Varnish, Cloudflare, Nginx cache), purge the cache.
3. Check permissions
- Check your web server error logs for permission-related errors.
- Ensure the correct file and folder permissions are set in Matomo’s directory. The
tmp/
andconfig/
folders should be writable by the web server. - If using SELinux, check and allow Matomo to write to these directories.
- If using Nginx with PHP-FPM, verify that the correct user owns the files.
4. Check web server error logs
Checking the web server error logs can help identify permission issues, misconfigurations, PHP errors, or connectivity problems. Run the following command to monitor the server logs in real-time:
tail -f /var/log/apache2/error.log # Apache
tail -f /var/log/nginx/error.log # Nginx
The following errors could identify the issue:
- 403 Forbidden error: Incorrect file permissions, ModSecurity/WAF blocking requests,
.htaccess
or Nginx rules. - 500 Internal Server error: PHP misconfiguration, insufficient memory, or incorrect
.htaccess
rules. - 404 Not Found error: Missing files or incorrect web server configuration.
- 502 Bad Gateway or 504 Gateway Timeout: PHP-FPM crashes or the web server cannot reach the PHP backend.
- CORS or mixed content errors: Matomo is accessed from a different domain without proper CORS headers.
If you don’t have SSH access, check the logs via your hosting provider’s control panel (e.g., cPanel, Plesk, or a cloud provider).
5. Check Matomo log files
Matomo logs can provide details into errors, database issues, or unexpected behaviour. If logging is enabled, check for errors using:
tail -f /path/to/matomo/tmp/logs/matomo.log
- PHP Fatal errors indicate missing PHP extensions or a misconfigured environment. Check installed PHP modules.
- Database errors could be database connection issues, such as MySQL crashes or timeouts. Check database logs.
- Permission issues relate to incorrect ownership and permissions.
- Missing or corrupt files can be resolved by reinstalling Matomo.
6. Increase PHP limits
If the issue is caused by PHP resource constraints, increase PHP memory limits in your php.ini
. After making changes, restart PHP-FPM and Apache/Nginx to apply the new settings:
sudo systemctl restart php-fpm
sudo systemctl restart apache2\
After editing the file, check the active PHP settings. If the values haven’t changed, ensure you’re editing the correct php.ini
.
7. Check for network issues
Network issues can prevent Matomo from loading correctly. Ensure the Matomo server is reachable from your browser and that there are no connectivity problems. Use curl to check if the Matomo server responds:
curl -I https://your-matomo-url.com
- A 200 OK response means the server is reachable.
- A 403 Forbidden or 500 Internal Server Error may indicate permission or configuration issues.
- A timeout or connection refused error suggests a network issue or server downtime.
Additional checks:
- If Matomo is self-hosted, ensure the server’s firewall allows HTTPS traffic.
- If Matomo isn’t loading, check if the domain resolves correctly. If not, there may be a DNS configuration.
- Log in to your Matomo server and check outbound connectivity. If this fails, the server itself may have network restrictions.
8. Disable third-party plugins
Some plugins (e.g., ModSecurity, security extensions, or WAFs) can interfere with requests, causing errors in the Matomo interface. If Matomo is embedded in a CMS like WordPress, security plugins might block analytics requests.
Disabling these temporarily can help identify the root cause.
- Temporarily disable custom Matomo plugins:
./console plugin:deactivate PluginName
- If you are unsure which plugin is causing the issue, disable all non-core plugins:
./console plugin:list # List all active plugins
./console plugin:deactivate --all # Disable all plugins
- Then, reactivate them individually to find the problematic one:
./console plugin:activate PluginName
Server-side security plugins or web application firewalls (WAFs) may block requests to Matomo. If your server runs a security module, try temporarily disabling it and restarting the server to identify if it’s a potential cause.
9. Check for database issues
Database errors can cause Matomo to malfunction or display incomplete data. First run a database check:
./console core:run-scheduled-tasks
- Check the database logs for lock issues, crashes, or connection failures. If the database is corrupted or slow, repair and optimise the tables.
- Ensure the database service is running. If Matomo cannot connect, verify database credentials in
config/config.ini.php
.
10. Check for CORS issues
If Matomo is hosted on a different domain than the site being tracked, browser security policies may block requests due to Cross-Origin Resource Sharing (CORS) restrictions. To allow cross-origin requests, ensure CORS is enabled in Matomo’s configuration:
[General]
enable_cors = 1
Learn more on how to configure my Matomo server to allow cross domain requests (CORS).
11. Review browser security and ad blockers
Certain browser extensions, such as ad blockers, privacy tools, anti-tracking add-ons, and script blockers, may block Matomo requests or prevent tracking scripts from loading correctly.
- Use the browser’s developer tools (F12 > Inspect > Console/Network tab) to check if requests to Matomo are blocked.
- Look for errors like
net::ERR_BLOCKED_BY_CLIENT
or403 Forbidden
. - Test Matomo in an Incognito/Private Browsing mode and try using a different browser without security extensions to see if the issue persists.
- Temporarily disable ad blockers (e.g., uBlock Origin, Adblock Plus), privacy tools and security add-ons (e.g., NoScript, DuckDuckGo).
- If Matomo works after disabling an extension, whitelist your Matomo domain in the extension’s settings.
12. Matomo updates or incomplete installation
Outdated or incomplete installations can cause errors in Matomo. Ensure your installation is fully updated and check if any core files are missing or modified:
./console diagnostics:run
If issues are detected, you may need to reinstall Matomo. Download the latest Matomo release, extract the files over the existing installation, and ensure the correct permissions are applied after extraction.
For high-traffic or multi-server setups, check the following:
- Load balancer and proxy configurations: If using a reverse proxy, confirm requests are correctly forwarded to Matomo. Ensure the Matomo base URL is correctly set in
config/config.ini.php
. - File synchronisation: If Matomo runs on multiple servers, ensure all nodes have updated files after an upgrade.
13. Review server configuration (Apache/Nginx)
Misconfigured web server settings can cause issues with Matomo, such as 403 Forbidden, 500 Internal Server Errors, or missing assets. Verify the configuration based on your web server and if issues persist, review logs for Apache or Nginx errors.
For Apache, check .htaccess
rules to ensure they are correctly set:
cat /path/to/matomo/.htaccess
- Ensure
mod_rewrite
is enabled and look for deny rules that may be blocking access. - If
.htaccess
is missing or incorrect, regenerate it by downloading a fresh Matomo copy.
For Nginx, verify the Matomo server block settings:
cat /etc/nginx/sites-available/matomo
- Ensure
index.php
is set as the entry point and PHP requests are being properly forwarded. - Test the configuration before reloading:
nginx -t && systemctl reload nginx
14. Check for Cross-Site Request Forgery (CSRF) Issues
CSRF errors occur when Matomo rejects a request due to invalid or missing security tokens, often caused by session cookies being blocked or modified.
- If Matomo logs indicate a CSRF token mismatch, check the error logs and look for entries like
[CSRF] Invalid security token
. - Use the browser developer tools (F12 > Inspect > Console tab). Check for warnings about SameSite cookies or blocked third-party cookies.
- If Matomo is embedded in another domain, adjust
config/config.ini.php
to allow cross-origin authentication:
[General]
enable_framed_pages = 1
If requests fail due to strict security settings, add trusted domains in config.ini.php
:
[General]
trusted_hosts[] = "your-matomo-url.com"
Next steps
By systematically following these troubleshooting steps, you should be able to identify and resolve the error. If the issue persists, explore the Matomo Forums and issue tracker similar issues or solutions.