A SAS® Visual Investigator Alert Generation flow fails with "libpq.so.5: cannot open shared object file: No such file or directory"


The SAS Visual Investigator Alert Generation Process (AGP) job flows fail during execution with the following error:

The job "xxxxx" failed.  Error: The job failed for the flow "xxxxx". Error: Creating the flow version could not be completed. Reason: The data source "vsd_event_history" does not exist for the Cloud Analytic Services library "VSD_EVENT_STORE_xxxxxx".

 
Reviewing the sas-svi-vsd logs shows the actual error during the time of the job failure:
 
com.sas.cas.CASException: Function failed. (severity=2 reason=0 statusCode=310002)
5 ERROR: The connection to the data source driver failed.
5 ERROR: Unable to load extension: (tkepgres)
5 ERROR: Extension Load Failure: OS Error: -1 (libpq.so.5: cannot open shared object file: No such file or directory)
5 ERROR: Could not load tkepgres Extension.
5 ERROR: Function failed.
5 ERROR: The action stopped due to errors.
debug=0x80fff802:TKTS_ERROR 
 
2026-09-25 13:23:16.787 ERROR 3386924 --- [lTaskExecutor-7] com.sas.svi.commons.cas.CASSession       : svc_sas_amluser@@aml(ae325ade-1340-4e18-9d1d-ae569ac7d49a) [26c66adaffceef62] CAS: columnInfo: ERROR: The connection to the data source driver failed.

2026-09-25 13:23:16.787 ERROR 3386924 --- [lTaskExecutor-7] com.sas.svi.commons.cas.CASSession       : svc_sas_amluser@@aml(ae325ade-1340-4e18-9d1d-ae569ac7d49a) [26c66adaffceef62] CAS: columnInfo: ERROR: Unable to load extension: (tkepgres)

2026-09-25 13:23:16.787 ERROR 3386924 --- [lTaskExecutor-7] com.sas.svi.commons.cas.CASSession       : svc_sas_amluser@@aml(ae325ade-1340-4e18-9d1d-ae569ac7d49a) [26c66adaffceef62] CAS: columnInfo: ERROR: Extension Load Failure: OS Error: -1 (libpq.so.5: cannot open shared object file: No such file or directory)

2026-09-25 13:23:16.787 ERROR 3386924 --- [lTaskExecutor-7] com.sas.svi.commons.cas.CASSession       : svc_sas_amluser@@aml(ae325ade-1340-4e18-9d1d-ae569ac7d49a) [26c66adaffceef62] CAS: columnInfo: ERROR: Could not load tkepgres Extension.
 
The job "xxxxxxxx" failed. Error: The job failed for the flow "xxxxxxxxx". Error: Creating the flow version could not be completed. Reason: The data source "vsd_event_history" does not exist for the Cloud Analytic Services library "VSD_EVENT_STORE_xxxxxxxx".
NotFoundException: The data source "vsd_event_history" does not exist for the Cloud Analytic Services library "VSD_EVENT_STORE_xxxxxxx".
 
The data source "vsd_event_history" does not exist for the Cloud Analytic Services library "VSD_EVENT_STORE_xxxxxxxx".
NotFoundException: The data source "vsd_event_history" does not exist for the Cloud Analytic Services library "VSD_EVENT_STORE_xxxxxxxx".
 
In some scenarios, errors also occur with other PostgreSQL client shared libraries, such as psqlodbcw.so

Cause

The PostgreSQL client shared library libpq.so.5 or psqlodbcw.so is either of the following:

Resolution

1. Verify whether libpq.so.5 exists.

On every SAS® Anti-Money Laundering CAS node, verify whether the PostgreSQL library is installed.

    1. Find / -name "libpq.so.5" 2>/dev/null.
    2. Locate libpq.so.5 and verify the output path OR use sudo find / -name libpq.so*.

Here is an example:

Optionally, validate the library:
 
ls -lrth <path_to_libpq.so.5>
 
ldd <path_to_libpq.so.5>
 

2. Verify whether the LD_LIBRARY_PATH environment contains the path that you located after running the command in Step #1.

Confirm that the directory that contains libpq.so.5 is included in the CAS process environment.

env | grep LD_LIBRARY_PATH

If the directory is missing, update the CAS configuration in Step 3.

Note: You need to complete the steps below only if the libpq.so.5 file exists but is not present under the cas_usermods.settings file. If the libpq.so.5 file is not present at all or is missing, then the fix below will not work.

 

3. Update the CAS Configuration.

On every SAS Anti-Money Laundering CAS node, update the following files using the text editor:

    • /opt/sas/aml/config/etc/cas/default/cas_usermods.settings
    • /opt/sas/viya/config/etc/cas/default/cas_usermods.settings

Append the PostgreSQL library location while preserving existing Oracle library entries:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:<directory_containing_libpq.so.5>

Here is an example:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/sas/viya/home/postgresql15/lib64

 
 
4. Restart the CAS Controller.
 
5. Run the following command at both locations (/opt/sas/aml/config/etc/cas/default/ and /opt/sas/viya/config/etc/cas/default/) and verify whether you see the libpq.so.5 file path.

Identify the CAS process ID and verify that the updated library path loads.

       tr '\0' '\n' < /proc/<cas_pid>/environ | grep LD_LIBRARY_PATH

The output should look similar to the following:

Under LD_LIBRARY_PATH, the libpq.so.5 file is present at the end the file path (that is, /opt/sas/viya/home/postgresql15/lib64), which is correct.
 
6. Rerun AGP.