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: Open in sourcegraph (enterprise) not working with multiple errors #252

Closed
rrosenblum-splunk opened this issue Jan 5, 2024 · 11 comments · Fixed by #325
Closed

bug: Open in sourcegraph (enterprise) not working with multiple errors #252

rrosenblum-splunk opened this issue Jan 5, 2024 · 11 comments · Fixed by #325
Labels
bug Something isn't working

Comments

@rrosenblum-splunk
Copy link

rrosenblum-splunk commented Jan 5, 2024

Installation Information

IntelliJ IDEA 2023.2.5 (Ultimate Edition)
Build #IU-232.10227.8, built on November 9, 2023
Licensed to
Expiration date:
Runtime version: 17.0.9+7-b1000.46 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 13.6.3
GC: G1 Young Generation, G1 Old Generation
Memory: 2048M
Cores: 16
Metal Rendering is ON
Registry:
debugger.new.tool.window.layout=true
ide.experimental.ui=true

Non-Bundled Plugins:
some.awesome (1.14)
com.github.catppuccin.jetbrains (3.2.2)
name.kropp.intellij.makefile (232.8660.88)
org.jetbrains.plugins.ruby (232.10203.2)
PMDPlugin (1.8.28)
google-java-format (1.17.0.0)
org.jetbrains.jumpToLine (0.1.14)
thrift-syntax-fork (1.6.0)
com.intellij.guice (232.8660.142)
com.jetbrains.packagesearch.intellij-plugin (232.9921.28)
com.github.camork.fileExpander (2.3)
MavenRunHelper (4.27.1-IJ2022.2)
Pythonid (232.10227.8)
ru.meanmail.plugin.requirements (2022.4.1)
com.sourcegraph.jetbrains (5.2.15221)

Kotlin: 232-1.9.0-IJ10227.8

Describe the bug

The plugin worked fine for several months and then seemingly stopped working out of nowhere a couple of months ago. These errors happen on all of my repos

When it first stopped working, I received 2 errors:

Error determining repository info: Failed to convert git clone URL to codebase name for cloneURL
and
The file is not under version control that your IDE + this plugin supports. The plugin currently only supports Git and Perforce. For the IDE part, make sure you have the Git or Perforce plugin (whichever you need) installed. If you are seeing this error for a supported VCS with the plugin installed, please reach out to [support@sourcegraph.com](mailto:support@sourcegraph.com).

Other people on my team/org have not had the same issue, so I tried generating new tokens. When that did not work, I uninstalled and reinstalled the soursegraph plugin. After reinstall, I get the following 2 errors

The file is not under version control that your IDE + this plugin supports ... and Error determining repository info: java.lang.NullPointerException: Cannot invoke "com.sourcegraph.cody.agent.CodyAgentServer.convertGitCloneURLToCodebaseName(com.sourcegraph.cody.agent.protocol.CloneURL)" because "server" is null.

The server is set in Authentication to https://sourcegraph.<redacted>.net/.

git remote -v
origin  git@cd.<redacted>.com:<path1>/<path2>/<project>.git

Expected behavior

Interacting with the sourcegraph plugin (open selection in sourcegraph web, copy file link, search) should all work without error

Additional context (logs, images, etc)

No response

@rrosenblum-splunk rrosenblum-splunk added the bug Something isn't working label Jan 5, 2024
@taylorsperry
Copy link
Contributor

Thank you for reporting, @rrosenblum-splunk! We're aware of a few stability issues that we're working to fix. I'm marking as P0 to make sure this one is prioritized.

@mkondratek
Copy link
Contributor

Hello @rrosenblum-splunk 👋 I am sorry you experienced the issues.

I tried to reproduce this issue on the latest stable release (5.2.18630). It works for me. Could you please double-check if it still occurs to you?

@mkondratek
Copy link
Contributor

I just managed to see your error! I assume that you have Cody disabled. You can reenable it and retry:

image

"Open in sourcegraph" functionality should work without Cody so this is an issue for us.

@rrosenblum-splunk
Copy link
Author

