<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>

CC BY-SA 4.0
2022-05-15T06:56:21.760Z
2022-05-15T06:56:21.760Z
Evan Carroll
<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>

CC BY-SA 4.0
2023-01-19T15:09:58.580Z
2023-01-19T15:09:58.580Z
Constantin Karataev
<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>

<docker><gitlab><podman>
GitLab Container Registry: errors: denied: requested access to the resource is denied [...] error parsing HTTP 401 response body
Evan Carroll
# 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/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: ""

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


---

