Drone 0.8 Failed to store the registry credentilas

Hi Team,

We are facing issue with storing gitlab registry credentials in Drone UI. Below is the docker compose file.

version: ‘2’

services:
drone-server:
image: drone/drone:0.8

ports:
  - 80:8000
  - 9000
volumes:
  - /var/lib/drone:/var/lib/drone/
  - /etc/bitbucket/key.pem:/etc/bitbucket/key.pem
restart: always
environment:
  - DRONE_OPEN=true
  - DRONE_ADMIN=a,b,c,d
  - DRONE_HOST=http://xxxxxx.xxxxxxx.com
  - DRONE_STASH=true
  - DRONE_STASH_GIT_USERNAME=ssssssss
  - DRONE_STASH_GIT_PASSWORD=xxxxxxxxx

- DRONE_STASH_GIT_USERNAME=username

- DRONE_STASH_GIT_PASSWORD=password

  - DRONE_STASH_CONSUMER_KEY=key
  - DRONE_STASH_CONSUMER_RSA=/etc/bitbucket/key.pem
  - DRONE_STASH_URL=http://xxxx.xxxxxx.xx.x..xx.
  - DRONE_SECRET=FkvtMPK0FHADOIsPaQvTGccdfefccgddfD2JFkJEffgMjak6uQqJxKmv3HGD99L5xaz
  - DRONE_HOOK=http://ccvvvv.vvccc/hook

drone-agent:
image: drone/agent

command: agent
restart: always
depends_on:
  - drone-server
volumes:
  - /var/run/docker.sock:/var/run/docker.sock
environment:
  - DRONE_SERVER=drone-server:9000
  - DRONE_SECRET=FkvtMPK0FHADOIsPaQvTGddfggdgghhtfhhrfgggffggg2JFkJEffgMjak6uQqJxKmv3HGD99L5xaz

Please help in this issue.

Thanks
Sravan

@sravan1265 there are no known issues with saving registry credentials, so we would need more details to further advise (example: server logs, error message in browser console, etc). Also is this related to this existing thread: Unable to push docker images to GitLab private registry throwing Denied: access forbidden ?

Also please note the difference between registry credentials and secrets. Registry credentials are only used to pull private images defined in the image: attribute in your yaml. For example, we would use registry credentials to pull the below image:

pipeline:
  build:
+   image: registry.company.com/some-image

However, if you need to reference these credentials inside your pipeline (e.g. in your script) you need to use secrets:

pipeline:
  build:
    image: docker
    commands:
      - docker build
      - docker login -u $REGISTRY_USERNAME -p $REGISTRY_PASSWORD https://gitlab.xxxxxxxx.com/
      - docker push ....
+   secrets: [ REGISTRY_USERNAME, REGISTRY_PASSWORD ]

Reference documentation:

Hi Brad,

Thanks for the quick response, I understood with the storing registry crendentials in the Drone UI and i am clear with the difference between registry credentials and secrets.
I have fixed the issue for now.
My main issue is with “Unable to push docker images to GitLab private registry throwing Denied: access forbidden”.
can you please help me in this issue.

Thnaks
Sravan

Hi @sravan1265, triaging issues with the docker login and docker push commands are outside the scope of support I provide in this forum, since they do not appear to be directly related to the underlying Drone software. If you are having difficulty with these commands, or the GitLab registry, you might be better serviced by engaging GitLab or Docker support.