src-cli icon indicating copy to clipboard operation
src-cli copied to clipboard

repository does not exist

Open kmalakoff opened this issue 10 months ago • 2 comments

When I perform a search like

src search --json "repo:has.file(package.json) file:package.json "some-package" count:1000"

The whole search fails for a repo that "does not exist"

GraphQL errors: { "message": "repository does not exist: repo-name", "path": [ "search", "results", "results", 309, "file", "content" ]

The query works with a small count before it hits an error. Is there a way for the cli to skip GraphQL errors? The query works fine within the sourcegraph webapp.

I cannot give a case to reproduce because this depends on our corporate data

kmalakoff avatar Feb 27 '25 21:02 kmalakoff

I ended up using the trace flags for the cli and manually calling source graph over http using graphql syntax and then getting the package.jon contents over http directly from gitlab

I’m not sure what the problem was, but maybe an inconsistent state in source graph? Basically, your graphql query adds the content field to the file and for the failing repo, it found an instance of “some-package” in the package.json, but couldn’t return the full content of the package.json via the content graph field.

I work at Indeed and if you want to troubleshoot this and have access to our instance, I can share the query for you to reproduce

kmalakoff avatar Feb 28 '25 16:02 kmalakoff