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

Illegal character in authority at index 21 #3662

Open
AkashB23 opened this issue Mar 3, 2025 · 1 comment
Open

Illegal character in authority at index 21 #3662

AkashB23 opened this issue Mar 3, 2025 · 1 comment
Assignees
Labels
for/user-attention This issue needs user attention (feedback, rework, etc...)

Comments

@AkashB23
Copy link

AkashB23 commented Mar 3, 2025

Multiple services in our system that depend on either netty client or web client see an intermittent failure related to the illegal character in authority at index 21 without much information on any possible illegal character in the URL as printed in stack trace

Caused by: java.net.URISyntaxException: Illegal character in authority at index 21: http://localhost:8080/req/path
 at java.base/java.net.URI$Parser.fail(Unknown Source)
 at java.base/java.net.URI$Parser.parseAuthority(Unknown Source)
 at java.base/java.net.URI$Parser.parseHierarchical(Unknown Source)
 at java.base/java.net.URI$Parser.parse(Unknown Source)
 at java.base/java.net.URI.<init>(Unknown Source)
 at java.base/java.net.URI.create(Unknown Source)
	at reactor.netty.http.HttpOperations.resolvePath(HttpOperations.java:416)

the index 21 is next char after the port, the static string added in HttpOperations:419

from the stack, we don't see any illegal char at index 21, it's very intermittent, and not able to reproduce any thoughts on this. can it be any character that may be added internally by the netty client that's not visible in logs as many services have the same exception at the same index?

@violetagg
Copy link
Member

@AkashB23 You don't specify the Reactor Netty version, so I will comment on the latest version of HttpOperations

the index 21 is next char after the port, the static string added in HttpOperations:419

If this is the suspicious row then you can see that it is guarded by if (tempUri.charAt(0) == '/') {, so I don't see how something can be added in addition to what we have, the next call is URI.create

if (tempUri.charAt(0) == '/') {
if (tempUri.length() == 1) {
return tempUri;
}
tempUri = "http://localhost:8080" + tempUri;
}

@violetagg violetagg self-assigned this Mar 5, 2025
@violetagg violetagg added the for/user-attention This issue needs user attention (feedback, rework, etc...) label Mar 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for/user-attention This issue needs user attention (feedback, rework, etc...)
Projects
None yet
Development

No branches or pull requests

2 participants