Troubleshooting RStudio Professional Drivers#
Keeping ODBC drivers up to date
We strongly recommend upgrading drivers to prevent security and administrative issues. Drivers should be updated system-wide with at least the same frequency as other RStudio products. See Upgrade RStudio Professional Drivers for more info.
Please review the following sections that are appropriate for your distribution prior to contacting support:
If you are having problems connecting to your databases from RStudio, it’s likely that your system is not configured properly.
We recommend completing the following steps before contacting support:
- Make sure you've followed any additional steps for your specific driver
listed in the installation
For example, when using the Oracle driver, this means downloading and configuring the Oracle Instant Client.
- Test your connection from the command line with the
isqltool, which is part of unixODBC. You will have to set up a data source name (DSN) first.
- Check your configuration files for typos and other missed configurations.
Driver paths are stored in
odbcinst.ini. DSN's are stored in
odbc.ini. You can locate these files with the
- Examine specific driver dependencies with the
- Enable driver logging to identify problems when a new connection is created.
Testing a database connection outside of R#
You should test your database connections from the command line before creating new connections in RStudio.
You can test connections by running
isql, a command line tool for interactive SQL.
isqlrequires you to create a data source name (DSN) first.
To create a new DSN, open
odbc.iniin a text editor and create a new test entry:File:
[test] Driver = SQLServer Server = my.server.name Database = dbname Port = 1433
The driver entry in the DSN should point to the corresponding driver name or path listed in
To test this connection from a terminal enter:Terminal
$ isql -v test
Finding ODBC configuration files#
ODBC configuration files are typically located in
You can find the
location of your specific
odbcinst.ini files by running the
odbcinst -j command:
$ odbcinst -j unixODBC 2.3.1 DRIVERS............: /etc/odbcinst.ini SYSTEM DATA SOURCES: /etc/odbc.ini FILE DATA SOURCES..: /etc/ODBCDataSources USER DATA SOURCES..: /root/.odbc.ini SQLULEN Size.......: 8 SQLLEN Size........: 8 SQLSETPOSIROW Size.: 8
Identifying ODBC driver dependencies#
- ODBC drivers on Linux are shared objects with filenames ending in
- You can print the shared object dependencies with the
- This is useful in identifying missing dependencies.
$ ldd sqlserver/bin/lib/libsqlserverodbc_sb64.so linux-vdso.so.1 => (0x00007fff4ffe2000) libdl.so.2 => /lib64/libdl.so.2 (0x00007f96c8b4e000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f96c8932000) librt.so.1 => /lib64/librt.so.1 (0x00007f96c8729000) libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f96c8421000) libm.so.6 => /lib64/libm.so.6 (0x00007f96c811f000) libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f96c7f08000) libc.so.6 => /lib64/libc.so.6 (0x00007f96c7b47000) /lib64/ld-linux-x86-64.so.2 (0x00007f96cb7ba000)
Enabling driver logging#
You can enable driver logging to track activity and troubleshoot issues:
- In a text editor, open your driver configuration file found in the
bin/libsubdirectory of the driver installation path (e.g.,
- Set values for
LogLevel(e.g., 6) and
- Ensure that users have permissions to write files to the path specified
UseLogPrefix=1to create a unique log for every user and process with a connection.
Logging decreases performance and can consume a large quantity of disk space; only enable logging long enough to capture an issue:
[Driver] LogLevel=6 LogPath=/tmp UseLogPrefix=1
Opening a support ticket#
If the steps above did not identify and resolve the connection issue, please reach out to email@example.com and include the following:
- Specific error you're seeing
- The command that is generating the error, the DSN definition (found
odbc.ini) being used
- The resulting driver log files.
- Feel free to remove any sensitive information (username, password) from the DSN file.
For more information about opening a support ticket, please see the RStudio Support documentation.
The Connections pane doesn't show installed drivers#
If you're using RStudio Workbench, the Connections pane can be used to establish connections to external sources.
- When you click on New Connection, you should be presented with a list of existing DSNs along with all installed ODBC drivers.
- If the list of ODBC drivers is missing, it's likely due to
- If that file contains lines that read
Installer = RStudio, change them to read
Installer = RStudio Pro Driversand the drivers should properly show up in the New Connection window within RStudio Workbench.
If you are having trouble connecting to a database from RStudio Desktop Pro on macOS, the Linux troubleshooting steps above also apply.
- On macOS, system
data source names (DSNs) are defined at
- For the corresponding
RStudio version, drivers are installed to:
- RStudio <=1.3:
- RStudio 1.4+:
- RStudio <=1.3:
Make sure you've followed any additional steps for your specific driver listed in the installation documentation. For example, when using the Oracle driver this means downloading and configuring the Oracle Instant Client.
Windows uses the ODBC Data Source Administrator to manage ODBC drivers. Testing connections can be done from the ODBC Data Source Administrator, and driver logging can be enabled with the following steps:
- To access logging options, open the ODBC Data Source Administrator where you created the DSN and select the DSN.
- Select Configure and then click Logging Options.
- From the Log Level drop-down menu, select the desired level of information to include in log files.
- In the Log Path field, type the full path to the folder where you want to save log files.
- In the Max Number Files field, type the maximum number of log files to keep. After the maximum number of log files is reached, each time and additional file is created, the driver deletes the oldest log file.
- In the Max File Size field, type the maximum size of each log file in megabytes (MB). After the maximum file size is reached, the driver creates a new file and continues logging.
- Click OK.
- Retry the connection.
The driver will produce log output at the location provided to the Log Path
field. If you enable the
UseLogPrefix connection property, the driver
prefixes the log file name with the user name associated with the connection
and the process ID of the application through which the connection is made.
If the steps above did not identify and resolve the connection issue, please reach out to firstname.lastname@example.org and include the specific error you're seeing, the command that is generating the error, the DSN definition being used, and the resulting driver log files. Feel free to remove any sensitive information (username, password) from the DSN definition.