Posit Package Manager Secure Cookie Key Not Found



You may often see an error on Posit Package Manager where you see an error message similar to the below:

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



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: 

sudo sh -c "echo `uuid` > /var/lib/rstudio-pm/path/to/directory/secure-cookie-key" 

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.

Then, change the ownership to the package manager service account:

sudo chown -R rstudio-pm:rstudio-pm /var/lib/rstudio-pm

Note that if you've changed the RunAs user, you will need to change ownership to the Service.User that you've set as per the following guide:


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


Support Ticket

If you still have issues after completing the above, you can always lodge a support ticket, where our group of friendly, and incredibly knowledgeable staff can assist with any issues that you may be having. You can submit a ticket here: