Build error / manifest unknown for first docker image build

Hello there,
I’m new to drone, I installed it in link with bitbucket server private docker registry / docker auth.
The service (latest) is provided by a Docker container running on a single swarm node.
Following the documentation and google I managed to configure all links between bitbucket / drone / registry / auth.
I’m facing an issue that I think is a beginner problem:
i want to create the first image of a repository for a specific branch in the registry, of course drone cannot find the manifest for this image and the build failed.
here is the .drone.yml:
kind: pipeline
type: docker
name: service-explorer
steps:

  • name: build
    image: private_registry/ZZZ/zzz
    settings:
    repo: XXX/yyyy
    username:
    from_secret: docker_username
    password:
    from_secret: docker_password
    dockerfile: Dockerfile
    pull: if-not-exists
    when:
    branch:
    - production
    event:
    - push
    - pull_request
    image_pull_secrets:
  • dockerconfigjson

the build error message is:
service-explorer: Error response from daemon: manifest for private_registry/ZZZ/zzz:latest not found: manifest unknown: manifest unknown
if you could help understandind the problem, it would be great!
Thank you

this is likely a configuration issue which means I need to see the actual, un-redacted yaml. It would also help to see the full logs for the step.

edit also you can use markdown code fences when pasting the yaml so that it retains its formatting and spacing.

thank you for your quick reply,
for the config:
image
For the logs, it would also help me because nor the docker logs drone-server, nor in the docker logs drone-runners, i got nothing, i can do whatever you need (command lines or else)
I only see the error in the drone dashboard and the complete error is:
service-explorer: Error response from daemon: manifest for private_registry/ZZZ/zzz:latest not found: manifest unknown: manifest unknown

kind: pipeline
type: docker
name: service-explorer
steps:
  - name: build
    image: private_registry/ZZZ/zzz
    settings:
      repo: XXX/yyyy
      username:
        from_secret: docker_username
      password:
        from_secret: docker_password
      dockerfile: Dockerfile
    pull: if-not-exists
    when:
      branch:
        - production
      event:
        - push
        - pull_request
image_pull_secrets:
  - dockerconfigjson

drone server docker logs:

{"level":"info","msg":"main: internal scheduler enabled","time":"2020-08-25T13:30:53Z"}
{"interval":"24h0m0s","level":"info","msg":"starting the zombie build reaper","time":"2020-08-25T13:30:53Z"}
{"acme":false,"host":"xxx.com","level":"info","msg":"starting the http server","port":":8000","proto":"https","time":"2020-08-25T13:30:53Z","url":"https://xxx.com"}
{"interval":"30m0s","level":"info","msg":"starting the cron scheduler","time":"2020-08-25T13:30:53Z"}

drone runner logs:

time="2020-08-25T13:31:03Z" level=info msg="starting the server" addr=":3000"
time="2020-08-25T13:31:03Z" level=info msg="successfully pinged the remote server"
time="2020-08-25T13:31:03Z" level=info msg="polling the remote server" arch=amd64 capacity=2 endpoint="https://xxx.com" kind=pipeline os=linux type=docker

The error indicates that private_registry/ZZZ/zzz:latest cannot be pulled from the registry. This error comes from Docker. You can inspect your Docker daemon logs on the host machine for more details as to why Docker cannot pull your image. Ultimately it is Docker that pulls the image, not Drone.

registry logs:

time="2020-08-25T13:32:01.763618292Z" level=error msg="response completed with error" auth.user.name=YY err.code="manifest unknown" err.detail="unknown tag=latest" err.message="manifest unknown" go.version=go1.11.2 http.request.host=private_registry http.request.id=0267cf6c-fdc0-45a9-af2c-c3468b080d0b http.request.method=GET http.request.remoteaddr=xx.xx.xx.xx http.request.uri="private_registry/ZZZ/zzz/manifests/latest" http.request.useragent="docker/19.03.8 go/go1.13.8 git-commit/afacb8b7f0 kernel/5.4.0-42-generic os/linux arch/amd64 UpstreamClient(Go-http-client/1.1)" http.response.contenttype="application/json; charset=utf-8" http.response.duration="909.591µs" http.response.status=404 http.response.written=96 vars.name="ZZZ/zzz" vars.reference=latest

Docker daemon logs:

août 25 13:32:01 ns3139229 dockerd[6330]: time="2020-08-25T13:32:01.763890263Z" level=info msg="Attempting next endpoint for pull after error: manifest unknown: manifest unknown"

this error generally indicates the image does not exist locally and does not exist in the remote registry, according to stack overflow.

Ok, i can understand why drone doesn’t manage to pull image in the local cache, this is because the image doe not exists in the registry. So the question is, is there a configuration to force the creation of the first image in the registry from the build pipeline?

Ok, i can understand why drone doesn’t manage to pull image in the local cache, this is because the image doe not exists in the registry. So the question is, is there a configuration to force the creation of the first image in the registry from the build pipeline?

The image that you define in the step must be a valid image. In your sample yaml, private_registry/ZZZ/zzz:latest is a plugin that you have defined and that you want Drone to pull and run. It sounds like perhaps there is a misunderstanding here.

It looks like you are trying to build and publish a Docker image? If so, you should be using the Docker plugin as the image as shown here.

Maybe this is what you want instead?

steps:
- name: docker  
  image: plugins/docker
  settings:
    username:
      from_secret: docker_username
    password:
      from_secret: docker_password
    repo: private_registry/XXX/yyyy
    registry: private_registry

ohh, i did not understand the image configuration.
in your example, does it create the docker image from a dockerfile and push it in the registry?
that is all I want in fact

I recommend reading more about plugins to get a conceptual understanding:
https://docs.drone.io/pipeline/docker/syntax/plugins/

and more about the docker plugin here to see if it satisfies your use case:
http://plugins.drone.io/drone-plugins/drone-docker/

thank you for your precious time, have a nice day!