Search code examples
jenkinsmacos-catalinajenkins-cli

Error in Jenkins Mac Catalina - cannot access parent directories: Operation not permitted


I updated my mac to catalina and i am starting to get this error. Before everything was working fine.

I am trying to cd into the directory from my jenkins workspace and run my npm tests and i am getting the error below:

shell-init: error retrieving current directory: getcwd: cannot access parent directories: Operation not permitted
    + git reset --hard HEAD
    job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: Operation not permitted
    fatal: Unable to read current working directory: Operation not permitted

Solution

  • Catalina has a more complex set of permissions than previous versions of macOS X, and therefore requires you to do some additional work if you want the process to access files in certain folders, including the Desktop folder.

    For normal applications, you can grant access using the System Preferences and the Privacy tab. For background applications, it's a bit more difficult, and especially with the java interpreter, but you should be able to add the java interpreter to the list of excluded Apps.

    However, you may want to consider not using a folder on your Desktop to avoid this.