Skip to content

Confusing error message with no docker credential binaries in PATH: component version "<component-reference>" is invalid covers up actual errors #1560

@reshnm

Description

@reshnm

Context

OCM cli will fail with a unspecific error message when no docker credential helpers are in the PATH but a dockerConfigFile is referenced in the OCM credentials.

Version
v0.27.0

To Reproduce
Steps to reproduce the behavior:

Assume you have the following minimum OCM configuration file:

type: generic.config.ocm.software/v1
configurations:
  - type: credentials.config.ocm.software
    repositories:
      - repository:
          type: DockerConfig/v1
          dockerConfigFile: "~/.docker/config.json

The component version is ghcr.io/openmcp-project/components//github.com/openmcp-project/openmcp:v0.0.11.

The following command will work:

ocm -v get cv -o yaml ghcr.io/openmcp-project/components//github.com/openmcp-project/openmcp:v0.0.11

The following command will not work because the PATH environment variable will be empty:

PATH=""  ocm -v get cv -o yaml ghcr.io/openmcp-project/components//github.com/openmcp-project/openmcp:v0.0.11

Error: error processing "ghcr.io/openmcp-project/components//github.com/openmcp-project/openmcp:v0.0.11": invalid component version reference "ghcr.io/openmcp-project/components//github.com/openmcp-project/openmcp:v0.0.11": component version "ghcr.io/openmcp-project/components//github.com/openmcp-project/openmcp:v0.0.11" is invalid

On my system if I only include /usr/local/bin in the PATH it is working again:

PATH="/usr/local/bin" ./bin/openmcp-bootstrapper-test/ocm-cli-cache/ocm get cv -o yaml ghcr.io/openmcp-project/components//github.com/openmcp-project/openmcp:v0.0.11

This is because the /usr/local/bin directory contains the docker credential helper binaries

ls /usr/local/bin

[...] docker-credential-desktop  docker-credential-ecr-login  docker-credential-osxkeychain [...]

Actual behavior

The error message is not giving the root cause to the user but rather returns the follow-up error, which is confusing to the user:

Error: error processing "<component-reference>": invalid component version reference "<component-reference>": component version "<component-reference>" is invalid

Expected behavior

The error message should include the actual root cause of the error. Something like:

OCM credential helper failed to call docker credentials helpers because of "credentials.config.ocm.software" is referencing a dockerConfigFile.

Screenshots (optional)
If applicable, add screenshots to help explain your problem.

Environment

  • windows
  • linux
  • mac

Additional Comments
Any observation, gut feeling or other information you think help the community to troubleshoot the problem?

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/ipceiImportant Project of Common European Interestkind/tasksmall task, normally part of feature or epic

    Type

    Projects

    Status

    📋 Next-UP

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions