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

setting quarkus.rest-client.logging.body-limit=-1 result in stringoutofboundsexception #31816

Closed
maxandersen opened this issue Mar 13, 2023 · 7 comments
Labels
area/rest-client kind/bug Something isn't working

Comments

@maxandersen
Copy link
Contributor

Describe the bug

quarkus.rest-client.logging.body-limit=0 gives you empty body, tried quarkus.rest-client.logging.body-limit=-1 to try get unlimited but instead I get:

2023-03-13 17:02:40,228 ERROR [io.qua.mut.run.MutinyInfrastructure] (vert.x-eventloop-thread-2) Mutiny had to drop the following exception: java.lang.StringIndexOutOfBoundsException: begin 0, end -1, length 2830
	at java.base/java.lang.String.checkBoundsBeginEnd(String.java:4602)
	at java.base/java.lang.String.substring(String.java:2705)
	at org.jboss.resteasy.reactive.client.logging.DefaultClientLogger.bodyToString(DefaultClientLogger.java:62)
	at org.jboss.resteasy.reactive.client.logging.DefaultClientLogger.logRequest(DefaultClientLogger.java:53)
	at org.jboss.resteasy.reactive.client.handlers.ClientSendRequestHandler$2.accept(ClientSendRequestHandler.java:203)
	at org.jboss.resteasy.reactive.client.handlers.ClientSendRequestHandler$2.accept(ClientSendRequestHandler.java:114)
	at io.smallrye.context.impl.wrappers.SlowContextualConsumer.accept(SlowContextualConsumer.java:21)
	at io.smallrye.mutiny.helpers.UniCallbackSubscriber.onItem(UniCallbackSubscriber.java:73)
	at io.smallrye.mutiny.operators.uni.UniOperatorProcessor.onItem(UniOperatorProcessor.java:47)
	at io.smallrye.mutiny.operators.uni.UniOnItemTransformToUni$UniOnItemTransformToUniProcessor.onItem(UniOnItemTransformToUni.java:60)
	at org.jboss.resteasy.reactive.client.AsyncResultUni.lambda$subscribe$1(AsyncResultUni.java:35)
	at io.vertx.core.impl.future.FutureImpl$3.onSuccess(FutureImpl.java:141)
	at io.vertx.core.impl.future.FutureBase.emitSuccess(FutureBase.java:60)
	at io.vertx.core.impl.future.FutureImpl.tryComplete(FutureImpl.java:211)
	at io.vertx.core.impl.future.PromiseImpl.tryComplete(PromiseImpl.java:23)
	at io.vertx.core.http.impl.HttpClientImpl.lambda$null$5(HttpClientImpl.java:652)
	at io.vertx.core.impl.future.FutureImpl$3.onSuccess(FutureImpl.java:141)
	at io.vertx.core.impl.future.FutureBase.lambda$emitSuccess$0(FutureBase.java:54)
	at io.vertx.core.impl.EventLoopContext.execute(EventLoopContext.java:86)
	at io.vertx.core.impl.DuplicatedContext.execute(DuplicatedContext.java:163)
	at io.vertx.core.impl.future.FutureBase.emitSuccess(FutureBase.java:51)
	at io.vertx.core.impl.future.FutureImpl.addListener(FutureImpl.java:196)
	at io.vertx.core.impl.future.PromiseImpl.addListener(PromiseImpl.java:23)

I would have expected a message stating it could not be negative, return everything or keep returning empty.

not a hard non graceful fail :)

Expected behavior

No response

Actual behavior

No response

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

No response

GraalVM version (if different from Java)

No response

Quarkus version or git rev

No response

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

@maxandersen maxandersen added the kind/bug Something isn't working label Mar 13, 2023
@quarkus-bot
Copy link

quarkus-bot bot commented Mar 13, 2023

/cc @Sgitario (rest-client), @cescoffier (rest-client), @geoand (rest-client)

@cescoffier
Copy link
Member

It's a dropped exception. It means that the Mutiny pipeline reaches a state where the exception cannot ge passed downstream without violating the protocol, so it just logs it. Why we are in this state? That probably will answer why we have such an exception.

@maxandersen
Copy link
Contributor Author

we are in this state because the code assumes an integer is always positive and tries to index a string with it :)

@geoand
Copy link
Contributor

geoand commented Mar 15, 2023

Which version does this happen with?

@geoand
Copy link
Contributor

geoand commented Mar 15, 2023

Asking as #31532 should have fixed it

@geoand
Copy link
Contributor

geoand commented Mar 21, 2023

@maxandersen ^

@cescoffier
Copy link
Member

Fixed by #31532

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/rest-client kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants