Skip to content

Troubleshooting

General method

  1. Diagnose before fixing. Collect the actual error before changing anything.
  2. Change one thing at a time, then re-test.
  3. Reproduce as the service account, not as root. Root can read files, bind ports, and resolve paths that the service cannot.

Where to look:

Product Service log Product log
Workbench journalctl -u rstudio-server, journalctl -u rstudio-launcher /var/log/rstudio/rstudio-server/, /var/log/rstudio/launcher/1
Connect journalctl -u rstudio-connect /var/log/rstudio/rstudio-connect/rstudio-connect.log2
Package Manager journalctl -u rstudio-pm /var/log/rstudio/rstudio-pm/rstudio-pm.log3
sudo systemctl status rstudio-pm --no-pager -l
sudo journalctl -u rstudio-pm -n 100 --no-pager

Package Manager crash loop after migration

systemctl status shows the service stuck in activating (auto-restart) and rspm list says it cannot contact the server. This case is worth walking through because it fails in several layers, each hidden behind the previous one.

flowchart TD
    Start(["rstudio-pm crash loop"]) --> Temp{"TempDir writable<br/>by rstudio-pm?"}
    Temp -->|no| FixTemp("chown TempDir")
    Temp -->|yes| Port{"Binding 443/80?"}
    Port -->|"bind: permission denied"| FixCap("setcap cap_net_bind_service")
    Port -->|ok| Key{"Key readable<br/>by rstudio-pm?"}
    Key -->|"open ...key: permission denied"| FixKey("Move key to /etc/rstudio-pm,<br/>chown rstudio-pm, 0600")
    Key -->|ok| DB{"Database reachable?"}
    DB -->|"could not translate host name"| FixDNS("Fix DNS / private zone")
    DB -->|"connection refused / timeout"| FixFW("Fix DB firewall rule")
    DB -->|ok| Running("Service running")

Step 1: read the real error

Package Manager logs the fatal error at startup; the system journal also captures it (journalctl -u rstudio-pm), which is useful for diagnosing startup failures.3 Read the log, then reproduce the start as the service user, not as root:

sudo tail -n 30 /var/log/rstudio/rstudio-pm/rstudio-pm.log
sudo -u rstudio-pm /opt/rstudio-pm/bin/rstudio-pm --config /etc/rstudio-pm/rstudio-pm.gcfg

Stop it with Ctrl+C once you have the error. Running the binary as root (sudo /opt/rstudio-pm/bin/rstudio-pm ...) often succeeds and misleads you: root can bind 443, read any key, and write anywhere.

Step 2: temp directory

FATAL Unable to initialize the configuration: Could not write to Server.TempDir /var/tmp/rspm/: permission denied
sudo mkdir -p /var/tmp/rspm
sudo chown rstudio-pm:rstudio-pm /var/tmp/rspm

Step 3: privileged port

FATAL Unable to start services error: "error starting socket services: error initializing HTTPS listener: listen tcp :443: bind: permission denied"
sudo setcap 'cap_net_bind_service=+ep' /opt/rstudio-pm/bin/rstudio-pm

This grants the capability needed to bind a privileged port.4 Check it again after every upgrade. Installing a new version replaces the binary file, and the cap_net_bind_service capability is stored on the old file's inode, not in the package.

Step 4: private key

FATAL error initializing HTTPS server error: "open /etc/ssl/private/packagemanager.example.com.key: permission denied"

Changing the key's owner is not enough if a parent directory blocks traversal. Inspect the whole path:

sudo namei -l /etc/ssl/private/packagemanager.example.com.key
dr-xr-xr-x root root /
drwxr-xr-x root root etc
drwxr-xr-x root root ssl
drwx------ root root private
-rw------- rstudio-pm rstudio-pm packagemanager.example.com.key

The fix Posit recommends is to move the certificate and key into /etc/rstudio-pm/:56

sudo cp /etc/ssl/certs/packagemanager.example.com.crt /etc/ssl/private/packagemanager.example.com.key /etc/rstudio-pm/
sudo chown rstudio-pm:rstudio-pm /etc/rstudio-pm/packagemanager.example.com.*
sudo chmod 600 /etc/rstudio-pm/packagemanager.example.com.key
sudo restorecon -Rv /etc/rstudio-pm

Then update HTTPS.Certificate and HTTPS.Key in rstudio-pm.gcfg.6

If ownership and paths are right and access is still denied, check SELinux:

sudo ausearch -m avc -c rstudio-pm -ts recent

Step 5: database

The service starts, logs Service ready to listen for requests, then exits:

ERROR Error running services: Error: Unable to initialize a connection to the database: Unable to connect to DB: failed to connect to `user=ppm database=rstudio_pm`: hostname resolving error

This is DNS or network, not Package Manager. See Networking and Databases.

Things that are not the problem

  • The admin socket directory. The packaged systemd unit manages /var/run/rstudio-pm, where the domain socket rstudio-pm.sock lives.7 If you run the binary by hand outside systemd and that directory does not exist, you will see a socket creation error. That error comes from running outside systemd, not the root cause of the crash loop.
  • A plain-text value for a sensitive setting such as Postgres.Password. Not fatal; encrypt it with rspm encrypt when convenient.8
  • Package Manager listening on HTTP (default :4242) when you only wanted HTTPS. Not fatal, but set [HTTP] Listen = (empty) to close the extra port; Package Manager must have at least one of HTTP or HTTPS enabled.6

Connect is running but not listening

sudo systemctl status rstudio-connect --no-pager
sudo ss -tlnp | grep -i connect
pgrep -a connect

If the process is up but ss shows nothing on the expected port:

Cause Check
Still starting (schema migration on upgrade can take time, especially with large instrumentation tables)9 tail -f /var/log/rstudio/rstudio-connect/rstudio-connect.log2
Different port configured grep -A2 -E '^\[(HTTP|HTTPS|HTTPRedirect)\]' /etc/rstudio-connect/rstudio-connect.gcfg10
Port in use by another process sudo ss -tlnp 'sport = :443'
SELinux blocking a nonstandard port ausearch -m avc -ts recent

Content fails to deploy on Connect

Log message Meaning Fix
OK (built source) and slow deploys Binaries not used See Linux binaries
unable to load shared object ... undefined symbol Package built against different system library versions Install matching runtime libraries; prefer binaries
configuration failed for package 'sf' Missing -devel libraries for a source build Install system dependencies, or use binaries
package 'X' is not available Not in the configured repository, or wrong snapshot date Check repository and R.PackageRepositoryResolution10
R version X.Y.Z not found Requested version not installed and R.VersionMatching = exact Install the version or republish10

Workbench sessions will not start

Symptom Check
Spinner forever at "Starting session" journalctl -u rstudio-launcher, /var/log/rstudio/launcher/rstudio-launcher.log,1 launcher-sessions-callback-address and launcher TLS settings11
Session exits immediately Home directory exists and is writable; rserver.log; user's ~/.Rprofile errors or an oversized R environment12
Only some users fail Their UID/GID, home mount, disk quota
Everyone fails after an upgrade rstudio-server status, config keys removed in release notes

Getting help

Collect before opening a Posit support ticket:13

  • Product version and OS (cat /etc/os-release)
  • The exact error text and timestamps
  • Relevant config (secrets removed)
  • What changed recently
  • A diagnostics bundle, generated per product:
sudo rstudio-server run-diagnostics
sudo /opt/rstudio-connect/scripts/run-diagnostics.sh
sudo /opt/rstudio-pm/bin/run-diagnostics