Closed rtimmons closed 1 year ago
@aki-k beat me to it in #2 - please resolve this if easier for management.
Thank you @rtimmons and @aki-k If either of you are interested in a simple fix, even a try catch - please do raise a PR and I'd love to welcome you as a contributor!! 🎉
I know almost nothing about python. I got bit at this:
⮞ git config --global user.email
ava.lagoon@yahoo.com
⮞ my-python-venv/bin/gorilla "how to list all files in a directory"
Traceback (most recent call last):
File "/home/ubuntu/my-python-venv/bin/gorilla", line 8, in <module>
sys.exit(main())
^^^^^^
File "/home/ubuntu/my-python-venv/lib/python3.11/site-packages/go_cli.py", line 128, in main
user_id = get_user_id()
^^^^^^^^^^^^^
File "/home/ubuntu/my-python-venv/lib/python3.11/site-packages/go_cli.py", line 76, in get_user_id
assert user_id != ""
^^^^^^^^^^^^^
AssertionError
What should I do here?
@dxxvi If you ran the command before setting the email try rm .gorilla-cli-userid
and re-running the command.
+1 @AshTreeSystems is spot on. Just delete the file and run the command again to reinitialize it.
The CLI setup /
~/.gorilla-cli-userid
creation logic tries to callgit config --global user.email
:https://github.com/gorilla-llm/gorilla-cli/blob/ec4153a7df028134213998fd16ee0ae339e103f1/go_cli.py#L81
This can fail if the user hasn't configured this git-config value (or if the user doesn't have git installed).
This results in an exception, but we continue to write the cli-userid file anyway (it's empty at this point):
https://github.com/gorilla-llm/gorilla-cli/blob/ec4153a7df028134213998fd16ee0ae339e103f1/go_cli.py#L81
Then on subsequent invocations, the (empty) cli-userid file is read, and this assertion block prevents progress without meaningful recourse:
https://github.com/gorilla-llm/gorilla-cli/blob/ec4153a7df028134213998fd16ee0ae339e103f1/go_cli.py#L76
Suggested fixes / ideas:
git config
invocation to fail https://github.com/gorilla-llm/gorilla-cli/blob/ec4153a7df028134213998fd16ee0ae339e103f1/go_cli.py#L81 and do the uuid-based id generation logic there.Thanks for making this project and making it available open-source. I hope this bug report is helpful.