Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

buildx failed with: ERROR: invalid key-value pair "": empty key #1045

Closed
3 tasks done
miohtama opened this issue Feb 1, 2024 · 2 comments
Closed
3 tasks done

buildx failed with: ERROR: invalid key-value pair "": empty key #1045

miohtama opened this issue Feb 1, 2024 · 2 comments

Comments

@miohtama
Copy link

miohtama commented Feb 1, 2024

Contributing guidelines

I've found a bug, and:

  • The documentation does not mention anything about my problem
  • There are no open or closed issues that are related to my problem

Description

Today Github Actions based continuos delivery started to fail in build-and-push action with the error:

buildx failed with: ERROR: invalid key-value pair "": empty key

Nothing was changed in the system.

Expected behaviour

build-and-push does not break if nothing is changed.

Actual behaviour

build-and-push suddently stopped working with a new error message we (or no one else, for the matter) does not seem to encounter before.

Repository URL

https://github.com/tradingstrategy-ai/trade-executor/

Workflow run URL

No response

YAML workflow

- name: Build and push
        uses: docker/build-push-action@v3
        with:
          context: .
          push: true
          tags: ${{ steps.meta.outputs.tags }}
          labels: ${{ steps.meta.outputs.labels }}
          # experimental: https://github.com/docker/build-push-action/blob/master/docs/advanced/cache.md#cache-backend-api
          cache-from: type=gha
          cache-to: type=gha,mode=max
          # https://stackoverflow.com/questions/67051284/how-to-set-a-dockerfile-arg-in-github-actions
          # https://stackoverflow.com/a/63619526/315168
          build-args: |
            GIT_VERSION_TAG=${{ env.RELEASE_VERSION }}
            GIT_COMMIT_MESSAGE=${{ github.event.head_commit.message }}
            GIT_VERSION_HASH=${{ github.sha }}

Workflow logs

