Codium-ai / codiumai-jetbrains-release

56 stars 7 forks source link

PyCharm Pro stuck "Closing project" with Codiumate plugin installed #207

Closed wgordon17 closed 3 months ago

wgordon17 commented 3 months ago
PyCharm 2023.3.4 (Professional Edition)
Build #PY-233.14475.56, built on February 25, 2024
Runtime version: 17.0.10+1-b1087.17 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 14.4
GC: G1 Young Generation, G1 Old Generation
Memory: 2048M
Cores: 10
Metal Rendering is ON
Registry:
  debugger.new.tool.window.layout=true
  ide.experimental.ui=true
Non-Bundled Plugins:
  codiumai.codiumai (0.7.24)

Reproducable regardless of what project is opened. If no projects are active, it obviously doesn't happen.

No background tasks in progress (that I can tell).

image

ArtsiomCh commented 3 months ago

Hi @wgordon17 ! Thanks for reporting. I can't reproduce the issue with current PyCharm Pro 2023.3.5 and 0.7.26 plugin version. Any project opens and closes normally with plugin installed. Do you still experience the issue? If so, could you please send me (artsiom.c@codium.ai) your idea.log after reproducing the issue?

wgordon17 commented 3 months ago

@ArtsiomCh awesome, thanks for the pointer! So, looking at logs, it looks like PyCharm is stuck with the plugin repeatedly trying to authenticate

2024-03-23 11:26:35,154 [  26272]   WARN - #ai.codium.net.CodiumNetworkClient - Failed to execute `https://securetoken.googleapis.com/v1/token` call (attempt 10/10): {
  "error": {
    "code": 400,
    "message": "TOKEN_EXPIRED",
    "status": "INVALID_ARGUMENT"
  }
}

I can't figure out why this token expired, or how I can renew it. Is it as simple as uninstalling the plugin and reinstalling? Or is there something else I should do?

wgordon17 commented 3 months ago

Well, looks like the uninstall/reinstall dance didn't help 😞

ArtsiomCh commented 3 months ago

Authentication should not prevent ide closing. Also it should be only 10 retry. Token expired means the way you used to auth to the plugin is not valid anymore. You should see prompt to relogin in any of plugin toolwindow. Or you can initiate it manually by selection of Sign off in plugin status bar widget (see CodiumAI logo in right bottom corner)

wgordon17 commented 3 months ago

Hi @ArtsiomCh Not seeing any prompt, for whatever reason ¯_(ツ)_/¯ Here's a screenshot of my IDE window

image

I also previously had the New UI enabled, turned that off to go back to the Old UI (pictured above) and still wasn't seeing anywhere I could Sign off or Log in

wgordon17 commented 3 months ago

Here's a bigger export of my idea.log content. You'll see all of the token attempts have attempt 10/10, so it doesn't seem to be respecting that it only tries 10 times ¯_(ツ)_/¯

wgordon17 commented 3 months ago

idea.log

(Forgot to attach 🤦‍♂️)

ArtsiomCh commented 3 months ago

@wgordon17 you're right about endless retry, we accidently stack on 10 counter and keep it forever... will be fixed next release But that retry should not prevent ide closure. Just tested that scenario and IDE closed correctly... Will dive deeper into your log. Regarding Sign Off, seems like you have hidden/disabled CodiumAI status bar widget. Please enable it and you'll be able to log out and login in again. image image image

ArtsiomCh commented 3 months ago

@wgordon17 reproduced the issue Indeed our check inside retry for project/IDE closure is incorrect. Will be fixed in next release as well. Many Thanks for reporting and helping to investigate!

wgordon17 commented 3 months ago

So, I was definitely in some weird state where the plugin thought I was logged in already. I managed to unhide the widget (didn't even know I could do that 😅), and logged in. Quit after logging in, and I was getting the same "stuck" issue.

But after I reopened, I then logged out, and logged back in again...quick PyCharm, and success! 🙌 Thanks for the help!

ArtsiomCh commented 3 months ago

fixed in 0.7.27