Open kamaydeo opened 2 years ago
opening a new one since https://github.com/micronaut-projects/micronaut-security/issues/750 was closed incorrectly.
It's been 15 days and no concrete response. I am giving up and closing this issue. It seems like micronaut team is not ready yet and it's waste of time for me to give it a try. I am so happy that I didn't fully invest into this. It was just a POC to compare it against Spring and outcome is very clear.
@kamaydeo I saw you deleted the sample application. Could you upload it again?
Moreover, note many of the contributors to Micronaut were on vacation during many weeks in august. Plus we were in the middle of Micronaut 3 release.
I have also the issue on my side, with differents oauth2 authority (pingone & google on my side). This error is raised only just after startup of the app, during the first init of an oauth login.
The oauth client fetch the well-know during the first init on the application.
This files is static & deliver in micro seconds by providers.
I've tried to raise the timeout to 5 minutes without any changes.
I have the issue with last version but I have issue since 2.x at least.
Here is the stack trace :
Error instantiating bean of type [io.micronaut.security.oauth2.client.DefaultOpenIdProviderMetadata]
Message: Read Timeout
Path Taken: DefaultOpenIdProviderMetadata.openIdConfiguration(OauthClientConfiguration oauthClientConfiguration,OpenIdClientConfiguration openIdClientConfiguration,HttpClient issuerClient)
io.micronaut.context.exceptions.BeanInstantiationException: Error instantiating bean of type [io.micronaut.security.oauth2.client.DefaultOpenIdProviderMetadata]
Message: Read Timeout
Path Taken: DefaultOpenIdProviderMetadata.openIdConfiguration(OauthClientConfiguration oauthClientConfiguration,OpenIdClientConfiguration openIdClientConfiguration,HttpClient issuerClient)
at io.micronaut.context.DefaultBeanContext.doCreateBean(DefaultBeanContext.java:2363)
at io.micronaut.context.DefaultBeanContext.createAndRegisterSingletonInternal(DefaultBeanContext.java:3281)
at io.micronaut.context.DefaultBeanContext.createAndRegisterSingleton(DefaultBeanContext.java:3267)
at io.micronaut.context.DefaultBeanContext.getBeanForDefinition(DefaultBeanContext.java:2820)
at io.micronaut.context.DefaultBeanContext.getBeanInternal(DefaultBeanContext.java:2782)
at io.micronaut.context.DefaultBeanContext.getBean(DefaultBeanContext.java:1638)
at
@tchiotludo can you provide an example that reproduces the issue?
I will try but I can't reproduce the issue on my machine but I've doubt to succeed.
I was able to reproduce the issue on local with this command sudo cpulimit --pid 663800 --limit 10
but It don't seems to be relevant.
I've the feeling that the issue is mostly on docker env deployed to the cloud (limited by cpu like 2 cores). I've 95% reproduction on my env (private code), no matter when the container start (even few hours after), the first hit on /oauth/login/google
will timeout after micronaut client timeout even if the timeout is raised. Just after the first error, the second hit will work very quickly with response on few ms.
In a meantime, I have also this : https://github.com/tchiotludo/akhq/issues/914. Maybe the issue is on http client
Does configuring a separate event loop for the server help? https://docs.micronaut.io/latest/guide/#threadPools
I overestimate the 95% reproduction.
I've try few time since your message and I'm not sure about the result: Seems that when I restart the pod and hit the request, No timeout is coming. So I tried with or without the threadPools, don't see any change. But don't have reproduction at this time.
I've the feeling now, that if we start the server, don't hit the oauth login for long time (health check are in parallel and works), and try to logged after some time, the timeout is reached. When the first hit is done, no more error.
Sorry not a real reproduction for now.
I think issue #909 may be related. In trying to figure out what was going on with my #909 problem, I switched from running on micronaut-http-server-tomcat to micronaut-http-server-netty. As soon as I did that, the problem went from the auth token being attached twice to outgoing HTTP requests timing out.
Not really sure @Jim-Harrington, I'm on netty since the beginning (2.x, 3.x)
...and so was I when my #909 problem turned into the socket timeouts you're reporting here.
My turn out not to be related, but there are certainly several issues in this auto propagation stuff.
@tchiotludo Did you get any solution on how to fix it?
@vinhnx222 since latest version, I don't see anymore the error, I'm on the micronautVersion=3.10.1
Expected Behavior
HTTP Call should return successfully
Actual Behaviour
HTTP calls times out. The token is received and you can see that in the trace logs, but the chain of calls hang, and no call to bitbucket is ever made. Application goes in a strange hung state and any subsequent calls fail.
Stacktrace
Steps To Reproduce
Refer to README.md
Environment Information
Example Application
https://github.com/kamaydeo/http-oauth-client-test
Version
2.5.11