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

gRPC OpenTelemetry can't take IPv6 endpoints #3114

Closed
tjcw opened this issue Oct 30, 2024 · 3 comments
Closed

gRPC OpenTelemetry can't take IPv6 endpoints #3114

tjcw opened this issue Oct 30, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@tjcw
Copy link
Contributor

tjcw commented Oct 30, 2024

If you specify a server to OpenTelemetry as an IPv6 address, you get a parsing error. IPv6 servers specified by DNS name work fine, and IPv4 servers specified either by address or by DNS name work fine as well.
Describe your environment
OS: RHEL8

Steps to reproduce
exporterOtlpGrpcEndpoint: '[2620:1f7:298e:a014::2:136]:4317'

E1014 08:39:23.729563510 34187 grpc_ares_wrapper.cc:910] Failed to parse [2620:1 to host:port while attempting to resolve as ip literal.
2024-10-14 08:39:23.730764: BIP9570E: OpenTelemetry error: '[OTLP TRACE GRPC Exporter] Export() failed with status_code: "UNAVAILABLE" error_message: "DNS resolution failed for [2620:1: unparseable host:port"' - '[]'.
E1014 08:39:24.731289659 34183 grpc_ares_wrapper.cc:910] Failed to parse [2620:1 to host:port while attempting to resolve as ip literal.
E1014 08:39:26.221792529 34183 grpc_ares_wrapper.cc:910] Failed to parse [2620:1 to host:port while attempting to resolve as ip literal.
E1014 08:39:29.227147178 34183 grpc_ares_wrapper.cc:910] Failed to parse [2620:1 to host:port while attempting to resolve as ip literal.
E1014 08:39:34.000113217 34183 grpc_ares_wrapper.cc:910] Failed to parse [2620:1 to host:port while attempting to resolve as ip literal.
E1014 08:39:39.460472916 34183 grpc_ares_wrapper.cc:910] Failed to parse [2620:1 to host:port while attempting to resolve as ip literal.

Also fails to take HTTP IPv6 endpoint:
exporterOtlpHttpUrl: 'http://[2620:1f7:298e:a014::2:136]:4318/v1/traces'

2024-10-14 08:51:16.002504: BIP9570E: OpenTelemetry error: '[OTLP HTTP Client] Session state: connection failed.URL rejected: Bad IPv6 address' - '[]'.
2024-10-14 08:51:16.003609: BIP9570E: OpenTelemetry error: '[OTLP HTTP Client] ERROR: Export 1 trace span(s) error: 1' - '[]'.

2024-10-14 08:51:16.003227 34501 ImbOpenTelemetryDebugLog::Handle file:/build/jenkins_swg/slot0/product-build/WMB/src/DataFlowEngine/OpenTelemetry/lib/ImbOpenTelemetryDebugLog.cpp line:79 message:9570.BIPmsgs, 'Error from open telemetry logging', '[OTLP HTTP Client] Session state: connection failed.URL rejected: Bad IPv6 address', '[]'
2024-10-14 08:51:16.003227 34501 Error BIP9570E: OpenTelemetry error: '[OTLP HTTP Client] Session state: connection failed.URL rejected: Bad IPv6 address' - '[]'.
Describe exactly how to reproduce the error. Include a code sample if applicable.

What is the expected behavior?

What did you expect to see?
Connection to the specified server
What is the actual behavior?
What did you see instead?
Parse error messages
Additional context

@tjcw tjcw added the bug Something isn't working label Oct 30, 2024
@github-actions github-actions bot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Oct 30, 2024
@tjcw
Copy link
Contributor Author

tjcw commented Oct 30, 2024

There are C++ functions available as part of boost::url https://www.boost.org/ which will parse a string to determine whether it represents an IPv6 address and (if so) what the address is.

This issue was first raised against the opentelemetry-collector repository, and got the following comment :

This error seems to be coming from the C++ SDK (

OTEL_INTERNAL_LOG_ERROR("[OTLP TRACE GRPC Exporter] Export() failed with status_code: \""
).

@marcalff
Copy link
Member

marcalff commented Oct 30, 2024

Thanks for the report.

File grpc_ares_wrapper.cc is in the grpc library itself.

Which version of grpc is used here ?

[edit]

Somehow the host:port given to grpc is truncated to [2620:1, so this could be a bug in opentelemetry-cpp passing the wrong data.

Please clarify which version of opentelemetry-cpp is used.

Looks related to:

@tjcw
Copy link
Contributor Author

tjcw commented Oct 30, 2024

I am using a binary tarball of opentelemetry with file timestamps of 18 March 2024.
This issue looks to be a duplicate of #3073, which is fixed; I will retry with more recent source code.

@tjcw tjcw closed this as completed Oct 30, 2024
@marcalff marcalff removed the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants