<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: Connection Issues from Python to SAP SQLAnywhere Usin... in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/connection-issues-from-python-to-sap-sqlanywhere-using-odbc-driver/qaa-p/13924698#M4890635</link>
    <description>&lt;P&gt;Dear Chris_Keating,&lt;/P&gt;&lt;P&gt;Thank you for your prompt response and guidance regarding my issue. I took your advice into account and examined the environment variables and configurations between the working and non-working setups.&lt;/P&gt;&lt;P&gt;This comparison allowed me to identify discrepancies and properly adjust the non-working environment. However, despite these changes, I still faced connection issues and continued to encounter errors when using sqlanydb. To troubleshoot further, I attempted to connect using an alternative library, pyodbc, and successfully established a connection.&lt;/P&gt;&lt;P&gt;Thank you again for your assistance!&lt;/P&gt;</description>
    <pubDate>Thu, 31 Oct 2024 08:30:29 GMT</pubDate>
    <dc:creator>Oksana_Odoo</dc:creator>
    <dc:date>2024-10-31T08:30:29Z</dc:date>
    <item>
      <title>Connection Issues from Python to SAP SQLAnywhere Using ODBC Driver</title>
      <link>https://community.sap.com/t5/technology-q-a/connection-issues-from-python-to-sap-sqlanywhere-using-odbc-driver/qaq-p/13923826</link>
      <description>&lt;P align="left"&gt;I am experiencing connection issues when trying to connect to my SAP SQLAnywhere 17 database from Python using the &lt;FONT color="#188038"&gt;&lt;FONT face="Roboto Mono, serif"&gt;sqlanydb&lt;/FONT&gt;&lt;/FONT&gt; package (version 1.0.11) and the ODBC driver (&lt;FONT color="#188038"&gt;&lt;FONT face="Roboto Mono, serif"&gt;libdbodbc17_r.so&lt;/FONT&gt;&lt;/FONT&gt;). The connection works in some contexts but fails in others. Here are the details:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P align="left"&gt;&lt;STRONG&gt;System Information:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P align="left"&gt;&lt;STRONG&gt;Operating System:&lt;/STRONG&gt; Ubuntu 24&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P align="left"&gt;&lt;STRONG&gt;Python Version:&lt;/STRONG&gt; 3.10&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P align="left"&gt;&lt;STRONG&gt;SAP SQLAnywhere Version:&lt;/STRONG&gt; 17&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P align="left"&gt;&lt;STRONG&gt;ODBC Driver Version:&lt;/STRONG&gt; unixODBC 2.3.12&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P align="left"&gt;&lt;STRONG&gt;sqlanydb Library Version:&lt;/STRONG&gt; 1.0.11&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P align="left"&gt;&lt;STRONG&gt;Error Details:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P align="left"&gt;When attempting to initialize the connection, the application encounters an error at &lt;FONT color="#188038"&gt;&lt;FONT face="Roboto Mono, serif"&gt;sqlany_init_ex&lt;/FONT&gt;&lt;/FONT&gt;, indicating a possible issue with the DB API context initialization.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P align="left"&gt;&lt;FONT color="#188038"&gt;&lt;FONT face="Roboto Mono, serif"&gt;ValueError: NULL pointer access&lt;/FONT&gt;&lt;/FONT&gt; is displayed in the debug logs when initializing &lt;FONT color="#188038"&gt;&lt;FONT face="Roboto Mono, serif"&gt;dbcapi&lt;/FONT&gt;&lt;/FONT&gt;.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P align="left"&gt;&lt;STRONG&gt;Environment Configuration:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P align="left"&gt;&lt;STRONG&gt;ODBCINI=&lt;/STRONG&gt;/etc/odbc.ini&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P align="left"&gt;&lt;STRONG&gt;ODBCSYSINI=&lt;/STRONG&gt;/etc&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P align="left"&gt;&lt;STRONG&gt;SQLANY17=&lt;/STRONG&gt;/opt/sqlanywhere17&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P align="left"&gt;&lt;STRONG&gt;LD_LIBRARY_PATH=&lt;/STRONG&gt;/opt/sqlanywhere17/lib64:/opt/sqlanywhere17/lib32:/opt/sqlanywhere17/bin64/jre180/lib/amd64/client:/opt/sqlanywhere17/bin64/jre180/lib/amd64/server:/opt/sqlanywhere17/bin64/jre180/lib/amd64:/opt/sqlanywhere17/bin64/jre180/lib/amd64/native_threads:/opt/sqlanywhere17/lib64:/opt/sqlanywhere17/lib32:/opt/sqlanywhere17/bin64/jre180/lib/amd64/client:/opt/sqlanywhere17/bin64/jre180/lib/amd64/server:/opt/sqlanywhere17/bin64/jre180/lib/amd64:/opt/sqlanywhere17/bin64/jre180/lib/amd64/native_threads:&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P align="left"&gt;Relevant paths in &lt;FONT color="#188038"&gt;&lt;FONT face="Roboto Mono, serif"&gt;/etc/odbcinst.ini&lt;/FONT&gt;&lt;/FONT&gt; and &lt;FONT color="#188038"&gt;&lt;FONT face="Roboto Mono, serif"&gt;/etc/odbc.ini&lt;/FONT&gt;&lt;/FONT&gt;:&lt;/P&gt;&lt;P align="left"&gt;&lt;BR /&gt;&lt;FONT color="#188038"&gt;&lt;FONT face="Roboto Mono, serif"&gt;[SQL Anywhere 17]&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;FONT color="#188038"&gt;&lt;FONT face="Roboto Mono, serif"&gt;Description=SAP SQL Anywhere 17 ODBC Driver&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;FONT color="#188038"&gt;&lt;FONT face="Roboto Mono, serif"&gt;Driver=/opt/sqlanywhere17/lib64/libdbodbc17_r.so&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;FONT color="#188038"&gt;&lt;FONT face="Roboto Mono, serif"&gt;Setup=/opt/sqlanywhere17/lib64/libdbodbc17_r.so&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P align="left"&gt;&amp;nbsp;&lt;/P&gt;&lt;P align="left"&gt;&lt;FONT color="#188038"&gt;&lt;FONT face="Roboto Mono, serif"&gt;[SQLRemote]&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;FONT color="#188038"&gt;&lt;FONT face="Roboto Mono, serif"&gt;Driver=/opt/sqlanywhere17/lib64/libdbodbc17_r.so&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;FONT color="#188038"&gt;&lt;FONT face="Roboto Mono, serif"&gt;ServerName=XXX&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;FONT color="#188038"&gt;&lt;FONT face="Roboto Mono, serif"&gt;DatabaseName=xxxxxx&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;FONT color="#188038"&gt;&lt;FONT face="Roboto Mono, serif"&gt;CommLinks=tcpip(host=xx.xxx.xxx.xxx;port=18163)&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;FONT color="#188038"&gt;&lt;FONT face="Roboto Mono, serif"&gt;UID=xxxxx&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;FONT color="#188038"&gt;&lt;FONT face="Roboto Mono, serif"&gt;PWD=xxxxx&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P align="left"&gt;Tried switching between &lt;FONT color="#188038"&gt;&lt;FONT face="Roboto Mono, serif"&gt;libdbodbc17_r.so&lt;/FONT&gt;&lt;/FONT&gt; and &lt;FONT color="#188038"&gt;&lt;FONT face="Roboto Mono, serif"&gt;libdbcapi_r.so&lt;/FONT&gt;&lt;/FONT&gt;, but the issue persists.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P align="left"&gt;&lt;STRONG&gt;Additional Observations:&lt;/STRONG&gt;&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P align="left"&gt;&lt;STRONG&gt;Successful Terminal Connection:&lt;/STRONG&gt; I can successfully connect to the database from the terminal using &lt;FONT color="#188038"&gt;&lt;FONT face="Roboto Mono, serif"&gt;isql&lt;/FONT&gt;&lt;/FONT&gt; after sourcing the &lt;FONT color="#188038"&gt;&lt;FONT face="Roboto Mono, serif"&gt;sa_config.sh&lt;/FONT&gt;&lt;/FONT&gt; file:&lt;BR /&gt;&lt;FONT color="#188038"&gt;&lt;FONT face="Roboto Mono, serif"&gt;root@computer:/# source /opt/sqlanywhere17/bin64/sa_config.sh&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;FONT color="#188038"&gt;&lt;FONT face="Roboto Mono, serif"&gt;root@computer:/# strace -t -f -o trace_out.txt isql -v SQLRemote xxxxxx xxxxxx&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;OL&gt;&lt;UL&gt;&lt;LI&gt;&lt;P align="left"&gt;This terminal connection returns a successful connection message, indicating that the database configuration and credentials are correct. The issue appears specific to the Python environment or interaction with &lt;FONT color="#188038"&gt;&lt;FONT face="Roboto Mono, serif"&gt;sqlanydb&lt;/FONT&gt;&lt;/FONT&gt;.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/OL&gt;&lt;P align="left"&gt;&amp;nbsp;&lt;/P&gt;&lt;H3&gt;&lt;FONT color="#000000"&gt;&lt;FONT size="3"&gt;&lt;STRONG&gt;Requested Assistance:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/H3&gt;&lt;UL&gt;&lt;LI&gt;&lt;P align="left"&gt;Could you help identify any potential configuration issues that might cause &lt;FONT color="#188038"&gt;&lt;FONT face="Roboto Mono, serif"&gt;sqlanydb&lt;/FONT&gt;&lt;/FONT&gt; to fail while &lt;FONT color="#188038"&gt;&lt;FONT face="Roboto Mono, serif"&gt;isql&lt;/FONT&gt;&lt;/FONT&gt; connects successfully?&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P align="left"&gt;Are there known compatibility issues with SQLAnywhere 17, &lt;FONT color="#188038"&gt;&lt;FONT face="Roboto Mono, serif"&gt;sqlanydb&lt;/FONT&gt;&lt;/FONT&gt; 1.0.11, and unixODBC 2.3.12?&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P align="left"&gt;Are additional debugging steps or logs I should review to help identify the issue?&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P align="left"&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Oct 2024 12:27:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/connection-issues-from-python-to-sap-sqlanywhere-using-odbc-driver/qaq-p/13923826</guid>
      <dc:creator>Oksana_Odoo</dc:creator>
      <dc:date>2024-10-30T12:27:16Z</dc:date>
    </item>
    <item>
      <title>Re: Connection Issues from Python to SAP SQLAnywhere Using ODBC Driver</title>
      <link>https://community.sap.com/t5/technology-q-a/connection-issues-from-python-to-sap-sqlanywhere-using-odbc-driver/qaa-p/13924364#M4890595</link>
      <description>In the same context that you execute python, I would run ldd on both libdbcapi_r.so and libdbcapi.so to ensure that all libraries are resolved. I would also compare the working and non-working environments for completeness.</description>
      <pubDate>Thu, 31 Oct 2024 00:10:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/connection-issues-from-python-to-sap-sqlanywhere-using-odbc-driver/qaa-p/13924364#M4890595</guid>
      <dc:creator>chris_keating</dc:creator>
      <dc:date>2024-10-31T00:10:30Z</dc:date>
    </item>
    <item>
      <title>Re: Connection Issues from Python to SAP SQLAnywhere Usin...</title>
      <link>https://community.sap.com/t5/technology-q-a/connection-issues-from-python-to-sap-sqlanywhere-using-odbc-driver/qaa-p/13924698#M4890635</link>
      <description>&lt;P&gt;Dear Chris_Keating,&lt;/P&gt;&lt;P&gt;Thank you for your prompt response and guidance regarding my issue. I took your advice into account and examined the environment variables and configurations between the working and non-working setups.&lt;/P&gt;&lt;P&gt;This comparison allowed me to identify discrepancies and properly adjust the non-working environment. However, despite these changes, I still faced connection issues and continued to encounter errors when using sqlanydb. To troubleshoot further, I attempted to connect using an alternative library, pyodbc, and successfully established a connection.&lt;/P&gt;&lt;P&gt;Thank you again for your assistance!&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2024 08:30:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/connection-issues-from-python-to-sap-sqlanywhere-using-odbc-driver/qaa-p/13924698#M4890635</guid>
      <dc:creator>Oksana_Odoo</dc:creator>
      <dc:date>2024-10-31T08:30:29Z</dc:date>
    </item>
  </channel>
</rss>

