-
Notifications
You must be signed in to change notification settings - Fork 67
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
KeyError on like 212 in engine.py on request. #226
Comments
Can you please help me reproduce this error by sharing a little bit more information. Also I'm curious if it only crashed on one specific repository, or if it crashes for everything |
I'm getting the same issue. M2 Max
Printing out the |
regarding this, just out of curiosity, is the file state.py gitignored? Or perhaps it's a new file that has not been committed yet? Just trying to figure out why it would not be included in |
Repo I'm using: https://github.com/tinygrad/tinygrad Running server in ..../tinygrad folder The state.py is not gitignored |
Just had the crash happen again in https://github.com/Oneirocom/Magick/ This time the server wasn't finished processing all the chunks (60K) but this was the same error on the other project which was finished processing everything. Magick is a large js project and the other was a medium sized java project. Also this time i'm on Arch Linux. So this is happening at least on Arch and macos.
|
that file isn't in the .gitignore either |
Hitting this on mac as well on a file which is in not in gitignore. I am doing it one level into the folder, not from root, so there is that. |
I might also got the KeyError, here is the trace:
The file as the key for the KeyError is indeed a file in code base. I just started SeaGOAT a minutes before, then I type: I might need to wait for longer time, even after the server finish scanning the code base? I'm running in Ubuntu 24.4, in WSL2/Window 11. The files complained of KeyError is not tracked by git.
I'll try a different repo. |
No, that should not be necessary at all! |
What is the expectation to a repo to be working with gt?
|
It just needs to be a git repository. Even if there are no files that are actually committed, it should still work. Actually by design it even works with files that you have just recently created. |
I have a suspicion that
has to do with 2 competing versions of the file existing somehow, or maybe the file no longer has the line that it was last analyzed with. I think that this would be solved by grouping the results by SHA1 hash and using git to retrieve the correct version of the file I suspect this is a different error, I have only one theory for it which is maybe a result appears through ripgrep, but it is not anywhere in git history. Maybe there is a bug that files that have not been committed yet are not included in top_files, but that would only be possible if the file is not in any previous commit 🤔
|
find out that error is because of x.path is lowercase but key inside top_files has uppercase symbol. I think that goes from repository class, where processed commit on files, that line if not (self.path / filename).exists():
continue Perhaps I renamed that file from uppercase. Now I got same error. but that file with uppercase is not in the top_files hash anymore, but current lowercase file not in there too, but it is in results and failing here again. |
temporarily fixed that error with changing to return list(
sorted(
results_to_sort,
key=lambda x: (
0.7 * normalize_score(x.get_best_score(self.query_string))
+ 0.3 * normalize_file_position(top_files.get(Path(x.path).as_posix(), 0))
),
) |
I noticed that one way this error can happen is if a file is found the ripgrep before the repo was analyzed. This can happen if you create a file while the server is analyzing files, and then make a query before all files are analyzed. That is because the server is not looking for more files to analyze while there are still files in the queue. But I'm curious if the same error can happen in other circumstances as well 🤔 |
Reopening because only the error regarding files not being found was fixed, the error regarding lines not being found probably still persists |
Just installed it on my work laptop (running macos)
Server usually crashes once I make a request on like 212 in engine.py complaining about a KeyError on one of the files.
I had it working one time on my 3rd try starting the server. Not sure I did anything different though
I can't post the log here unfortunately :(
The text was updated successfully, but these errors were encountered: