6

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
cva6
  • 325
  • 7
  • 15
  • 3 questions: what directory is it trying to access? what user is the jenkins process running as? Is it a jenkins master or slave? – gaige Apr 30 '20 at 01:22
  • @gaige, thanks for responding. I am trying to access the folder on my desktop, it is running as master and it is my user which has admin access – cva6 Apr 30 '20 at 02:41

5 Answers5

7

I don't know how secure this is, but, you can also resolve this issue by going to System preferences -> Privacy -> Full Disk Access and giving "/bin/sh" full disk access.

I found this solution here: https://www.symscape.com/node/1727

Praise
  • 188
  • 2
  • 5
5

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.

gaige
  • 17,263
  • 6
  • 57
  • 68
2

Here is the solution (MacOS Version 12.6 and later):

System Preferences -> Privacy -> Developer Tools -> Terminal (set here the checkpoint to enabled)

Here comes the screenshot

Pro
  • 71
  • 4
1

I solved it by changing permissions:

  1. Select *.py file.
  2. Choose Get Info or shortcut command + I
  3. Scroll to Sharing & permissions
  4. For name everyone pick Read & Write

enter image description here

Ramis
  • 13,985
  • 7
  • 81
  • 100
0

This works for me(Mac OS 13.3 or later) : System Preferences -> Privacy & Security -> Full Disk Access -> Terminal (set here the checkpoint to enabled)

Gosling
  • 21
  • 5