Package Manager - ERROR system error 2 (No such file or directory)

Error output - system error 2 (No such file or directory)

Problem

You could see the following error for Posit Package Manager:

ERROR system error 2 (No such file or directory) [path: /var/lib/rstudio-pm/path/to/directory/secure-cookie-key];

Solution

It’s possible to run into this error when your server hasn’t found a secure cookie key. To resolve this, you can perform the following:

  • Generate a new secure cookie key by running the command below (where /var/lib/rstudio-pm/path/to/directory/secure-cookie-key is the path in the error message that displays in the Package Manager log file):

    sudo sh -c "echo `uuid` > /var/lib/rstudio-pm/path/to/directory/secure-cookie-key" 
  • Then, change the ownership to the package manager service account:

    sudo chown -R rstudio-pm:rstudio-pm /var/lib/rstudio-pm
  • If you’ve changed the RunAs user, change ownership to the Service.User that you’ve set per the following guide: https://docs.posit.com/rspm/admin/appendix/changing-runas-user/

  • From there, ensure that it’s only readable by root:

    sudo chmod 0600 /var/lib/rstudio-pm/path/to/directory/secure-cookie-key
  • Lastly, restart the package manager service:

    sudo systemctl restart rstudio-pm

If the problem persists, please open a ticket with support.

Back to top