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
empty directory cause internal error #231
Comments
Maybe you can fix the issue yourself? Patch welcome. |
Hi, I just got the same issue, here is the result of some investigation: When creating the app, all folder in KLAUS_REPOS_ROOT are collected as parameter: klaus/klaus/contrib/wsgi_autoreloading.py Line 40 in 62d08c3
Klaus tries to create a dulwich repo for every folder in parameter: Line 20 in 62d08c3
Dulwich raise an exception when the folder does not correspond to a git repository: This exception is currently not handled and cause the internal error. The error could be fix by handling the exception or by validating the path before, it mainly depends on the vision @jonashaag has about klaus: should it crash when it receive an invalid parameter? Should it try to handle it gracefully? I will try to propose a fix for the issue if I find some time to set up a dev environment for klaus. EDIT: Just saw the similar and still open issue (#176) |
Thanks for investigating! Actually I think it's fine to simply ignore failing directories (with a warning on the command line) for the autoreloader. But only for the autoreloader, so that if you invoke klaus using the normal command line it crashes for failing directories. We can either check directories before passing them to |
Thanks for the answer! I just saw the similar issue #176, and I added a proposition there (ignore hidden folders). |
Sounds good, but we'll have to turn this into a logging message without adding actual logging code to the Suggestions:
|
I guess the correct way to do this is to add a new |
I think I prefer your suggestion 1. It if The issue I see with a I am not very familiar with web applications, let me know if I am wrong somehow! |
I think it would be ideal if directories that can not be opened would show in the web UI, but colored in red (and not clickable). That way you don't have to read the console logs to know that a repository was not picked up. |
It would be a nice feature as long as it only display broken git repos only, and does not show other folders: I would not like to have some Either we need a way to differentiate broken git repos from non git folders or we should allow the user to filter the folder to include (this is already the case with |
It may make sense to follow the common convention of hiding anything that starts with a "." - that would cover @xNephe's examples. |
Fixed with #240 |
I got a lot of git project under the KLAUS_REPOS_ROOT, but when I add an empty directory
in KLAUS_REPOS_ROOT by mistake, it will cause an internal error and the services are all failed. Is there any option to set so i can make klaus just ignore the bad project so other projects can not be affected? Thank you.
The text was updated successfully, but these errors were encountered: