Repository navigation
otel-collector: drop asapauth extension, which panics at init under go 1.27 - #1369
Conversation
…o 1.27 Every otelcol-contrib invocation, --version included, exited 2: panic: crypto: RegisterHash of unknown hash function github.com/SermoDigital/jose/crypto.init.0() crypto/none.go:11 jose registers crypto.Hash(0). Go 1.27 rejects that (golang/go 5a0e0838), so the package has been broken on every arch since the go 1.27.1 bump (#758). Do what upstream did after v0.164.0 (opentelemetry-collector-releases#1742, contrib#51868): take asapauthextension out of the contrib manifest. A guard fails the build once upstream ships the change, so the patch gets dropped. Add --version and components standalone smoke tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reached
This review includes 2 billable files and costs up to $0.50.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Or wait 42 minutes for your next included review. View limit details
|
norrietaylor
left a comment
There was a problem hiding this comment.
Scope matches the title. The diff removes one manifest line in build.sh and adds two smoke tests in build.ncl. Nothing else changes. Clobber none. git log on packages/otel-collector shows the 0.164.0 bump (#1190) as the last change before this one, and the diff keeps the swiss bridge from that bump. Correctness The positive guard on line 75 anchors on the exact manifest line and its trailing space. The negative guard on line 79 is broader. Both guards fail closed. If upstream comments out the line, the first guard fails and tells the packager to drop the patch, as intended. No other package or config in the repo mentions asapauth, SermoDigital or go-asap, so the fix is local. The fix has regression tests: the new standaloneTest entries run every package init, and the PR body reports a failing negative control. The standaloneTest helper and the lowercase-first import order match packages/cpio and packages/ols. Not checked I did not build or run the tests, and I did not verify the amd64 claim. gitleaks is not installed, but the diff holds no credential-shaped strings. The change is good. One nit is below.
| # Upstream's fix comments the line out, so once a release ships without it the | ||
| # grep below fails: drop this patch then. | ||
| grep -q '^ - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/asapauthextension ' manifest.yaml || { | ||
| echo "asapauthextension is no longer enabled in the manifest: drop this patch"; exit 1; |
There was a problem hiding this comment.
nit · This guard writes its failure message to stdout. The sibling guard on line 79 and the OBI errors on lines 24-27 write to stderr. Add >&2 to make the build failure output consistent. The swiss guard on line 62 has the same omission.
| echo "asapauthextension is no longer enabled in the manifest: drop this patch"; exit 1; | |
| echo "asapauthextension is no longer enabled in the manifest: drop this patch" >&2; exit 1; |
Problem
Every
otelcol-contribinvocation,--versionincluded, exits 2 during Go package init:(That trace comes from the cached 0.164.0 artifact, run in an arm64 min session. The 2026-11-06 smoke-test sweep found it first.)
Root cause
extension/asapauthextension. That extension goes throughbitbucket.org/atlassian/go-asap/v2togithub.com/SermoDigital/jose, and jose'scrypto/none.gorunscrypto.RegisterHash(crypto.Hash(0), h)ininit().if h == 0 || h >= maxHash { panic(...) }. In Go 1.26 the check was onlyh >= maxHash.Downgrading Go isn't an option: 1.27.3 is our only non-bootstrap go.
Fix
build.sh: delete the asapauthextension line from the manifest before running ocb, which is what upstream does. The guards fail the build if the line is missing (drop the patch on the bump that already carries upstream's change) and if it is still there after the sed.build.ncl: add standalone smoke testsotelcol-contrib --versionandotelcol-contrib components. Both run every package init. They need no shell, so no test_deps.Verification (arm64, min session)
standalone tests...Fail, both testshad exit code 2.min package build --rebuild --verbose otel-collector: it compiled for real (ocbCompiling21:18, thenCompiled21:24).min check --packages otel-collectorpasses everything,standalone tests...Passincluded. In the session, the installed binary printsotelcol-contrib version 0.164.0, andcomponentslists no asapauth.🤖 Generated with Claude Code