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

[docker_observer]: Potential issue with image regex #36239

Closed
odvarkadaniel opened this issue Nov 6, 2024 · 2 comments · Fixed by #37045
Closed

[docker_observer]: Potential issue with image regex #36239

odvarkadaniel opened this issue Nov 6, 2024 · 2 comments · Fixed by #37045
Labels

Comments

@odvarkadaniel
Copy link

Component(s)

extension/observer/dockerobserver

What happened?

Description

We are seeing errors regaring image parsing in the otelcol binary.

otelcol[4045]: 2024-09-30T14:16:04.962Z	error	[email protected]/extension.go:169	could not parse container image name	{"kind": "extension", "name": "docker_observer", "error": "failed to match regex against image"}

Steps to Reproduce

Have an image running on a node with the sha256 part not being only numbers, but e.g. <repository>:<path>@sha256:07faaa0588009ace...
The regex expects the sha256 part to contain numbers only.
What are the reasons behind the sha256 digest regex part accepting only digits?

Expected Result

Not fail the config.image parsing.

Actual Result

Error as mentioned above.

Collector version

v0.103.0

Environment information

Environment

OS: Ubuntu 22.04.5 LTS

OpenTelemetry Collector configuration

No response

Log output

No response

Additional context

No response

@odvarkadaniel odvarkadaniel added bug Something isn't working needs triage New item requiring triage labels Nov 6, 2024
Copy link
Contributor

github-actions bot commented Nov 6, 2024

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@rogercoll
Copy link
Contributor

rogercoll commented Nov 8, 2024

I reported a very similar issue for the k8s_cluster receiver, I guess it applies to all receivers using the internal/common/docker package: #36279

@TylerHelmuth TylerHelmuth removed the needs triage New item requiring triage label Jan 6, 2025
andrzej-stencel pushed a commit that referenced this issue Jan 7, 2025
#### Description
Fix the regex used to match docker SHA256.

#### Link to tracking issue
Fix #36239

#### Testing
Local run of `make` at `internal/docker` - caveat: if some other test
code depending on this may fail if it is not using a SHA256 with exactly
64 chars it will be broken by this change. I will add any test fix for
any such case detected via CI.

#### Documentation
N/A
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants