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

[BUG] Failing Spring startup with CosmosDB on Azure #31312

Closed
ViktorZieg opened this issue Oct 7, 2022 · 9 comments
Closed

[BUG] Failing Spring startup with CosmosDB on Azure #31312

ViktorZieg opened this issue Oct 7, 2022 · 9 comments
Labels
azure-spring-cosmos Spring cosmos related issues. Client This issue points to a problem in the data-plane of the library. Cosmos customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that

Comments

@ViktorZieg
Copy link

Describe the bug
When starting my Spring app on an Azure App Service I get a NoSuchElementException.
Application Insights shows GET /addresses/ prior to the exception

Exception or Stack Trace

Report this azure-cosmos issue to ensure it is addressed:
[ChannelHandlerContext(RntbdRequestManager#0, [id: 0xcd8ed54d, L:/***:54350 - R:***westeurope.documents.azure.com/***:17994])]
[com.azure.cosmos.implementation.directconnectivity.rntbd.RntbdRequestManager.reportIssue(RntbdRequestManager.java:957)]
[SslHandshakeCompletionEvent(SUCCESS): : java.util.NoSuchElementException: io.opentelemetry.javaagent.instrumentation.netty.common.client.NettySslInstrumentationHandler
at io.netty.channel.DefaultChannelPipeline.getContextOrDie(DefaultChannelPipeline.java:1073)
at io.netty.channel.DefaultChannelPipeline.addAfter(DefaultChannelPipeline.java:302)
at io.netty.channel.DefaultChannelPipeline.addAfter(DefaultChannelPipeline.java:290)
at com.azure.cosmos.implementation.directconnectivity.rntbd.RntbdRequestManager.userEventTriggered(RntbdRequestManager.java:396)
at io.netty.channel.AbstractChannelHandlerContext.invokeUserEventTriggered(AbstractChannelHandlerContext.java:346)
at io.netty.channel.AbstractChannelHandlerContext.invokeUserEventTriggered(AbstractChannelHandlerContext.java:332)
at io.netty.channel.AbstractChannelHandlerContext.fireUserEventTriggered(AbstractChannelHandlerContext.java:324)
at io.netty.channel.ChannelInboundHandlerAdapter.userEventTriggered(ChannelInboundHandlerAdapter.java:117)
at io.netty.handler.codec.ByteToMessageDecoder.userEventTriggered(ByteToMessageDecoder.java:368)
at io.netty.channel.AbstractChannelHandlerContext.invokeUserEventTriggered(AbstractChannelHandlerContext.java:346)
at io.netty.channel.AbstractChannelHandlerContext.invokeUserEventTriggered(AbstractChannelHandlerContext.java:332)
at io.netty.channel.AbstractChannelHandlerContext.fireUserEventTriggered(AbstractChannelHandlerContext.java:324)
at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireUserEventTriggered(CombinedChannelDuplexHandler.java:430)
at io.netty.channel.ChannelInboundHandlerAdapter.userEventTriggered(ChannelInboundHandlerAdapter.java:117)
at io.netty.handler.codec.ByteToMessageDecoder.userEventTriggered(ByteToMessageDecoder.java:368)
at io.netty.channel.CombinedChannelDuplexHandler.userEventTriggered(CombinedChannelDuplexHandler.java:241)
at io.netty.channel.AbstractChannelHandlerContext.invokeUserEventTriggered(AbstractChannelHandlerContext.java:346)
at io.netty.channel.AbstractChannelHandlerContext.invokeUserEventTriggered(AbstractChannelHandlerContext.java:332)
at io.netty.channel.AbstractChannelHandlerContext.fireUserEventTriggered(AbstractChannelHandlerContext.java:324)
at io.opentelemetry.javaagent.instrumentation.netty.common.client.NettySslInstrumentationHandler.userEventTriggered(NettySslInstrumentationHandler.java:104)
at io.netty.channel.AbstractChannelHandlerContext.invokeUserEventTriggered(AbstractChannelHandlerContext.java:346)
at io.netty.channel.AbstractChannelHandlerContext.invokeUserEventTriggered(AbstractChannelHandlerContext.java:332)
at io.netty.channel.AbstractChannelHandlerContext.fireUserEventTriggered(AbstractChannelHandlerContext.java:324)
at io.netty.handler.ssl.SslHandler.setHandshakeSuccess(SslHandler.java:1838)
at io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1360)
at io.netty.handler.ssl.SslHandler.decodeJdkCompatible(SslHandler.java:1236)
at io.netty.handler.ssl.SslHandler.decode(SslHandler.java:1285)
at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:510)
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:449)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:279)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:800)
at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:487)
at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:385)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:833)
]

Setup:

  • Spring Boot 2.7.2
  • Spring Cloud Azure 4.4.0
@ghost ghost added needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Oct 7, 2022
@joshfree joshfree added Cosmos Client This issue points to a problem in the data-plane of the library. azure-spring-cosmos Spring cosmos related issues. labels Oct 10, 2022
@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Oct 10, 2022
@ghost
Copy link

ghost commented Oct 10, 2022

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @kushagraThapar, @TheovanKraay

@yiliuTo
Copy link
Member

yiliuTo commented Oct 11, 2022

Hi @kushagraThapar could you help to take a look of this issue? Besides, @ViktorZieg could you provide which Spring Cloud Azure library you are using?

@TheovanKraay
Copy link
Member

This is not an issue in Cosmos DB or Java SDK for Cosmos DB.
Please refer also to issue: #30459.
This is a known issue in Application Insights Java agent, that was fixed in a later version of that agent software (see open-telemetry/opentelemetry-java-instrumentation#6469). Please ensure you are using the latest version of the Application Insights Java agent.

@ViktorZieg
Copy link
Author

Hi @kushagraThapar could you help to take a look of this issue? Besides, @ViktorZieg could you provide which Spring Cloud Azure library you are using?

Do you mean this?

<dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.azure.spring</groupId>
                <artifactId>spring-cloud-azure-dependencies</artifactId>
                <version>4.2.0</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

Or the dependencies of the services I am using?

@ViktorZieg
Copy link
Author

This is not an issue in Cosmos DB or Java SDK for Cosmos DB. Please refer also to issue: #30459. This is a known issue in Application Insights Java agent, that was fixed in a later version of that agent software (see open-telemetry/opentelemetry-java-instrumentation#6469). Please ensure you are using the latest version of the Application Insights Java agent.

I have looked into this issue, but I am not aware of using Application Insights Java agent. Also, I did not find any dependency related to it.

@TheovanKraay
Copy link
Member

This is not an issue in Cosmos DB or Java SDK for Cosmos DB. Please refer also to issue: #30459. This is a known issue in Application Insights Java agent, that was fixed in a later version of that agent software (see open-telemetry/opentelemetry-java-instrumentation#6469). Please ensure you are using the latest version of the Application Insights Java agent.

I have looked into this issue, but I am not aware of using Application Insights Java agent. Also, I did not find any dependency related to it.

Sorry, to be more precise, there is known issue in Application Insights Java agent, and this was also fixed in the upstream OpenTelemetry Java agent (which it appears you are using), see here: open-telemetry/opentelemetry-java-instrumentation#6469. So I believe you will need to take a later version of opentelemetry-instrumentation-api. If this does not solve your problem, please provide a sample app that reproduces the issue, and we will investigate.

@ViktorZieg
Copy link
Author

Where did you see, that I am using OpenTelemetry? I could not find it anywhere and a bit confused how to take a later version

@TheovanKraay
Copy link
Member

[SslHandshakeCompletionEvent(SUCCESS): : java.util.NoSuchElementException: io.opentelemetry.javaagent.instrumentation.netty.common.client.NettySslInstrumentationHandler

From the stack trace you included: [SslHandshakeCompletionEvent(SUCCESS): : java.util.NoSuchElementException: io.opentelemetry.javaagent.instrumentation.netty.common.client.NettySslInstrumentationHandler

Either you have the relevant dependency directly in your build, or a library that bundles it. If you do not believe you are using it, please share a sample application which reproduces this error, and we can investigate how to resolve this.

@ViktorZieg
Copy link
Author

I could not create a sample app, where this occurs. Also I could not find anything poining to opentelemetry. For now, I just downgraded to the latest working solution. I close this, because there seems to be a solution to the issue.

@github-actions github-actions bot locked and limited conversation to collaborators Apr 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
azure-spring-cosmos Spring cosmos related issues. Client This issue points to a problem in the data-plane of the library. Cosmos customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
None yet
Development

No branches or pull requests

4 participants