/ QUICK TIPS , GIT

Error 459 - permission denied while trying to run git bisect with script

How to fix error occurring during git bisect run - 459: /usr/lib/git-core/git-bisect: script.sh: Permission denied.

Full logs of git-bisect with 459 error

As you see, problem with running script doesn’t stop git-bisect so it finishes job. I hope in the future Git team will improve this, to stop when something goes wrong - such result is not reliable, there is no point to continue process.

~/Projects/app ((no branch, bisect started on fix_bug)) $ git bisect run /usr/lib/git-core/scripts/check-app.sh
running /usr/lib/git-core/scripts/check-app.sh
/usr/lib/git-core/git-bisect: 459: /usr/lib/git-core/git-bisect: /usr/lib/git-core/scripts/check-app.sh: Permission denied
Bisecting: 3 revisions left to test after this (roughly 2 steps)
[0e804f177d84772564ef74cb3905c4c1147d2f78] commit title
running /usr/lib/git-core/scripts/check-app.sh
/usr/lib/git-core/git-bisect: 459: /usr/lib/git-core/git-bisect: /usr/lib/git-core/scripts/check-app.sh: Permission denied
Bisecting: 1 revision left to test after this (roughly 1 step)
[e02f6d38ed24ee37caddd494e04742dcfa2eef84] another commit title
running /usr/lib/git-core/scripts/check-app.sh
/usr/lib/git-core/git-bisect: 459: /usr/lib/git-core/git-bisect: /usr/lib/git-core/scripts/check-app.sh: Permission denied
Bisecting: 0 revisions left to test after this (roughly 0 steps)
[4abe5155e0b4781b3247b289ebea23c081889150] yet another commit title
running /usr/lib/git-core/scripts/check-app.sh
/usr/lib/git-core/git-bisect: 459: /usr/lib/git-core/git-bisect: /usr/lib/git-core/scripts/check-app.sh: Permission denied
4abe5155e0b4781b3247b289ebea23c081889150 is the first bad commit
commit 4abe5155e0b4781b3247b289ebea23c081889150
(COMMIT DETAILS)
:040000 040000 92dfff033a3f883db1311fe9a8a3b50a5c901cbd a60d2bf636421197930d7194fbd56b954880e50e
bisect run success

Quick solution

Quick solution is to allow everyone to access directory with script.
To do so you just need to use chmod command like this:

# Make directory available for all 
chmod -R 777 PATH_TO_DIRECTORY

In my case it was fine, I have even moved whole script to /usr/lib/git-core/scripts directory, so it’s globally available now, so I didn’t investigate what exactly has gone wrong.

Summary

To summarize: 459 access problem can be fixed without investigation, but only if giving permission for every user is acceptable in your case. If this quick solution is not enough for you or doesn’t work in your case, please share your own with others in comments :)

tometchy

Tometchy

Passionate focused on agile software development and decentralized systems

Read More