Answers: <p>A personal access token to push to the registry does not <em>just</em> require <code>write_registry</code> but <strong>ALSO</strong> <code>read_registry</code> or <code>read_api</code> (more general).</p>
  
Answers: CC BY-SA 4.0
Answers: 2022-05-15T06:56:21.760Z
Answers: 2022-05-15T06:56:21.760Z
Answers: Evan Carroll
Answers: <p>firstly, you can just make <code>docker logout registry.gitlab.com</code>, and login again <code>docker login registry.gitlab.com</code>, it's wrong because old token have not access for new registry</p>
  
Answers: CC BY-SA 4.0
Answers: 2023-01-19T15:09:58.580Z
Answers: 2023-01-19T15:09:58.580Z
Answers: Constantin Karataev
Body: <p>When I run <code>podman push</code> (the equiv of <code>docker push</code>) to get my image up to GitLab's container registry, I'm getting the following error.</p>
  <blockquote>
  <p>errors: denied: requested access to the resource is denied [...] error parsing HTTP 401 response body: unexpected end of JSON input: &quot;&quot;</p>
  </blockquote>
  <p>You can see it all here,</p>
  <pre><code>❯ podman push localhost/acme-web-release registry.gitlab.com/evancarroll/acme-backend
  Getting image source signatures
  Error: trying to reuse blob sha256:1e05dc5a6784f6e7375fe1f73dc2b02f7d184bc53a0150daf06062dcbfde02d4 at destination: checking whether a blob sha256:1e05dc5a6784f6e7375fe1f73dc2b02f7d184bc53a0150daf06062dcbfde02d4 exists in registry.gitlab.com/evancarroll/acme-backend: errors:
  denied: requested access to the resource is denied
  error parsing HTTP 401 response body: unexpected end of JSON input: &quot;&quot;
  </code></pre>
  <p>I've confirmed that I've <code>podman login</code> (the podman analog of <code>docker login</code>) with a Personal Access Token that grants <code>write_registry</code>).</p>
  
Tags: <docker><gitlab><podman>
Title: GitLab Container Registry: errors: denied: requested access to the resource is denied [...] error parsing HTTP 401 response body
UserDisplayName: Evan Carroll
ThreadText: # GitLab Container Registry: errors: denied: requested access to the resource is denied [...] error parsing HTTP 401 response body
  
  (Asked by: username_0 on 2022-05-15)
  
  When I run `podman push` (the equiv of `docker push`) to get my image up to GitLab's container registry, I'm getting the following error.
  
  > errors: denied: requested access to the resource is denied [...] error parsing HTTP 401 response body: unexpected end of JSON input: ""
  
  You can see it all here,
  
  ```
  ❯ podman push localhost/acme-web-release registry.gitlab.com/username_0/acme-backend
  Getting image source signatures
  Error: trying to reuse blob sha256:1e05dc5a6784f6e7375fe1f73dc2b02f7d184bc53a0150daf06062dcbfde02d4 at destination: checking whether a blob sha256:1e05dc5a6784f6e7375fe1f73dc2b02f7d184bc53a0150daf06062dcbfde02d4 exists in registry.gitlab.com/username_0/acme-backend: errors:
  denied: requested access to the resource is denied
  error parsing HTTP 401 response body: unexpected end of JSON input: ""
  
  ```
  
  I've confirmed that I've `podman login` (the podman analog of `docker login`) with a Personal Access Token that grants `write_registry`).
  
  **Tags:** docker, gitlab, podman
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_0 on 2022-05-15. Score: 0 | Accepted answer
  
  A personal access token to push to the registry does not *just* require `write_registry` but **ALSO** `read_registry` or `read_api` (more general).
  
  
  ---
  
  ### Answer by username_1 on 2023-01-19. Score: 0
  
  firstly, you can just make `docker logout registry.gitlab.com`, and login again `docker login registry.gitlab.com`, it's wrong because old token have not access for new registry
  
  
  ---
  
  