Error "Entry "Piwik\Auth" cannot be resolved: the class is not instantiable" on execution of core:archive and core:update

Since some days, I have some weird issues with Matomo if some commands are executed from the command line. So far, it only affects the commands “core:archive” and “core:update”.

The following error is printed on execution:

There was an error while regenerating container releases: Entry "Piwik\Auth" cannot be resolved: the class is not instantiable
  Full definition:
  Object (
      class = #NOT INSTANTIABLE# Piwik\Auth
      scope = singleton
      lazy = false

I’ve previously read, that this issue could be caused by the LoginLdap plugin which I’m using in the latest version (v4.0.7) together with Matomo 3.10.0.

The frontend as well as the tracking is working without any issues, but once I execute one of those two commands using the “console” script, the error above occurs every time.

The issue suddenly appeared without doing an upgrade of Matomo or installing a new plugin.

Is there any way to fix this issue?

I guess I found the root cause for this issue: It seems to be caused by multiple concurrent executions of “core:archive” started by a Cronjob every hour. Sometimes the execution takes longer than one hour which results in having multiple concurrent “core:archive” processes running at the same time. This seems to be a problem for the class loader (or whatever is causing the issue) used in Matomo.

I’m not sure whether it’s an issue with the class loader or it is just “by design” as you shouldn’t execute multiple instances of “core:archive” at the same time.

Edit: Even after ensuring that there are no concurrent executions of the “core:archive” command (using the “flock” command), the issue still appears… The weird thing is: It’s not happening every time.

Does anyone know how to fix that?

core:archive can be executed multiple times in parallel without problem, so that wouldn’t be the reason. Feel free to also create a bug report on http://www.github.com/matomo-org/matomo/issues/ if there isn’t one yet :+1:

I couldn’t find an existing issue, so I opened a new one in the issue tracker on GitHub: #14743