Skip to content

[Bug] Possible Race condition when removing last site might break instance #23222

@sgiehl

Description

@sgiehl

What happened?

Matomo aims to ensure that at least one website is existent.
However if there are two websites and a removal request for both websites is sent at the exact same time it can happen that the check, to prevent the removal of the last site, isn't triggered and both sites get removed.
The instance is broken afterwards if no website remains.

What should happen?

Removing websites should be handled concurrency-safe.

How can this be reproduced?

  1. Go to Manage Measurables (a.k.a. Website Management).
  2. Add one more website, so now you have 2 websites listed.
  3. Send API requests to remove both websites in parallel

Matomo version

any

PHP version

No response

Server operating system

No response

What browsers are you seeing the problem on?

No response

Computer operating system

No response

Relevant log output

Validations

Metadata

Metadata

Assignees

Labels

BugFor errors / faults / flaws / inconsistencies etc.triaged

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions