---
title: "SQL-Toolkit - How to solve Sybase connection issues"
description: "Sybase connection issues in Geneos often result from client installation or environment variable misconfigurations. Solutions include verifying Sybase client setup, environment variables, and matching configuration files for successful database connections."
url: "https://docs.itrsgroup.com/docs/faq/geneos/360013540058-geneos-sql-toolkit-how-to-solve-sybase-connection-issues/index.html"
---
**Please check that the Sybase Client is installed properly on the Netprobe machine. This article also lists out solutions for common Sybase database error messages.**
Sybase Client installation Users should check that the Sybase Client is installed properly on the Netprobe machine. Please review the separate article: [How to solve database client installation issues in SQL-Toolkit plugin](https://docs.itrsgroup.com/docs/faq/geneos/360010913997-geneos-how-to-solve-database-client-installation-issues-in-sql-toolkit-plugin/index.html)

cs\_ctx\_alloc -> CS\_FAIL **![Screenshot](https://docscdn.itrsgroup.com/faq/images/geneos/360013540058-360011621798-mceclip0.png)**  **Scenario 1: Check if your Netprobe process has enough file descriptors.**  Netprobe log entries that show it has insufficient file descriptors:  <Wed Jun 7 18:11:22> ERROR: VERITAS-CLUSTER-SERVER Failed: Problem executing hastatus command to check status of veritas [hastatus -summ] <Wed Jun 7 18:11:22> ERROR: PROCESSES Could not get the number of logical processors (24) <Wed Jun 7 18:12:22> ERROR: Failed to execute Processes Gateway - plugin PROCESSES timed out <Wed Jun 7 18:12:22> INFO: CONMGR Details: checkListenPortActivity(); ; 24; -890; accept() failed; <Wed Jun 7 18:12:22> ERROR: PROCESSES Could not get the number of logical processors (24)  **Scenario 2: Ensure the Sybase client *locales* folder and the current session's *$LANG* variable have no issues.**  Example error log entry:  <Mon Apr 8 18:29:27> WARN: Event:DatabaseLogging 1554719367.064086 DatabaseLogging /geneos/gateway[@name="MNL\_PUGO\_GATEWAY\_9370"] Connection Failed There was a problem connecting => db error msg: cs\_ctx\_alloc -> CS\_FAIL, db error code: -1 (type: LIBRARY) [-1] cs\_ctx\_alloc -> CS\_FAIL LIBRARY  Things to do:

1. The **SYBASE** environment variable must point to the directory where the **locales** folder is located.

2. The locales folder must be present.

3. The current value of the Netprobe session's **$LANG** variable does not match any value in **locales/locales.dat**. Below shows how to check this:
- Check the session's LANG

```
[sandbox@lawin sybase]$ echo $LANG en_US.UTF-8
```

- Get the values in the locales.dat file

```
[sandbox@lawin sybase]$ grep "en_US.UTF-8" locales/locales.dat locale = en_US.UTF-8, us_english, utf8 locale = en_US.UTF-8, us_english, utf8 locale = en_US.UTF-8, us_english, utf8
```

4. To modify the value of the Netprobe's $LANG environment variable, add the following command in the Netprobe start script:

```
export LANG=en_US.UTF-8
```
cs\_ctx\_alloc -> CS\_MEM\_ERROR(-1) While the message appears to be memory allocation related, several users reported that this could be caused by Sybase client installation issues.  Users should be particularly mindful if the machine is installed with more than one version of Sybase client. Please check that the **SYBASE**, **SYBASE\_LIB**, **SYBASE\_LIB3P64** and **LD\_LIBRARY\_PATH** environment variables are pointing to the same Sybase client installation correctly.

Fail - ct\_connect(): directory service layer: internal directory control layer error: Requested server name not found. ![Screenshot](https://docscdn.itrsgroup.com/faq/images/geneos/360013540058-360011621838-mceclip1.png)  The error means that the entry in the sampler's **interfaceName** setting does not match the value in the **interfaces** file found in the **$SYBASE** home directory.  **Solution:**  Check the sampler and the said file, as well as the $SYBASE environment variable of your Netprobe's startup script.
Fail - ct\_connect(): protocol specific layer: internal Client Library error: There is a tds login error. The installed encryption handler returned a status that was not CS\_SUCCEED Starting GA3.8.0, the protocol used by the Gateway and Netprobe to connect to a Sybase database has been modified to support a Sybase database that requires password encryption. The libraries that enable the said protocol are located in Sybase's *lib3p64* folder. The libraries are a prerequisite regardless if the database is requiring password encryption or not.  **Solution:**

- Please check the LD\_LIBRARY\_PATH environment variable in the Netprobe startup script. It should include the absolute path of Sybase's lib3p64 folder.
Fail - ct\_connect(): user api layer: external error: The connection failed because of invalid or missing external configuration data. This happens when an **ocs.cfg** file is present and the Sybase (or SAP ASE) client's application name is not found in the said file.  **Solution:**

- Netprobes prior GA4.X, the error can be addressed by removing the ocs.cfg file. - On a GA4.X Netprobe, this can be addressed by adding an application name in the plug-in's *applicationName* setting and then adding the same value in the ocs.cfg file:
Geneos - SQL-Toolkit - How to solve Sybase connection issues
Fail - ct\_con\_props(): user api layer: external error: An illegal value of 9213 given for parameter property.(16843013) This error may happen with an outdated Sybase client version. Please review the [Compatibility Matrix](https://docs.itrsgroup.com/docs/all/release-notes/index.html) if the Netprobe and Sybase versions are supported.
Further Reading Please kindly check the following guides:

- [Geneos SQL-Toolkit plugin documentation](https://docs.itrsgroup.com/docs/geneos/current/collection/sql-toolkit/index.html)


