Matomo 502 NginX error in LocalWp

What issue or error are you experiencing?

When installing the Matomo Plugin on a clean new Wp Site provisioned with LocalWp on Mac I get a 502 error. The same happens if I migrate an existing site with Matomo installed and try to access the Matomo Dashboard.

The installation as well as usage works on our servers as well as others local environments like DDEV.

There’s also an ongoing discussion in the Matomo Plugin Github, but I assume it has something to do with the Local NginX / PHP configs.

NOTE: Another dev using Linux didn’t had the problem. Therewith I assume it’s something MacOs / Apple Silicon related


What steps can be taken to replicate the issue? Feel free to include screenshots, videos, etc

  • Create a new site
  • Install the Matomo Plugin
  • Activate the Plugin
  • → 502 error

System Details

  • Local Version:
    Version 9.2.4+6788

  • Operating System (OS) and OS version:
    MacOs Sequoia (15.4.1)


Local Logs

Attach your Local Logs here (Help Doc - Retrieving Local’s Log)


Security Reminder
Local does a pretty good job of scrubbing private info from the logs and the errors it produces, however there’s always the possibility that something private can come through. Because these are public forums, always review the screenshots you are sharing to make sure there isn’t private info like passwords being displayed.

Hi @Dominic! I tested this on macOS and Windows and had some interesting results.

On MacOS, I was able to replicate the 502, but then I opened a new Admin page, and the plugin was installed, and I was able to complete activation.

On Windows, it let me click Install and Activate but I got a 405 error:

Installation failed: 405 Not Allowed 405 Not Allowed nginx/1.26.1 <!-- a padding to disable MSIE and Chrome friendly error page --> <!-- a padding to disable MSIE and Chrome friendly error page --> <!-- a padding to disable MSIE and Chrome friendly error page --> <!-- a padding to disable MSIE and Chrome friendly error page --> <!-- a padding to disable MSIE and Chrome friendly error page --> <!-- a padding to disable MSIE and Chrome friendly error page -->

Similarly however, I opened a new browser tab with the Admin dashboard pulled up and the plugin was there and I was able to complete the activation.

So at least for now, are you still able to get back into the dashboard and get the plugin to activate?

HI @Nick-B
Thanks for checking that fast!

While part of the installation works and the plugin pages are registered, I still won’t be able to open the Matomo dashboard afterwards (Matomo Analytics → Reporting and Matomo Analytics → Tag Manager). Both pages will keep producing a 502.

I’m not getting any more 502s but I do get a critical error:

Fatal error: Uncaught Exception: Renderer format ‘console’ not valid. Try any of the following instead: . in /Users/user/Local Sites/test/app/public/wp-content/plugins/matomo/app/core/API/ApiRenderer.php:117 Stack trace: #0 /Users/user/Local Sites/test/app/public/wp-content/plugins/matomo/app/core/API/ResponseBuilder.php(40): Piwik\API\ApiRenderer::factory(‘console’, Array) #1 /Users/user/Local Sites/test/app/public/wp-content/plugins/matomo/app/core/API/Request.php(252): Piwik\API\ResponseBuilder->__construct(‘console’, Array) #2 /Users/user/Local Sites/test/app/public/wp-content/plugins/matomo/app/core/API/Request.php(511): Piwik\API\Request->process() #3 /Users/user/Local Sites/test/app/public/wp-content/plugins/matomo/classes/WpMatomo/Report/Metadata.php(40): Piwik\API\Request::processRequest(‘API.getReportMe…’, Array) #4 /Users/user/Local Sites/test/app/public/wp-content/plugins/matomo/classes/WpMatomo/Report/Metadata.php(75): WpMatomo\Report\Metadata->get_all_reports() #5 /Users/user/Local Sites/test/app/public/wp-content/plugins/matomo/classes/WpMatomo/Admin/Summary.php(116): WpMatomo\Report\Metadata->find_report_by_unique_id(‘VisitsSummary_g…’) #6 /Users/user/Local Sites/test/app/public/wp-content/plugins/matomo/classes/WpMatomo/Admin/Summary.php(65): WpMatomo\Admin\Summary->get_reports_to_show() #7 /Users/user/Local Sites/test/app/public/wp-includes/class-wp-hook.php(324): WpMatomo\Admin\Summary->show(‘’) #8 /Users/user/Local Sites/test/app/public/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(‘’, Array) #9 /Users/user/Local Sites/test/app/public/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #10 /Users/user/Local Sites/test/app/public/wp-admin/admin.php(260): do_action(‘matomo-analytic…’) #11 {main} thrown in /Users/user/Local Sites/test/app/public/wp-content/plugins/matomo/app/core/API/ApiRenderer.php on line 117

True, that’s a side-effect of the 502 during the installation.

As a workaround you can either:

  • import a instance with a successful installation (I can mail you one if it helps)
  • …or deactivate and delete the plugin, download it again (to have a fresh start) and before activation comment out the two calls to the \Piwik\Piwik::postEvent( function within the app/core/FrontController.php init() function

This way the installation will finish but you’ll still get the 502 when trying to open the dashboard.

Any Idea what could be the issue? Haven’t seen this outside of Local.

Thank you for all of the details here @Dominic! I’m checking with the Local team and we’ll let you know if need anything else for more troubleshooting on our side.

1 Like

I took a closer look and replied in the Github issue:

1 Like

Thanks @Nick-B and @ben.turner for the great analysis and support!

2 Likes

Thank you for bringing it to our attention @Dominic! :green_heart: