Troubleshooting

There are a variety of reasons why an application that appears to work locally may have problems when running on Posit Connect. We recommend first checking your application logs for any errors in your application. You can check your logs in the Posit Connect dashboard, under the Logs section for your deployed content.

Troubleshooting Publishing Issues

Posit Connect includes extra information in the packrat restore, content build, and content execution logs that may help diagnose common problems with publishing content. For example:

  • Posit Connect will log the distribution of Linux used by the server. If there are issues related to shared object files used by R, this may help to diagnose them.

  • Posit Connect will log any overrides to the repos option set by your server administrator. This may occur when your organization has a security policy that permits you to use a particular public repository on your workstation but requires a secure private repository on the Posit Connect server. If there are issues related to packages not being present in repositories, this may help to diagnose them.

  • Posit Connect will log the URL of all requests made to fetch packages, which may show problems accessing some of the R package repositories in the Connect configuration or used as options(repos) settings during content development.

  • If no version of R on the Posit Connect server matches the version of R that you used to deploy your content, Posit Connect will find the closest available R version and log that you requested a specific R version but that it is using some other specific R version because the requested one is not available.

  • Posit Connect scans your logs for common errors and suggests troubleshooting steps if an error is found. If you have encountered an error that Posit Connect is not detecting or for which Posit Connect is not providing adequate troubleshooting steps, contact your Connect administrator or your Posit Support representative for additional assistance.

    In rare situations, a change to the system running Posit Connect may be incompatible with the previously installed R and Python packages. Your Connect administrator should review the Runtime Caches documentation in the Posit Connect Admin Guide to see if this apples.

Error Codes

Posit Connect analyzes the log output and recognizes a set of common errors. These are assigned error codes, which are listed below along with possible causes and solutions.

r-cannot-access-repo

Posit Connect cannot download a package because the R package repository (for example, CRAN or Posit Package Manager) cannot be accessed.

Possible causes and solutions:

  • There may be network problem preventing the Posit Connect server from connecting to the package repository, or the package repository might be down.

    Verify that the package repository is reachable from the Connect server.

  • If the package repository is accessed be accessed through a proxy server, the proxy server must be configured in the Connect configuration file.

    Verify that the Packages.HTTPProxy and Packages.HTTPSProxy configuration settings to point to your outbound proxy server.

  • The publishing computer may be using a different package repository from the Connect server. If so, that package repository may be accessible from the Connect server.

    Configure the publishing computer with a package repository that is accessible via http(s) from the Connect server, such as CRAN or Posit Package Manager. Reinstall the affected packages from the new repository and publish the content again.

  • The package repository may have moved to a different URL since the content was published.

    Reinstall the affected packages from the new URL and publish the content again.

References

r-proxy-unreachable

The proxy server specified in Packages.HTTPProxy or Packages.HTTPSProxy could not be reached.

Possible causes and solutions:

  • The proxy server configuration in Connect may be incorrect.

    If necessary, change the Packages.HTTPProxy and Packages.HTTPSProxy configuration settings to point to the correct proxy server.

  • The proxy server may not be working or reachable on the network.

    Verify that the proxy server is working and is reachable from the Posit Connect server.

References

r-package-not-available

An R package required by the content cannot be found in the package repository.

Possible causes and solutions:

  • The R package being installed might not be available for the version of R configured on Connect.

    Install a version of R on the Connect server that matches the one being used by the publishing computer. You can identify the required R version from the deployment logs, which will contain an entry similar to this:

    Bundle requested R version 3.5.0; using /usr/lib/R/bin/R which has version 3.4.4

    In this example, the publishing computer has R 3.5.0 and the Connect server has R version 3.4.4. Installing R 3.5.0 on the Connect server alongside the existing 3.4.4 installation will allow the content to run.

  • If the publishing computer is running Windows, content may be using an R package that is not available for Linux.

    Replace the usage of any Windows-specific R packages with ones available for Linux.

  • If the publishing computer is using a different package repository from the Connect server, content may be using an R package that is not available in the repository configured on the Connect server.

    Configure the publishing computer with a package repository that is accessible via http(s) from the Connect server, such as CRAN or Posit Package Manager. Reinstall the affected packages from the new repository and publish the content again.

  • The package repository used by the Connect server may have moved to a new URL after the content was published, and Connect may be attempting to rebuild the environment using the old package repository URL.

    Ensure that the publishing computer is using a package repository that is accessible via http(s) from the Connect server, such as CRAN or Posit Package Manager. Reinstall the affected packages from the new repository and publish the content again.

References

r-package-installed-directly

A package was installed improperly on the publishing computer.

Possible causes and solutions:

  • On the computer publishing the content, an R package may have been installed directly from a download URL, using install.packages("https://.../packagename.tar.gz").

    Reinstall the affected package on the publishing computer from a configured repository such as CRAN or an instance of Posit Package Manager, for example with install.packages("packagename"), and publish the content again.

References

r-gcc-too-old

An R package must be compiled using a newer version of GCC.

Possible causes and solutions:

  • The R package being installed is a compiled C++ package which requires support for a specific language standard such as C++14, and the installed version of GCC does not support that language standard.

    Install a version of GCC which supports the required language features, as described at https://gcc.gnu.org/projects/cxx-status.html.

References

r-build-need-cxx-defined

The R package being installed is a compiled C++ package which requires support for a specific language standard such as C++14, and that support is not properly configured in the toolchain.

Possible causes and solutions:

  • A previous update to the R installation on the Connect server may not have updated the Makeconf file. This can happen if the file has been modified and you updated R using a package manager such as yum.

    Install R from source as recommended in the Posit Connect Admin Guide. Note that installing from source allows you to install multiple versions of R. This makes it easy to add new R versions as your users upgrade or install R on their computers.

  • The Connect server may lack a version of GCC which supports required features.

    Install a version of GCC which supports the required language features, as described at https://gcc.gnu.org/projects/cxx-status.html.

  • Required CXX11 or CXX14-related variables may not be defined for the version of R in use.

    The CXX11 or CXX14-related variables must be defined in the Makeconf file located at $(R RHOME)/etc/Makeconf for all installed versions of R. If a Makeconf.rpmnew file exists in this location, copy the values from there to Makeconf. Otherwise, edit the file to ensure that the required variables are defined.

References

r-cannot-access-local-repo

A local package repository could not be accessed.

Possible causes and solutions:

  • If local package repository was in use on the publishing computer which published the content, the path to that package repository may not be valid on the server.

    Configure the publishing computer with a package repository that is accessible via http(s) from the Connect server, such as CRAN or Posit Package Manager. Reinstall the affected packages from the new repository and publish the content again.

References

r-invalid-package-repository-certificate

There is a problem with the TLS certificate for the package repository (e.g. CRAN or Posit Package Manager) or outbound proxy server.

Possible causes:

  • If the repository or proxy server uses a self-signed certificate, the Posit Connect server may not be configured to trust the certificate.

    Install a trusted certificate into the Connect server’s system trust store.

  • If repository or proxy server’s certificate is signed by a private certificate authority (CA), the Posit Connect server may not be configured to trust the CA certificate.

    Install a trusted certificate into the Connect server’s system trust store.

  • The repository or proxy server certificate may be expired.

    Update the server’s certificate and install a trusted certificate into the Connect server’s system trust store.

References

r-package-version-not-available

A required R package was found in the package repository, but the specified version is not available.

Possible causes and solutions:

  • If the publishing computer is using a different package repository from the Connect server, the repository that Connect is using may not have the requested version of the package.

    Configure the publishing computer with a package repository that is accessible via http(s) from the Connect server, such as CRAN or Posit Package Manager. Reinstall the affected packages from the new repository and publish the content again.

  • The Connect server may be using a CRAN mirror that is out of date.

    Update the packages on the CRAN mirror.

    • If this is a local instance of Posit Package Manager, see the Package Manager documentation for instructions on how to update the mirrored packages.

    • If this is a public CRAN mirror, it may be experiencing technical problems. Choose a different CRAN mirror.

  • If the package repository moved to a new URL after the content was published, Connect may be attempting to rebuild the environment using the old package repository URL.

    Ensure that the publishing computer is using a package repository that is accessible via http(s) from the Connect server, such as CRAN or Posit Package Manager. Reinstall the affected packages from the new repository and publish the content again.

References

r-missing-system-library

An R package cannot be installed because a required system-level dependency is missing.

Possible cause and solutions:

  • Some R packages requires system-level dependencies, such as libraries or executables. This error occurs when these are not installed on the Connect server.

    Install the required package using your system package manager (such as apt or yum). To identify what to install:

    • If you have Posit Package Manager, open the information page for the affected R package. Installation instructions for the package’s system-level dependencies are included under the Install System Prerequisites heading.

    • Otherwise, use the messages in the deployment log to identify which system package(s) you need to install.

References

r-rcpp-precious-error

A binary package using Rcpp was compiled against Rcpp >= 1.0.7 but an older version of Rcpp is used by the content.

Package binaries compiled against Rcpp >= 1.0.7 are incompatible with older versions of Rcpp. Package binaries are compiled against the most recent version of Rcpp available at compile time.

  • If content uses a version of Rcpp < 1.0.7 and uses packages that depend on Rcpp, but a newer version of Rcpp is available on the package repository in use, content may receive package binaries that are incompatible with the version of Rcpp it uses.

    There are two ways to resolve this problem:

    • Update the publishing computer’s environment to use a version of Rcpp >= 1.0.7 and redeploy the content.

    • Reinstall all packages from an appropriate repository and redeploy this content.

Detailed instructions are available in the Posit support article Resolving Rcpp_precious_remove error.

References

r-compiler-failure

Compilation of a package has failed.

The log will contain output from the compiler describing why package compilation failed. Solutions to package compilation failures vary depending on the root of the failure too widely to list here. Refer to the documentation provided by the package and confirm the package requirements.

Possible causes:

  • You may have missing or incompatible system libraries and headers.

  • The package may be incompatible with Linux.

  • Your existing compiler toolchain may be incompatible with this package.

  • The package may require additional custom configuration to successfully compile or install.

Possible solutions:

  • A server admin may need to install additional or upgrade existing system libraries on the Posit Connect server.

  • You may need to move to a different version of the package depending upon the environment available on Posit Connect.

r-program-killed

A program has been killed during package compilation.

Possible causes:

  • Running out of memory will cause the Out Of Memory (OOM) Killer to kill running processes in order to free up memory for new memory requests.

    Reduce the memory used by the compilation process or increase the available memory. For instance:

    • Allocate more memory to the container / server running the content build command for the Posit Connect server.

    • Reduce the Server.CompilationConcurrency setting if higher than one.

    • A server admin can check that no processes on the Connect server are consuming too much memory.

  • Another process or user may have killed your process.

    Try deploying or activating this content again.

render-missing-r-package

A package is missing from the R environment.

Possible causes and solutions:

  • A package is referenced indirectly in the R code, without an explicit library() or require() call. Posit Connect may not know to install this package to the code’s environment.

    Import required libraries directly, for example, using library(tidyverse), to guarantee that Posit Connect will include them in the environment it builds.

As another example, using the greta package:

library(greta)
rdist(1:10, 1:10)

If this is run without the fields package installed, you will see:

rdist(1:10, 1:10)
#>Error: fields package must be installed to use `rdist()` on greta arrays
#>Install fields with:
#>`install.packages('fields')`

The fields package is only a “Suggests” dependency of greta. The rsconnect package does not include optional dependencies when generating the list of package requirements for your content. You must explicitly add library(fields) to make sure that dependency is seen.

References

render-r-code-error

An error occurred while running R code.

If you have previously published this content, viewers will continue to see the last successful output until the error is resolved by republishing.

Possible causes and solutions:

  • There may be a bug in the R code being deployed.

    Correct bugs in the R code, then deploy the updated content.

    • The document rendering log in Connect will contain details about the error.

    • Knitting the document in the RStudio IDE may also be helpful for debugging.

  • The R code may depend on a version of R that is not configured in Connect.

    Resolve R-version compatibility issues by installing a version of R on the Connect server matching the one used during development, then redeploy the content. In the log messages, find an entry like the following:

    Bundle requested R version 3.5.0; using /usr/lib/R/bin/R which has version 3.4.4

    This example shows that R-3.5.0 was used during development, while the closest version available to Posit Connect is R-3.4.4. In this case, R-3.5.0 should be installed on the Connect server.

  • The R code may depend on conditions that are not present in Connect. For instance, it might use files that are not available on the server, or be running as a user with the wrong permissions or settings.

    You may need to modify your code to compensate for these differences. See references for more detailed examples.

References

python-cannot-access-repo

Posit Connect cannot download a package because the Python package repository (for example, PyPI) cannot be accessed.

Possible causes and solutions:

  • There may be network problem preventing the Posit Connect server from connecting to the package repository, or the package repository might be down.

    Verify that the package repository is reachable from the Connect server.

  • If the package repository is accessed be accessed through a proxy server, the proxy server must be configured in the Connect configuration file.

    Verify that the Packages.HTTPProxy and Packages.HTTPSProxy configuration settings to point to your outbound proxy server.

  • If you have a private package repository or PyPI mirror, Posit Connect may not be not configured to use it.

    If necessary, configure /etc/pip.conf on the Connect server to provide access to your package repository.

References

python-proxy-unreachable

The proxy server specified in Packages.HTTPProxy or Packages.HTTPSProxy could not be reached.

Possible causes and solutions:

  • The proxy server configuration in Connect may be incorrect.

    If necessary, change the Packages.HTTPProxy and Packages.HTTPSProxy configuration settings to point to the correct proxy server.

  • The proxy server may not be working or reachable on the network.

    Verify that the proxy server is working and is reachable from the Posit Connect server.

References

python-invalid-package-repository-certificate

There is a problem with the TLS certificate for the Python package repository (e.g. PyPI) or outbound proxy server.

Possible causes and solutions:

  • If the repository or proxy server uses a self-signed certificate, the Posit Connect server may not be configured to trust the certificate.

    Install a trusted certificate into the Connect server’s system trust store.

  • If repository or proxy server’s certificate is signed by a private certificate authority (CA), the Posit Connect server may not be configured to trust the CA certificate.

    Install a trusted certificate into the Connect server’s system trust store.

  • The repository or proxy server certificate may be expired.

    Update the server’s certificate and install a trusted certificate into the Connect server’s system trust store.

References

python-package-not-available

A Python package required by the content cannot be found in the package repository.

Possible causes and solutions:

  • The Python package being installed might not be available for the version of Python configured on Connect.

    Install a version of Python on the Connect server that matches the one being used by the publishing computer. You can identify the required Python version from the deployment logs, which will contain an entry similar to this:

    Bundle requested Python version 3.7.0; using /opt/python/3.5.7/bin/python which has version 3.5.7

    In this example, the publishing computer has Python 3.7.0 and the Connect server has Python version 3.5.7. The recommended solution would be to install Python version 3.7.0 on the Connect server alongside the existing 3.5.7 installation.

  • If the publishing computer is running Windows, content may be using a Python package that is not available for Linux.

    Replace usage of Windows-specific Python packages with ones available for Linux.

  • If the publishing computer is using a different package repository from the Connect server, content may be using a Python package being installed is not available in the repository configured on the Connect server.

    Configure the publishing computer with a package repository that is also configured on the Connect server, such as PyPI. Reinstall the affected packages from the new repository and publish the content again.

  • The package repository used by the Connect server may have moved to a new URL after the content was published, and Connect may be attempting to rebuild the environment using the old package repository URL.

    Configure the Posit Connect server’s /etc/pip.conf to use a package repository that the server is able to access via http(s), such as PyPI. Reinstall the affected packages from the new repository and publish the content again.

References

python-package-version-not-available

A required Python package was found in the package repository, but the specified version is not available.

Possible causes and solutions:

  • If the publishing computer is using a different package repository from the Connect server, the repository that Connect is using may not have the requested version of the package.

    Configure the publishing computer with a package repository that is also configured on the Connect server, such as PyPI. Reinstall the affected packages from the new repository and publish the content again.

  • The Connect server may be using a PyPI mirror that is out of date.

    Update the packages on the PyPI mirror.

    • If this is a local package repository, see its documentation for instructions on how to update the mirrored packages.

    • If this is a public PyPI mirror, it may be experiencing technical problems. Choose a different PyPI mirror.

  • The package repository moved to a new URL after the content was published, and Connect is now attempting to rebuild the environment using the old package repository URL.

    Configure the Posit Connect server’s /etc/pip.conf to use a package repository that the server is able to access via http(s), such as PyPI. Reinstall the affected packages from the new repository and publish the content again.

References

python-missing-system-library

A Python package cannot be installed because a required system-level dependency is missing.

Possible causes and solutions:

  • A Python package requires a system-level dependency, such as a library or executable, which is not installed on the Connect server.

    Install the required package using your system package manager (such as apt or yum). Use the messages in the deployment log to identify which system package you need to install.

render-python-code-error

An error occurred while running Python code.

If you have previously published this content, viewers will continue to see the last successful output until the error is resolved by republishing.

Possible causes and solutions:

  • There may be a bug in the Python code being deployed.

    Correct bugs in the Python code, then deploy the updated content.

    • The document rendering log in Connect contains details of the error.

    • For content published from the RStudio IDE, knitting the document in the IDE may also be helpful for debugging.

    • For content published from Jupyter, running the notebook locally may help to isolate the problem.

  • The Python code may depend on a version of Python that is not configured in Connect.

    Install a version of Python on the Connect server that matches the one being used by the publishing computer, then redeploy the content. You can identify the required Python version from the log messages, which will contain an entry similar to this:

    Bundle requested Python version 3.7.0; using /opt/python/3.5.7/bin/python which has version 3.5.7

    This example shows that Python-3.7.0 was used during development, while the closest version available to Posit Connect is Python-3.5.7. In this case, Python-3.7.0 should be installed on the Connect server.

    If the version of Python used during development does not have the same major.minor version components, we recommend installing additional Python versions on your Posit Connect server.

  • The Python code may depend on conditions that are not present in Connect. For instance, it might use files that are not available on the server, or be running as a user with the wrong permissions or settings.

    You may need to modify your code to compensate for these differences. See references for more detailed examples.

References