Run docker/build-push-action@v3
  with:
    context: .
    push: true
    tags: ghcr.io/tradingstrategy-ai/trade-executor:v446
  ghcr.io/tradingstrategy-ai/trade-executor:latest
    labels: org.opencontainers.image.created=2024-02-01T09:15:37.770Z
  org.opencontainers.image.description=A Python framework for managing positions and trades in DeFi
  org.opencontainers.image.licenses=NOASSERTION
  org.opencontainers.image.revision=ad77abef949a499c646a8eb90b65bbc3775ff58d
  org.opencontainers.image.source=https://github.com/tradingstrategy-ai/trade-executor
  org.opencontainers.image.title=trade-executor
  org.opencontainers.image.url=https://github.com/tradingstrategy-ai/trade-executor
  org.opencontainers.image.version=v446
    cache-from: type=gha
    cache-to: type=gha,mode=max
    build-args: GIT_VERSION_TAG=v446
  GIT_COMMIT_MESSAGE=add long short stats call (#768)
  
  * initial commit
  
  * fix indent
  
  ---------
  
  Co-authored-by: --global <--global>
  GIT_VERSION_HASH=ad77abef949a499c646a8eb90b65bbc3775ff58d
  
    load: false
    no-cache: false
    pull: false
    github-token: ***
  env:
    REGISTRY: ghcr.io
    DOCKER_METADATA_OUTPUT_VERSION: v446
    DOCKER_METADATA_OUTPUT_TAGS: ghcr.io/tradingstrategy-ai/trade-executor:v446
  ghcr.io/tradingstrategy-ai/trade-executor:latest
    DOCKER_METADATA_OUTPUT_LABELS: org.opencontainers.image.created=2024-02-01T09:15:37.770Z
  org.opencontainers.image.description=A Python framework for managing positions and trades in DeFi
  org.opencontainers.image.licenses=NOASSERTION
  org.opencontainers.image.revision=ad77abef949a499c646a8eb90b65bbc3775ff58d
  org.opencontainers.image.source=https://github.com/tradingstrategy-ai/trade-executor
  org.opencontainers.image.title=trade-executor
  org.opencontainers.image.url=https://github.com/tradingstrategy-ai/trade-executor
  org.opencontainers.image.version=v446
    DOCKER_METADATA_OUTPUT_JSON: {"tags":["ghcr.io/tradingstrategy-ai/trade-executor:v446","ghcr.io/tradingstrategy-ai/trade-executor:latest"],"labels":{"org.opencontainers.image.created":"2024-02-01T09:15:37.770Z","org.opencontainers.image.description":"A Python framework for managing positions and trades in DeFi","org.opencontainers.image.licenses":"NOASSERTION","org.opencontainers.image.revision":"ad77abef949a499c646a8eb90b65bbc3775ff58d","org.opencontainers.image.source":"https://github.com/tradingstrategy-ai/trade-executor","org.opencontainers.image.title":"trade-executor","org.opencontainers.image.url":"https://github.com/tradingstrategy-ai/trade-executor","org.opencontainers.image.version":"v446"}}
    DOCKER_METADATA_OUTPUT_BAKE_FILE: /tmp/docker-actions-toolkit-ay2Kb6/docker-metadata-action-bake.json
    RELEASE_VERSION: v446
GitHub Actions runtime token access controls
  [
    {
      "Scope": "refs/tags/v446",
      "Permission": 3
    },
    {
      "Scope": "refs/heads/master",
      "Permission": 1
    }
  ]
Docker info
  /usr/bin/docker version
  Client: Docker Engine - Community
   Version:           24.0.7
   API version:       1.43
   Go version:        go1.20.10
   Git commit:        afdd53b
   Built:             Thu Oct 26 09:07:41 2023
   OS/Arch:           linux/amd64
   Context:           default
  
  Server: Docker Engine - Community
   Engine:
    Version:          24.0.7
    API version:      1.43 (minimum version 1.12)
    Go version:       go1.20.10
    Git commit:       311b9ff
    Built:            Thu Oct 26 09:07:41 2023
    OS/Arch:          linux/amd64
    Experimental:     false
   containerd:
    Version:          1.6.27
    GitCommit:        a1496014c916f9e62104b33d1bb5bd03b0858e59
   runc:
    Version:          1.1.11
    GitCommit:        v1.1.11-0-g4bccb38
   docker-init:
    Version:          0.19.0
    GitCommit:        de40ad0
  /usr/bin/docker info
  Client: Docker Engine - Community
   Version:    24.0.7
   Context:    default
   Debug Mode: false
   Plugins:
    buildx: Docker Buildx (Docker Inc.)
      Version:  v0.12.1
      Path:     /usr/libexec/docker/cli-plugins/docker-buildx
    compose: Docker Compose (Docker Inc.)
      Version:  v2.23.3
      Path:     /usr/libexec/docker/cli-plugins/docker-compose
  
  Server:
   Containers: 1
    Running: 1
    Paused: 0
    Stopped: 0
   Images: 15
   Server Version: 24.0.7
   Storage Driver: overlay2
    Backing Filesystem: extfs
    Supports d_type: true
    Using metacopy: false
    Native Overlay Diff: false
    userxattr: false
   Logging Driver: json-file
   Cgroup Driver: cgroupfs
   Cgroup Version: 2
   Plugins:
    Volume: local
    Network: bridge host ipvlan macvlan null overlay
    Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
   Swarm: inactive
   Runtimes: io.containerd.runc.v2 runc
   Default Runtime: runc
   Init Binary: docker-init
   containerd version: a1496014c916f9e62104b33d1bb5bd03b0858e59
   runc version: v1.1.11-0-g4bccb38
   init version: de40ad0
   Security Options:
    apparmor
    seccomp
     Profile: builtin
    cgroupns
   Kernel Version: 6.2.0-1019-azure
   Operating System: Ubuntu 22.04.3 LTS
   OSType: linux
   Architecture: x86_64
   CPUs: 4
   Total Memory: 15.61GiB
   Name: fv-az1542-566
   ID: 8abab386-ee6f-4a46-817c-c1639873e713
   Docker Root Dir: /var/lib/docker
   Debug Mode: false
   Username: githubactions
   Experimental: false
   Insecure Registries:
    127.0.0.0/8
   Live Restore Enabled: false
  
Buildx version
  /usr/bin/docker buildx version
  github.com/docker/buildx v0.12.1 30feaa1
/usr/bin/docker buildx build --build-arg GIT_VERSION_TAG=v446 --build-arg GIT_COMMIT_MESSAGE=add long short stats call (#768) --build-arg * initial commit --build-arg  --build-arg * fix indent --build-arg  --build-arg --------- --build-arg  --build-arg Co-authored-by: --global <--global> --build-arg GIT_VERSION_HASH=ad77abef949a499c646a8eb90b65bbc3775ff58d --cache-from type=gha --cache-to type=gha,mode=max --iidfile /tmp/docker-build-push-C0Kqxn/iidfile --label org.opencontainers.image.created=2024-02-01T09:15:37.770Z --label org.opencontainers.image.description=A Python framework for managing positions and trades in DeFi --label org.opencontainers.image.licenses=NOASSERTION --label org.opencontainers.image.revision=ad77abef949a499c646a8eb90b65bbc3775ff58d --label org.opencontainers.image.source=https://github.com/tradingstrategy-ai/trade-executor --label org.opencontainers.image.title=trade-executor --label org.opencontainers.image.url=https://github.com/tradingstrategy-ai/trade-executor --label org.opencontainers.image.version=v446 --provenance false --tag ghcr.io/tradingstrategy-ai/trade-executor:v446 --tag ghcr.io/tradingstrategy-ai/trade-executor:latest --metadata-file /tmp/docker-build-push-C0Kqxn/metadata-file --push .
ERROR: invalid key-value pair "": empty key
Error: buildx failed with: ERROR: invalid key-value pair "": empty key

BuildKit logs

No response

Additional info

After clearing Github Actions caches the issue seemed to fix itself. Not sure if the issue was related to Github Actions caching, or a random fluke.

Any case I am leaving this issue report here, so if anyone encounters the error message again they have some information in hand.

@miohtama
Copy link
Author

miohtama commented Feb 1, 2024

Closing as the issue was appeareing randomly and it fixed itself.

@miohtama miohtama closed this as completed Feb 1, 2024
@miohtama
Copy link
Author

miohtama commented Apr 2, 2024

My nemesis is back.

It was related to passing environment variables (commit message) from Github Actions to buildx which then passed them to --build-arg where it crashed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant