# Database issue is preventing new users to login with docker

**URL:** <https://community.sonatype.com/t/database-issue-is-preventing-new-users-to-login-with-docker/12756>\
**Category:** Sonatype Nexus Repository\
**Tags:** docker, nexus-repository\
**Created:** [June 19, 2024, 8:01am UTC](https://community.sonatype.com/t/database-issue-is-preventing-new-users-to-login-with-docker/12756 "2024-06-19T08:01:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![turekg](https://avatars.discourse-cdn.com/v4/letter/t/35a633/32.png) [@turekg](https://community.sonatype.com/u/turekg)\
**Post date:** [June 19, 2024, 8:01am UTC](https://community.sonatype.com/t/database-issue-is-preventing-new-users-to-login-with-docker/12756/1 "2024-06-19T08:01:04Z")

</div>

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](http://docker.mercator-ocean.fr)”) the error message is usually:  
“Error response from daemon: Get “[https://docker.mercator-ocean.fr/v2/](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:

```auto
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.

---

<div class="post-metadata">

**Author:** ![turekg](https://avatars.discourse-cdn.com/v4/letter/t/35a633/32.png) [@turekg](https://community.sonatype.com/u/turekg)\
**Post date:** [June 20, 2024, 1:22pm UTC](https://community.sonatype.com/t/database-issue-is-preventing-new-users-to-login-with-docker/12756/2 "2024-06-20T13:22:43Z")

</div>

Fixed by following this solution re this type of DB error [sql - No unique or exclusion constraint matching the ON CONFLICT - Stack Overflow](https://stackoverflow.com/questions/42022362/no-unique-or-exclusion-constraint-matching-the-on-conflict?rq=2)
