Skip to content

Docker build-push-action sometimes fails due to missing tag #227

@dennisvang

Description

@dennisvang

After creating release v1.18.1 (including the tag) via the github releases web interface, the docker/build-push-action@v6 failed with

ERROR: failed to build: tag is needed when pushing to registry

However, the previous releases, e.g. v1.18.0, created in the exact same way, did succeed.

Nothing has changed in the workflow or repo config since releasing v1.18.0, and no relevant changes in the github-workflows repo.

Here's the error:

Run docker/build-push-action@v6
  with:
    context: .
    file: ./Dockerfile
    platforms: linux/amd64,linux/arm64
    push: true
    annotations: manifest:org.opencontainers.image.created=2025-11-10T12:09:10.541Z
  manifest:org.opencontainers.image.description=FAIR Data Point Client application for browsing the metadata and administration.
  manifest:org.opencontainers.image.licenses=MIT
  manifest:org.opencontainers.image.revision=2a9e0a41268d325aab7308d864f461ba5862570c
  manifest:org.opencontainers.image.source=https://github.com/FAIRDataTeam/FAIRDataPoint-client
  manifest:org.opencontainers.image.title=FAIRDataPoint-client
  manifest:org.opencontainers.image.url=https://github.com/FAIRDataTeam/FAIRDataPoint-client
  manifest:org.opencontainers.image.version=
    provenance: true
    sbom: true
    load: false
    no-cache: false
    pull: false
    github-token: ***
  env:
    DOCKER_METADATA_OUTPUT_VERSION: 
    DOCKER_METADATA_OUTPUT_TAGS: 
    DOCKER_METADATA_OUTPUT_TAG_NAMES: 
    DOCKER_METADATA_OUTPUT_LABELS: org.opencontainers.image.created=2025-11-10T12:09:10.541Z
...
Builder info
/usr/bin/docker buildx build --annotation manifest:org.opencontainers.image.created=2025-11-10T12:09:10.541Z --annotation manifest:org.opencontainers.image.description=FAIR Data Point Client application for browsing the metadata and administration. --annotation manifest:org.opencontainers.image.licenses=MIT --annotation manifest:org.opencontainers.image.revision=2a9e0a41268d325aab7308d864f461ba5862570c --annotation manifest:org.opencontainers.image.source=https://github.com/FAIRDataTeam/FAIRDataPoint-client --annotation manifest:org.opencontainers.image.title=FAIRDataPoint-client --annotation manifest:org.opencontainers.image.url=https://github.com/FAIRDataTeam/FAIRDataPoint-client --annotation manifest:org.opencontainers.image.version= --file ./Dockerfile --iidfile /home/runner/work/_temp/docker-actions-toolkit-l7kDmc/build-iidfile-b033bc43fe.txt --platform linux/amd64,linux/arm64 --attest type=provenance,builder-id=https://github.com/FAIRDataTeam/FAIRDataPoint-client/actions/runs/19230859046/attempts/2 --attest type=sbom,disabled=false --metadata-file /home/runner/work/_temp/docker-actions-toolkit-l7kDmc/build-metadata-e502067524.json --push .
ERROR: failed to build: tag is needed when pushing to registry
...

Note the empty manifest:org.opencontainers.image.version and DOCKER_METADATA_OUTPUT_VERSION etc.

The underlying problem is with the docker/metadata-action failing, because the ref is empty (see context info section below).

Run docker/metadata-action@v5
Context info
  eventName: release
  sha: 2a9e0a41268d325aab7308d864f461ba5862570c
  ref: 
  workflow: Publish to Docker Hub
  action: meta
  actor: dennisvang
  runNumber: 97
  runId: 19230859046
  commitDate: Mon Nov 10 2025 11:56:53 GMT+0000 (Coordinated Universal Time)
Processing images input
Processing tags input
Processing flavor input
Warning: No Docker image version has been generated. Check tags input.
Warning: No Docker tag has been generated. Check tags input.
...

Not sure why this is happening. Maybe there was some timing issue, causing the action to run before the tag was created?

Observations:

  • Re-running failed jobs did not help.
  • After deleting the new release (but keeping the tag), then recreating it with the (now) existing tag, the run finally succeeded.

Metadata

Metadata

Assignees

No one assigned

    Labels

    maintenanceRequired to stay in good shape

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions