# Registry credentials not provided. Guest mode enabled? \[solved\]

**URL:** <https://drone.discourse.group/t/registry-credentials-not-provided-guest-mode-enabled-solved/9887>\
**Category:** Drone Support\
**Created:** [January 24, 2018, 4:48am UTC](https://drone.discourse.group/t/registry-credentials-not-provided-guest-mode-enabled-solved/9887 "2018-01-24T04:48:47Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![majestic](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/majestic/32/4138_2.png) [@majestic](https://drone.discourse.group/u/majestic)\
**Post date:** [January 24, 2018, 4:48am UTC](https://drone.discourse.group/t/registry-credentials-not-provided-guest-mode-enabled-solved/9887/1 "2018-01-24T04:48:47Z")

</div>

I am having troubling passing credentials for docker hub so that I can push the built image.

Anyone have any ideas? I have tried hard encoding username: blah and password: blah into the drone.yml and this doesn’t work. I have also tried using docker\_username and docker\_password which is what the plugins/docker is expecting and still doesn’t want to play ball.

I also can confirm the secrets are present with:

```auto
$ drone secret ls example/docker-project
docker_username
Events: push, tag, deployment
Images: plugins/docker

docker_password
Events: push, tag, deployment
Images: plugins/docker

```

So what gives? why is it not detecting any creds?

I have also added it to the reg section under the repo and it still doesn’t like it. I am trying to push to [docker.io](http://docker.io).

I have tried several variants but still no success, the latest configs for _.drone.yml_ can be seen below.

```auto
pipeline:
  docker:
    image: plugins/docker
    repo: example/project
    action: build
    tags: latest

publish:
  docker:
    repo: example/project
    secrets: [docker_username, docker_password]
    when:
branch: master

```

Also tried:

```auto
pipeline:
  docker:
    image: plugins/docker
    repo: example/project
    action: build
    tags: latest

publish:
  docker:
    repo: example/project
    username: myuser
    password: mypass
    when:
branch: master

```

Can anyone spot what I am doing wrong? I would be extremely grateful if anyone could point out why this is failing. Worst case I could probably do manual docker commands to do it via script but would prefer to use the provided drone official plugin.

I am also running drone 0.8.2 which afaik is the latest stable/official release.

Regards,

Majestic

---

<div class="post-metadata">

**Author:** ![bradrydzewski](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/bradrydzewski/32/3513_2.png) [@bradrydzewski](https://drone.discourse.group/u/bradrydzewski)\
**Post date:** [January 24, 2018, 8:02am UTC](https://drone.discourse.group/t/registry-credentials-not-provided-guest-mode-enabled-solved/9887/2 "2018-01-24T08:02:38Z")

</div>

> I have tried several variants but still no success […] So what gives? why is it not detecting any creds?

None of the variants in your post use the correct syntax. The below example demonstrates the correct yaml syntax for using the docker plugin:

```auto
pipeline:
  docker:
    image: plugins/docker
    repo: octocat/hello-world
    tags: latest
    secrets: [docker_username, docker_password]

```

For more details, see [http://plugins.drone.io/drone-plugins/drone-docker/](http://plugins.drone.io/drone-plugins/drone-docker/)

---

<div class="post-metadata">

**Author:** ![majestic](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/majestic/32/4138_2.png) [@majestic](https://drone.discourse.group/u/majestic)\
**Post date:** [January 24, 2018, 8:15am UTC](https://drone.discourse.group/t/registry-credentials-not-provided-guest-mode-enabled-solved/9887/3 "2018-01-24T08:15:52Z")

</div>

Thank you.

I have tried many different configs/changes but these were the only ones I still had lying around.

The only thing I can see which is different is the tags: line but in all honestly latest should be automatically used so I cant see how this will help. Never the less I will give it a shot shortly and let you know. Thanks for the info.

The error message is quite clear that its not getting the credentials to upload the repo. This you can see at the top of the logs.

---

<div class="post-metadata">

**Author:** ![majestic](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/majestic/32/4138_2.png) [@majestic](https://drone.discourse.group/u/majestic)\
**Post date:** [January 24, 2018, 8:59am UTC](https://drone.discourse.group/t/registry-credentials-not-provided-guest-mode-enabled-solved/9887/4 "2018-01-24T08:59:20Z")

</div>

Thanks @bradrydzewski. It seems the secrets line was in the wrong place. Silly me.

I can confirm the below config is now correct/working as expected. Thanks again.

```auto
pipeline:
  docker:
    secrets: [docker_username, docker_password]
    image: plugins/docker
    repo: example/project
    action: build
    tags: latest

publish:
  docker:
    repo: docker.io/example/project
    registry: docker.io   
    when:
branch: master

```

---

<div class="post-metadata">

**Author:** ![bradrydzewski](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/bradrydzewski/32/3513_2.png) [@bradrydzewski](https://drone.discourse.group/u/bradrydzewski)\
**Post date:** [January 24, 2018, 3:23pm UTC](https://drone.discourse.group/t/registry-credentials-not-provided-guest-mode-enabled-solved/9887/5 "2018-01-24T15:23:33Z")

</div>

The `publish` section of the above yaml does not do anything, and can be removed

```auto
pipeline:
  docker:
    secrets: [docker_username, docker_password]
    image: plugins/docker
    repo: example/project
    action: build
    tags: latest

-publish:
- docker:
- repo: docker.io/example/project
- registry: docker.io   
- when:
-branch: master

```

---

<div class="post-metadata">

**Author:** ![hijak](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/hijak/32/3978_2.png) [@hijak](https://drone.discourse.group/u/hijak)\
**Post date:** [January 24, 2018, 4:32pm UTC](https://drone.discourse.group/t/registry-credentials-not-provided-guest-mode-enabled-solved/9887/6 "2018-01-24T16:32:05Z")

</div>

Hi

I am facing the same thing… im trying to build and push an arm image. The build is successful but fails on pushing

at the top of the logs i can see

`Registry credentials not provided. Guest mode enabled.`

and then when it gets to pushing

`denied: requested access to the resource is denied`

my .drone.yml is

```auto
platform: linux/arm
pipeline:
  docker:
    secrets: [docker_username, docker_password]
    image: plugins/docker:linux-arm
    repo: jcowey/dnsmasq-arm
    action: build
    tags: latest

```

my secrets list is

```auto
$ drone secret ls jack/docker-dnsmasq-arm
docker_password
Events: push, tag, deployment
SkipVerify: false
Conceal: false

docker_username
Events: push, tag, deployment
SkipVerify: false
Conceal: false

```

Im using latest docker tags for drone server and agents.  
I have configured [docker.io](http://docker.io) registry creds via the web ui

---

<div class="post-metadata">

**Author:** ![hijak](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/hijak/32/3978_2.png) [@hijak](https://drone.discourse.group/u/hijak)\
**Post date:** [January 24, 2018, 6:03pm UTC](https://drone.discourse.group/t/registry-credentials-not-provided-guest-mode-enabled-solved/9887/8 "2018-01-24T18:03:22Z")

</div>

I over came my issue by starting again 😃

here is my working yml

```auto
platform: linux/arm
pipeline:
  docker:
    image: plugins/docker:linux-arm
    action: build
    repo: jcowey/dnsmasq-arm
    secrets: [docker_username, docker_password]
    auto_tag: true
publish:
  docker:
    repo: docker.io/jcowey/dnsmasq-arm
    registry: docker.io
    when:
      branch: master

```

---

<div class="post-metadata">

**Author:** ![majestic](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/majestic/32/4138_2.png) [@majestic](https://drone.discourse.group/u/majestic)\
**Post date:** [January 24, 2018, 6:03pm UTC](https://drone.discourse.group/t/registry-credentials-not-provided-guest-mode-enabled-solved/9887/9 "2018-01-24T18:03:26Z")

</div>

Thank you very much, this is working great now. The only thing I would like to ask is, what if the git repo is different than the final docker registry?

i.e. github repo url/name: majestic/project1 but the docker hub is say bob/project1 or even a totally different project name?

How would one do this? any tips?

---

<div class="post-metadata">

**Author:** ![bradrydzewski](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/bradrydzewski/32/3513_2.png) [@bradrydzewski](https://drone.discourse.group/u/bradrydzewski)\
**Post date:** [January 24, 2018, 6:08pm UTC](https://drone.discourse.group/t/registry-credentials-not-provided-guest-mode-enabled-solved/9887/10 "2018-01-24T18:08:45Z")

</div>

> The only thing I would like to ask is, what if the git repo is different than the final docker registry?

The docker plugin does not use the git repository name in any way, so the fact that your git repository name does not match your docker repository name is not a problem.

In fact, nearly every image I publish uses a different registry name. See for example `github.com/drone-plugins/drone-slack` which publishes to `plugins/slack` in dockerhub:

> <https://github.com/drone-plugins/drone-slack/blob/master/.drone.yml#L55>

---

<div class="post-metadata">

**Author:** ![majestic](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/majestic/32/4138_2.png) [@majestic](https://drone.discourse.group/u/majestic)\
**Post date:** [January 24, 2018, 6:10pm UTC](https://drone.discourse.group/t/registry-credentials-not-provided-guest-mode-enabled-solved/9887/11 "2018-01-24T18:10:46Z")

</div>

Thats awesome, thank you for clearing that up.

Again awesome project, so much easier then Jenkins 🙂
