Skip to content

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

Problem#

You may 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 has not 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 is displayed 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, you need to change ownership to the Service.User that you've set as 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.