Database issue is preventing new users to login with docker

Hello there. I am having issues with new users of docker repositories not being able to log in. Pre-existing users have no issues whatsoever.
When a “new” user tries to login (“docker login docker.mercator-ocean.fr”) the error message is usually:
“Error response from daemon: Get “https://docker.mercator-ocean.fr/v2/”: received unexpected HTTP status: 500 Server Error”

It appears that there is a issue with the database. From the nexus.log:

2024-06-19 16:28:21,990+0200 WARN  [qtp1077871857-26291]  tester org.sonatype.nexus.repository.httpbridge.internal.ViewServlet - Failure servicing: GET /repository/docker-all/v2/token?account=tester&client_id=docker&offline_token=true&service=https%3A%2F%2Fdocker.mercator-ocean.fr%2Fv2%2Ftoken
org.sonatype.nexus.datastore.api.DataAccessException:
### Error updating database.  Cause: org.postgresql.util.PSQLException: ERROR: there is no unique or exclusion constraint matching the ON CONFLICT specification
### The error may exist in org/sonatype/nexus/internal/security/apikey/ApiKeyDAO.xml
### The error may involve org.sonatype.nexus.internal.security.apikey.ApiKeyDAO.save-Inline
### The error occurred while setting parameters
### SQL: INSERT INTO api_key (primary_principal, domain, token, principals )         VALUES (?,                 ?, ?, ? )     ON CONFLICT (primary_principal, domain, principals) DO UPDATE SET         token = ?, principals = ?,          created = CURRENT_TIMESTAMP ;
### Cause: org.postgresql.util.PSQLException: ERROR: there is no unique or exclusion constraint matching the ON CONFLICT specification

I am thinking this is also related to the issue (also posted here) whereby a user cannot view his own user token.

Fixed by following this solution re this type of DB error sql - No unique or exclusion constraint matching the ON CONFLICT - Stack Overflow