You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We had a problem recently where caprover-cli was showing an error message, but it didn't make any senses:
Cannot find hash of last commit on branch "master".
After a few researches I've found the code that make the error and ran it.
# git rev-parse master
fatal: detected dubious ownership in repository at '<folder>'
To add an exception for this directory, call:
git config --global --add safe.directory <folder>
I've found a similar issue #122 their problem was solved by, not using sudo, but our problem is because we're using docker to run caprover-cli with a volume that is linked to our project folder.
I have a suggestion to display the git error, instead of sending it to /dev/null we could send the error message to a temporary file and print the content when we encounter the error. Being able to have the proper error would have saved us a lot of time.
The program could print something like:
Cannot find hash of last commit on branch "master". Git returned the following errors:
fatal: detected dubious ownership in repository at '<folder>'
To add an exception for this directory, call:
git config --global --add safe.directory <folder>
I would be willing to work on the pull request to add this behaviour.
P.S. for people that have the same problem and are using the caprover/caprover-cli's docker with an upgraded version of git, we added RUN git config --global --add safe.directory <the path of our volume folder> to our Dockerfile to fix the error. We allowed this because we control the docker and it's running locally on our dev's machines, meaning that it's not causing security issues with our workflow.
The text was updated successfully, but these errors were encountered:
We had a problem recently where caprover-cli was showing an error message, but it didn't make any senses:
After a few researches I've found the code that make the error and ran it.
I've found a similar issue #122 their problem was solved by, not using
sudo
, but our problem is because we're using docker to run caprover-cli with a volume that is linked to our project folder.The real issue here is that the code
caprover-cli/src/utils/ValidationsHandler.ts
Line 174 in c7cdb49
I have a suggestion to display the git error, instead of sending it to
/dev/null
we could send the error message to a temporary file and print the content when we encounter the error. Being able to have the proper error would have saved us a lot of time.The program could print something like:
I would be willing to work on the pull request to add this behaviour.
P.S. for people that have the same problem and are using the
caprover/caprover-cli
's docker with an upgraded version of git, we addedRUN git config --global --add safe.directory <the path of our volume folder>
to our Dockerfile to fix the error. We allowed this because we control the docker and it's running locally on our dev's machines, meaning that it's not causing security issues with our workflow.The text was updated successfully, but these errors were encountered: