Skip to content

otel-collector: drop asapauth extension, which panics at init under go 1.27 - #1369

Merged
bryan-minimal merged 1 commit into
mainfrom
fix/otel-collector-registerhash
Nov 7, 2026
Merged

bryan-minimal merged 1 commit into
mainfrom
fix/otel-collector-registerhash

Conversation

@bryan-minimal

Copy link
Copy Markdown
Member

Problem

Every otelcol-contrib invocation, --version included, exits 2 during Go package init:

panic: crypto: RegisterHash of unknown hash function

goroutine 1 [running]:
crypto.RegisterHash(...)
	crypto/crypto.go:158
github.com/SermoDigital/jose/crypto.init.0()
	github.com/SermoDigital/jose@v0.9.2-0.20180104203859-803625baeddc/crypto/none.go:11 +0x30

(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

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.
  • The asapauth extension is no longer in our otelcol-contrib. The next upstream release drops it too.
  • build.ncl: add standalone smoke tests otelcol-contrib --version and otelcol-contrib components. Both run every package init. They need no shell, so no test_deps.

Verification (arm64, min session)

  • Negative control: the old build.sh plus the new tests on the cached 0.164.0 artifact. standalone tests...Fail, both tests had exit code 2.
  • Fixed recipe, min package build --rebuild --verbose otel-collector: it compiled for real (ocb Compiling 21:18, then Compiled 21:24). min check --packages otel-collector passes everything, standalone tests...Pass included. In the session, the installed binary prints otelcol-contrib version 0.164.0, and components lists no asapauth.
  • Not verified on amd64. The cause doesn't depend on arch (same go 1.27.3, same manifest), so amd64 should break the same way and be fixed the same way.

🤖 Generated with Claude Code

…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>
@bryan-minimal
bryan-minimal requested a review from a team as a code owner November 6, 2026 21:24
@coderabbitai

coderabbitai Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

  • Run on-demand review

This review includes 2 billable files and costs up to $0.50.

  • Ask an admin to make reviews automatic

Open in CodeRabbit

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.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 65 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 7a198f0 and 4a9b79e.

Files selected for processing: 2

  • packages/otel-collector/build.ncl
  • packages/otel-collector/build.sh
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@norrietaylor norrietaylor left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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;

@bryan-minimal
bryan-minimal added this pull request to the merge queue Nov 7, 2026
Merged via the queue into main with commit f76579f Nov 7, 2026
15 checks passed
@bryan-minimal
bryan-minimal deleted the fix/otel-collector-registerhash branch November 7, 2026 23:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants