question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

OSErrno 13 Permission Denied

See original GitHub issue

When 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:closed
  • Created 7 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
brendanwcommented, Sep 22, 2016

ah, yup, duh. chmod +x for the file did the trick. thanks!

1reaction
chriskuehlcommented, Sep 22, 2016

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?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found