OSErrno 13 Permission Denied
See original GitHub issueWhen trying to run a bash script as part of a pre-commit hook, I run into the below error:
An unexpected error has occurred: OSError: [Errno 13] Permission denied
Traceback (most recent call last):
File "/usr/local/Cellar/pre-commit/0.9.1/libexec/lib/python2.7/site-packages/pre_commit/error_handler.py", line 47, in error_handler
yield
File "/usr/local/Cellar/pre-commit/0.9.1/libexec/lib/python2.7/site-packages/pre_commit/main.py", line 157, in main
return run(runner, args)
File "/usr/local/Cellar/pre-commit/0.9.1/libexec/lib/python2.7/site-packages/pre_commit/commands/run.py", line 212, in run
return _run_hooks(repo_hooks, args, write, environ)
File "/usr/local/Cellar/pre-commit/0.9.1/libexec/lib/python2.7/site-packages/pre_commit/commands/run.py", line 136, in _run_hooks
retval |= _run_single_hook(hook, repo, args, write, skips)
File "/usr/local/Cellar/pre-commit/0.9.1/libexec/lib/python2.7/site-packages/pre_commit/commands/run.py", line 89, in _run_single_hook
retcode, stdout, stderr = repo.run_hook(hook, tuple(filenames))
File "/usr/local/Cellar/pre-commit/0.9.1/libexec/lib/python2.7/site-packages/pre_commit/repository.py", line 201, in run_hook
self.cmd_runner, hook, file_args,
File "/usr/local/Cellar/pre-commit/0.9.1/libexec/lib/python2.7/site-packages/pre_commit/languages/script.py", line 21, in run_hook
file_args,
File "/usr/local/Cellar/pre-commit/0.9.1/libexec/lib/python2.7/site-packages/pre_commit/xargs.py", line 57, in xargs
*run_cmd, encoding=None, retcode=None
File "/usr/local/Cellar/pre-commit/0.9.1/libexec/lib/python2.7/site-packages/pre_commit/util.py", line 179, in cmd_output
proc = __popen(cmd, **popen_kwargs)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 710, in __init__
errread, errwrite)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1335, in _execute_child
raise child_exception
OSError: [Errno 13] Permission denied
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
OSError - Errno 13 Permission denied
You need to change the directory permission so that web server process can change the directory. To change ownership of the directory, ...
Read more >Python PermissionError: [errno 13] permission denied
The PermissionError: [errno 13] permission denied error occurs when you try to access a file from Python without having the necessary ...
Read more >PermissionError: [Errno 13] Permission denied error solved
The error "PermissionError: [Errno 13] Permission denied error" often occurs when the file you are trying to read from or write to is...
Read more >Fix - PermissionError: [Errno 13] Permission denied in Python
NB: The PermissionError: [errno 13] permission denied error occurs when you try to access a file from Python without having the required ...
Read more >How to Fix MySQL's (errno: 13 - Permission denied) when ...
The error was caused by the table files in my MySQL data directory being owned by the wrong user so MySQL couldn't properly...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
ah, yup, duh. chmod +x for the file did the trick. thanks!
Is the script executable? That would be my guess. What does
ls -l <path to script>
print?Can you post your
hooks.yaml
or.pre-commit-config.yaml
?