Hello @mkondratek, I updated to the latest version of IntelliJ (#IU-233.13135.103) and the sourcegraph plugin (5.2.18630), and I am still running into the same errors about the file not being under version control and failing to convert the git clone URL. The error about server not being configured appears to have gone away. Cody was enabled, so I tried disabling and enabling it and ran into the errors in both states.

With Cody disabled, I get the errors for file not under version control and Error determining repository info: org.eclipse.lsp4j.jsonrpc.JsonRpcException: java.io.IOException: Stream closed

With Cody enabled, I get the errors for file not under version control and error determining repository info.

I'm not overly surprised that you ran into trouble trying to reproduce the issue. I'm not aware of anyone else at my organization that has run into these issues. It's starting to seem like there might be something specific to my setup that is causing the issue.

@mkondratek
Copy link
Contributor

Hello @rrosenblum-splunk, thanks for the quick response and the details. I found the root cause in the meantime 😅 I have a PR with the fix!

The fix will be available in the next stable release (we hope to have it within the next 5 days). I know it's been a while already but I must ask you for more patience 🙏

@rrosenblum-splunk
Copy link
Author

@mkondratek that is amazing! I was not expecting such a quick response. I will be keeping an eye out for an update. If it isn't overly difficult, is it possible for me to access a beta build or build from source to help test out the fix? If not, 5 days is not a bad wait

In the mean time I had tried uninstalling the sourcegraph plugin, manually deleting the sourcegraph and cody configs, and then reinstalling the sourcegraph plugin, and I am still running into the same issues. My next plan was to fully uninstall and reinstall IntelliJ, however I've been resisting this because of the time commitment to get everything reconfigured.

@mkondratek
Copy link
Contributor

We have a nightly channel (you can find it in JetBrains Marketplace or switch it from the Cody settings - however, you may need to restart your IDE to see the notification; that experience must be improved).

I cannot tell you precisely when the new nightly will be released. I am going to ping you here when the time comes.

@rrosenblum-splunk
Copy link
Author

Awesome, sounds good, and thank you!

mkondratek added a commit that referenced this issue Jan 22, 2024
Fixes #252.
Fixes #162.
Fixes #324.

## Test plan
- [x] test Sourcegraph actions with Cody **enabled**
- [x] test Sourcegraph actions with Cody **disabled**
@mkondratek
Copy link
Contributor

@rrosenblum-splunk, I want to inform you that a new nightly release is out! 🚀

https://plugins.jetbrains.com/plugin/9682-sourcegraph-cody--code-search/versions/nightly

Please note that since that's a nightly release the plugin may be a bit unstable (esp in the scope of the new features; the stability of the old features should be improved now) ⛵

We expect to release the stable on Monday (so it will be available on Wednesday next week - there is 48h delay for stable releases) 🤞

If you notice something working incorrectly feel free to ping us here or open a new issue 😃

@rrosenblum-splunk
Copy link
Author

@mkondratek I had some time to test out the nightly build, and I have some feedback.

Nightly: 5.2.20247-nightly
Search Selection on Sourcegraph Web and Search Selection in Repository on Sourcegraph Web are both working (selection opens in browser), however they both produce the error Error determining repository info: no protocol: git@<domain>.com:<org>/<repo_name>.git

Open Selection in Sourcegraph Web and Copy Sourcegraph File Link are not working and produce the error

The file is not under version control that your IDE + this plugin supports. The plugin currently only supports Git and Perforce. For the IDE part, make sure you have the Git or Perforce plugin (whichever you need) installed. If you are seeing this error for a supported VCS with the plugin installed, please reach out to support@sourcegraph.com.

I realized that I had not previously tested all of the Sourcegraph links so reinstalled the stable version to test again

Stable: 5.2.18630
Search Selection on Sourcegraph Web and Search Selection in Repository on Sourcegraph Web are both working (selection opens in browser), however they produce the error Error determining repository info: java.lang.NullPointerException: Cannot invoke "com.sourcegraph.cody.agent.CodyAgentServer.convertGitCloneURLToCodebaseName(com.sourcegraph.cody.agent.protocol.CloneURL)" because "server" is null

Open Selection in Sourcegraph Web and Copy Sourcegraph File Link both do not work and produce the errors about file not under version control and "server" is null

Cody was enabled for all tests

The plugin functionality was in a better state than I originally realized. Some bugs were fixed in nightly, however some bugs still exist and some bugs were swapped for others. I'm not entirely sure what the stability of any of these features is on the nightly branch.

@mkondratek
Copy link
Contributor

Whoops, sorry I missed your comment. I hope the plugin is more stable today.

In particular I think that #2421 fixed some of the problems.

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

Successfully merging a pull request may close this issue.

3 participants