You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
crash-diagnostics v0.4.3 directly requires github.com/kcp-dev/kcp/cli v0.27.1 and github.com/kcp-dev/kcp/sdk v0.27.1.
The kcp project is a mono-repo where kcp/cli's go.mod uses a local path replace:
// in github.com/kcp-dev/kcp/cli@v0.27.1 go.modrequiregithub.com/kcp-dev/kcp/sdkv0.0.0-00010101000000-000000000000replacegithub.com/kcp-dev/kcp/sdk=> ../sdk
Go module replace directives only apply to the main module and do not propagate to consumers. When Go resolves kcp/cli's go.mod transitively, it sees the phantom v0.0.0-00010101000000-000000000000 version, which does not exist on any registry.
When crash-diagnostics is the main module (or a direct dependency where MVS resolves kcp/sdk to v0.27.1 first), this works. But when crash-diagnostics is a transitive dependency (e.g., my-project → velero → crash-diagnostics), the Go toolchain tries to validate the phantom version and fails.
Impact
Every downstream consumer that depends on crash-diagnostics transitively must add a workaround in their own go.mod.
Workaround
Use exclude in the consumer's go.mod to skip the phantom version — MVS then picks up v0.27.1 from the other requirements:
// workaround for https://github.com/vmware-tanzu/crash-diagnostics/issues/283excludegithub.com/kcp-dev/kcp/sdkv0.0.0-00010101000000-000000000000
This is cleaner than a replace directive since the phantom version literally doesn't exist.
Suggested Fix
This is ultimately a kcp mono-repo issue, but crash-diagnostics could mitigate it by either:
Adding an exclude directive for the phantom version in crash-diagnostics' go.mod
Evaluating whether the kcp/cli and kcp/sdk dependencies are still needed, and removing them if not
Opening an upstream issue on kcp-dev/kcp to publish proper go.mod files for their sub-modules
Reproduction
go mod init example.com/test
go get github.com/vmware-tanzu/crash-diagnostics@v0.4.3
go mod tidy # fails with the error above when crash-diagnostics is not the only dependency
Problem
Downstream consumers of
crash-diagnosticsthat depend on it transitively (not as the main module) get ago mod tidyfailure:Root Cause
crash-diagnosticsv0.4.3 directly requiresmygithub.libinneed.workers.dev/kcp-dev/kcp/cli v0.27.1andmygithub.libinneed.workers.dev/kcp-dev/kcp/sdk v0.27.1.The
kcpproject is a mono-repo wherekcp/cli's go.mod uses a local path replace:Go module
replacedirectives only apply to the main module and do not propagate to consumers. When Go resolveskcp/cli's go.mod transitively, it sees the phantomv0.0.0-00010101000000-000000000000version, which does not exist on any registry.When
crash-diagnosticsis the main module (or a direct dependency where MVS resolveskcp/sdkto v0.27.1 first), this works. But whencrash-diagnosticsis a transitive dependency (e.g.,my-project → velero → crash-diagnostics), the Go toolchain tries to validate the phantom version and fails.Impact
Every downstream consumer that depends on
crash-diagnosticstransitively must add a workaround in their own go.mod.Workaround
Use
excludein the consumer's go.mod to skip the phantom version — MVS then picks upv0.27.1from the other requirements:This is cleaner than a
replacedirective since the phantom version literally doesn't exist.Suggested Fix
This is ultimately a
kcpmono-repo issue, butcrash-diagnosticscould mitigate it by either:excludedirective for the phantom version in crash-diagnostics' go.modkcp/cliandkcp/sdkdependencies are still needed, and removing them if notReproduction
go mod init example.com/test go get github.com/vmware-tanzu/crash-diagnostics@v0.4.3 go mod tidy # fails with the error above when crash-diagnostics is not the only dependencyNote
Responses generated with Claude