class: center, middle, inverse, title-slide # Troubleshooting RStudio Team products ## RStudio Team admin training ### Ian Pylvainen and Jay Clark ### 2020-04-30 --- ## Troubleshooting RStudio Team products In this session you will learn: * First-hand from the RStudio Support team about common pitfalls * About tools for identifying the root cause * Other tips and techniques to stay on the happy path --- class:subtitle-slide ## Introduction --- ### General troubleshooting tips * Identify what the error is and where it's coming from. * An error reported in the IDE might arise from: * User code, an R package, or R itself * The RStudio IDE * How widespread is this issue? Does it affect one user, the entire server, or the whole cluster? * Can you reproduce the problem? * Identify the root cause of the error * Any recent changes? * Specific users or groups involved? * Specific code being run? .center[ Change **one thing at a time** to try and isolate the issue ] --- ### Things RStudio Support looks at (and you should too): * Log files * R * Local environment and environment variables * Common issues: * Licensing * Configuration * Authentication * Network issues --- class: subtitle-slide ## Log files --- ### RStudio log files Product | Log file -------------------- | ------------------ RStudio Server Pro | `/var/lib/rstudio-server/monitor/log/rstudio-server.log` Shiny Server Pro | `/var/log/shiny-server.log` RStudio Connect | `/var/log/rstudio-connect.log` Package Manager | `/var/log/rstudio-pm.log` --- ### System log files Area | Log file ------------------- | ---------------------------------------------------- Server log files | `/var/log/syslog` <br/> OR <br/> `/var/log/messages` Authentication logs | `/var/log/auth.log` <br/> OR <br/> `/var/log/secure` --- ### For RStudio Connect deployment issues: * Deployment log generated in the console or retrieved with ```R library(rsconnect) rsconnect::showLogs() ``` --- ### Log file example .center[ <img src='https://cdn.rstudio.com/pro-admin/pres/images/08/log_file_example.png' height=400; /> ] --- class: subtitle-slide ## Troubleshooting R --- ### Troubleshooting R - Almost all RStudio products depend on R being installed successfully to run. - Look for errors related to R in the server logs - Can R be launched manually and can the user's code be run in R without any errors? - How was R installed? - From source or [pre-compiled binaries](https://docs.rstudio.com/resources/install-r/)? If so, were all correct flags and capabilities set? ```sh grep configure R_HOME/etc/Makeconf ``` .center[ <img src='https://cdn.rstudio.com/pro-admin/pres/images/08/grep_makeconf.png' height=150; /> ] --- ### Troubleshooting R (continued) Are all necessary dependencies installed? .pull-left[ ```sh apt-get build-dep r-base yum-builddep R ``` Are the permissions set correctly to allow `r-x` (read and execute) by all? ```sh namei -l /path/to/R ``` ] .pull-right[.center[ <img src='https://cdn.rstudio.com/pro-admin/pres/images/08/perm_check.png' height=200; /> ]] --- ### Troubleshooting R (multiple versions) Are there multiple versions of R on the system? ```sh apt-get install mlocate updatedb locate libR.so ``` ``` ## locate libR.so /opt/R/3.4.4/lib/R/lib/libR.so /opt/R/3.5.1/lib/R/lib/libR.so ``` If so, see questions above for all versions in addition to checking that the expected version is loaded. --- class: subtitle-slide ## Troubleshooting the environment --- ### Local environment What operating system are you running on? ```sh uname -a cat /etc/*-release ``` Are you running with load balancing or in a virtual container such as Docker, etc? --- ### Environment variables Does your setup rely on specific environment variables to be set correctly? If so, are those set correctly in R as well as RStudio? * Proxy settings * Java * Database connections * System library path issues * For example, `LD_LIBRARY_PATH`, `PATH`, etc. R pulls from several startup files * Refer to the R Views blog article ["Understanding R’s Startup"](https://rviews.rstudio.com/2017/04/19/r-for-enterprise-understanding-r-s-startup/) --- ### Configuration Look for any errors in the startup. * You can view the live log during startup using ```sh tail -f /path/to/log ``` Read through the admin guides and make sure you have the correct formatting Make sure you're on the right version of the product compared to the admin guide! .center[ <img src='https://cdn.rstudio.com/pro-admin/pres/images/08/connect_error_example.png' height=100; /> ] --- class: subtitle-slide ## Expired licenses --- ### Expired license .center[ <img src='https://cdn.rstudio.com/pro-admin/pres/images/08/license_error.png' height=400; /> ] --- ### Expired license - Things to try: - Check time and time zone `timedatectl` - Resync if needed, e.g. `sudo hwclock -w` - Restart - Deactivation tool: http://apps.rstudio.com/deactivate-license/ - Long-term solutions * Consider switching to offline setup - RStudio is working on improvements --- class: subtitle-slide ## Authentication --- ### Authentication * Difficult for RStudio Support to troubleshoot as it depends on external configuration values unknown to us. * Does it work outside of the RStudio product? * Often possible to copy over working setup from other systems or services. * For RStudio Server Pro * `pamtester` utility lets you test outside RStudio systems. ```sh sudo /usr/lib/rstudio-server/bin/pamtester \ --verbose rstudio <username> authenticate ``` * Check server log files including `access.log` files. * Check connections to any external authentication providers * Kerberos, Active Directory, etc. --- class:subtitle-slide ## Network issues --- ### Network issues .pull-left[ Network issues are outsidet the scope of the [RStudio support SLA](https://rstudio.com/about/support-agreement/). This means we're limited on the help we can provide. Things to check: * Connectivity * SSL / certificate * Firewall / security / proxy settings ] .pull-right[ <img src='https://cdn.rstudio.com/pro-admin/pres/images/08/connect_network_error.png' height=300; /> ] --- class:subtitle-slide ## Helpful resources --- ### Helpful resources RStudio documentation Document | Location -------------- | --------------------- Admin guides / user guides | https://docs.rstudio.com FAQs / articles | https://support.rstudio.com Shiny docs | http://shiny.rstudio.com/articles/ Other resources Document | Location -------------- | --------------------- RStudio Community | https://community.rstudio.com RViews blog | https://rviews.rstudio.com/ License deactivation app | http://apps.rstudio.com/deactivate-license/ --- class:subtitle-slide ## Working with support --- ### Working with support Things that help: * Describe error messages / what users are seeing * Describe system information * OS, R version, product version * Attach server log files * Attach configuration files Getting help: * Email the support team at [support@rstudio.com](mailto:support@rstudio.com), OR * File a ticket at https://support.rstudio.com/hc/en-us/requests/new --- class: subtitle-slide ### Any questions? Send an email to [support@rstudio.com](mailto:support@rstudio.com)! --- class: subtitle-slide ## Your turn --- class: your-turn-slide ### Your turn Next complete the exercise.