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

[Enterprise Login 20243] Unable to login to GCP with Pycharm 2024.3 #3237

Closed
tarrade opened this issue Nov 13, 2024 · 11 comments
Closed

[Enterprise Login 20243] Unable to login to GCP with Pycharm 2024.3 #3237

tarrade opened this issue Nov 13, 2024 · 11 comments

Comments

@tarrade
Copy link

tarrade commented Nov 13, 2024

Hi there,

I just moved to Pycharm local (2024.3) , Gateway(2024.3) with remote Pycharm (2024.3) and for both local and remote I cannot sign in for Gemini Code Assist and Cloud Plugin. I am able to install plugin so the connection to internet is working. I have the GCP pop up Windows as usual but on Pycharm either I see the message below or it is still asking to login:

image

I saw this message in the remote Pycharm that could be related:

2024-11-13 22:25:46,530 [ 250495] SEVERE - Projected Logger - 
[backend] com.intellij.diagnostic.PluginException: User is logged in, but no info are available [Plugin: com.google.tools.ij.aiplugin]
	at com.intellij.ide.startup.impl.StartupManagerImplKt$launchActivity$1.invokeSuspend(StartupManagerImpl.kt:502)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:608)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:873)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:763)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:750)
Caused by: [backend] java.lang.IllegalStateException: User is logged in, but no info are available
	at com.google.tools.intellij.aiplugin.oauth.AiPluginAuthenticator.getUserInfo(AiPluginAuthenticator.kt:43)
	at com.google.tools.intellij.aiplugin.oauth.AiPluginAuthenticator.updateAuthState$aiplugin_ij_platform(AiPluginAuthenticator.kt:52)
	at com.google.tools.intellij.aiplugin.oauth.AiPluginLoginService.updateAuthState(AiPluginLoginService.kt:81)
	at com.google.tools.intellij.aiplugin.oauth.AiPluginLoginService.refreshCredentials(AiPluginLoginService.kt:31)
	at com.google.tools.intellij.aiplugin.oauth.LoginActivity.execute(LoginActivity.kt:26)
	at com.intellij.ide.startup.impl.StartupManagerImplKt$launchActivity$1.invokeSuspend(StartupManagerImpl.kt:496)
	... 6 more
2024-11-13 22:25:46,535 [ 250500] SEVERE - Projected Logger - PyCharm 2024.3  Build #JBC-243.21565.199
2024-11-13 22:25:46,535 [ 250500] SEVERE - Projected Logger - JDK: 21.0.5; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o.
2024-11-13 22:25:46,536 [ 250501] SEVERE - Projected Logger - OS: Windows 11

I am using the following:

PyCharm 2024.3
Build #JBC-243.21565.199, built on November 13, 2024
Runtime version: 21.0.5+8-b631.16 amd64 (JCEF 122.1.9)
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Toolkit: sun.awt.windows.WToolkit
Windows 11.0
Controller in Remote Development
GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation
Memory: 1500M
Cores: 8
Registry:
  debugger.new.tool.window.layout=true
  ide.experimental.ui=true
  i18n.locale=
  rdclient.backend.actionHandlers=false
@tarrade
Copy link
Author

tarrade commented Nov 14, 2024

Maybe this is the main issue.

2024-11-14 08:03:26,273 [ 747007]   WARN - #com.google.cloud.tools.intellij.login.GoogleLoginService - Failure running login()
javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
	at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:130)
	at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:383)
	at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:326)
	at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:321)
	at java.base/sun.security.ssl.CertificateMessage$T13CertificateConsumer.checkServerCerts(CertificateMessage.java:1318)
	at java.base/sun.security.ssl.CertificateMessage$T13CertificateConsumer.onConsumeCertificate(CertificateMessage.java:1195)
	at java.base/sun.security.ssl.CertificateMessage$T13CertificateConsumer.consume(CertificateMessage.java:1138)
	at java.base/sun.security.ssl.SSLHandshake.consume(SSLHandshake.java:393)
	at java.base/sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:476)
	at java.base/sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:447)
	at java.base/sun.security.ssl.TransportContext.dispatch(TransportContext.java:206)
	at java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:172)
	at java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1506)
	at java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1421)
	at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:455)
	at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:426)
	at java.base/sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:586)
	at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:187)
	at java.base/sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1461)
	at java.base/sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1432)
	at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:219)
	at com.google.api.client.http.javanet.NetHttpRequest.execute(NetHttpRequest.java:113)
	at com.google.api.client.http.javanet.NetHttpRequest.execute(NetHttpRequest.java:84)
	at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1012)
	at com.google.api.client.auth.oauth2.TokenRequest.executeUnparsed(TokenRequest.java:304)
	at com.google.api.client.auth.oauth2.TokenRequest.execute(TokenRequest.java:324)
	at com.google.api.client.extensions.java6.auth.oauth2.AuthorizationCodeInstalledApp.authorize(AuthorizationCodeInstalledApp.java:115)
	at com.google.cloud.developerexperience.cloudcode.intellij.auth.GoogleLoginServiceImpl.logInWithLocalServer(GoogleLoginServiceImpl.kt:98)
	at com.google.cloud.tools.intellij.login.CloudCodeLoginService.logInWithCallback(CloudCodeLoginService.kt:86)
	at com.google.cloud.tools.intellij.login.LoginUtilsKt$logInWithProgress$1$run$logInJob$1.invokeSuspend(LoginUtils.kt:61)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
	at kotlinx.coroutines.internal.SoftLimitedDispatcher$Worker.run(SoftLimitedDispatcher.kt:125)
	at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:99)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:608)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:873)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:763)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:750)
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
	at java.base/sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:388)
	at java.base/sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:271)
	at java.base/sun.security.validator.Validator.validate(Validator.java:256)
	at java.base/sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:230)
	at java.base/sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:132)
	at java.base/sun.security.ssl.CertificateMessage$T13CertificateConsumer.checkServerCerts(CertificateMessage.java:1302)
	... 33 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
	at java.base/sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:148)
	at java.base/sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:129)
	at java.base/java.security.cert.CertPathBuilder.build(CertPathBuilder.java:297)
	at java.base/sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:383)
	... 38 more

@tarrade
Copy link
Author

tarrade commented Nov 14, 2024

If I use PyCharm 2024.2.4 with the lastest Cloud Code plugin I have no issue to sign in. So it seems to be some incompatibility between the plugin and the latest Pycharm version

@ivanporty
Copy link
Collaborator

Thanks for the report @tarrade we'll check the latest version and see if we can reproduce. Is this Cloud Code specific or also happens with GCA?

@tarrade
Copy link
Author

tarrade commented Nov 14, 2024

@ivanporty yes, it impact both Cloud Code and Gemini Code Assist sign in to GCPwith Pycharm 2024.3 on Windows 11 (I have no issue with my Mac but this is not in our entreprise setup). Thanks for looking at it.

@ivanporty
Copy link
Collaborator

we are looking but it's not easy to reproduce. You mentioned the account is setup differently when this happens? Does it happen on 2024.2?

@tarrade
Copy link
Author

tarrade commented Nov 19, 2024

I have no issue with pycharm 2024.2.4. Just do the Switch from the Same Laptop so configuration should be identical (i can see my custom Parameters with both). Thanks

@ivanporty
Copy link
Collaborator

Configuration might be identical but JVM certificates could be different - looking at the error this may be relevant. For example, https://docs.mend.io/wsk/pkix-path-building-failed-sun-security-provider-ce, talks about similar exception, and solution to add certificates for JVM. We will look into specifics of the new release JVM - there could be a change on Jetbrains side there

@tarrade
Copy link
Author

tarrade commented Nov 19, 2024

Seems that there is quite a lot of issue related to that:
https://youtrack.jetbrains.com/issues?q=SunCertPathBuilderException

I am not a Java expert. I don't have the issue with my private Windows machine. Could be related to the enterprise ROOT certificate. I will try what was suggested here:
https://youtrack.jetbrains.com/issue/IJPL-171446/Unable-to-find-valid-certification-path-to-requested-target-exception-in-Settings-Sync-when-proxy-is-used

@tarrade
Copy link
Author

tarrade commented Nov 20, 2024

Looks like the issue will be fixed in Pycharm 2024.3.1 and seems unrelated to Cloud Code plugin

@ivanporty ivanporty pinned this issue Nov 21, 2024
@ivanporty ivanporty changed the title Unable to login to GCP with Pycharm 2024.3 [Enterprise Login 20243] Unable to login to GCP with Pycharm 2024.3 Nov 21, 2024
@ivanporty
Copy link
Collaborator

Thanks for the investigation @tarrade we came to the same conclusion that it comes from JBR bundled with 2024.3, and relates to custom certificates. Please let us know if 2024.3.1 fixes it. I pinned this issue for visibility.

@tarrade
Copy link
Author

tarrade commented Nov 25, 2024

It is fixed with PyCharm 2024.3.1 RC (Professional Edition) Build #PY-243.22562.23, built on November 21, 2024

@tarrade tarrade closed this as completed Nov 25, 2024
@ivanporty ivanporty unpinned this issue Dec 10, 2024
@ivanporty ivanporty pinned this issue Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants