Sybase DB connection for virtual graphs

Hi,
I'm trying to add a new virtual graph which connects to a Sybase database:
stardog-admin --krb5 --server http://xxx:6820 virtual add ./sybase.properties ./issues-mapping.sms

My properties file looks like this:
jdbc.url=jdbc:jtds:sybase://XYZ/DBname
jdbc.driver=com.sybase.jdbc4.jdbc.SybDriver

But I keep getting this error:
WARN 2020-05-13 14:00:50,097 [main] org.apache.http.impl.client.TargetAuthenticationStrategy:select(183): Authentication scheme Basic not supported
java.sql.SQLException: Driver:com.sybase.jdbc4.jdbc.SybDriver@1b366f2b returned null for URL:jdbc:jtds:sybase://xxx/DBname

What could be the issue here? Is it the URL string or driver not being picked up?

Thanks

Hi!

The JDBC URL when using the Sybase JDBC driver (not jTDS) should look something like: jdbc:sybase:Tds:XYZ:5000.

Jess

Thanks. That problem is resolved but now I'm getting another issue bellow, I'm using kerberos

WARN  2020-05-13 18:54:41,043 [main] org.apache.http.impl.client.TargetAuthenticationStrategy:select(183): Authentication scheme Basic not supported
JZ00L: Login failed.  Examine the SQLWarnings chained to this exception for the reason(s).

The Kerberos protocol is only used to authenticate the Stardog client to the server and won't (shouldn't!) have any impact on the Sybase connection. Can you check for details on this error in the stardog.log file on the server?

These are the logs for that error:

ERROR 2020-05-13 17:54:41,262 [stardog-user-6] com.complexible.stardog.virtual.DefaultVirtualGraphRegistry:createVirtualGraph(368): Cannot initialize virtual graph sybase
java.lang.RuntimeException: java.sql.SQLException: JZ00L: Login failed.  Examine the SQLWarnings chained to this exception for the reason(s).
        at com.complexible.stardog.virtual.vega.rdbms.RdbmsDataSource.lambda$connect$0(RdbmsDataSource.java:61) ~[stardog-virtual-core-7.2.1.jar:?]
        at com.complexible.stardog.virtual.vega.RuntimeDriverLoader.executeUnderClassLoader(RuntimeDriverLoader.java:130) ~[stardog-virtual-core-7.2.1.jar:?]
        at com.complexible.stardog.virtual.vega.rdbms.RdbmsDataSource.connect(RdbmsDataSource.java:56) ~[stardog-virtual-core-7.2.1.jar:?]
        at com.complexible.stardog.virtual.vega.rdbms.RdbmsVirtualGraphFactory.create(RdbmsVirtualGraphFactory.java:65) ~[stardog-virtual-core-7.2.1.jar:?]
        at com.complexible.stardog.virtual.vega.rdbms.RdbmsVirtualGraphFactory.create(RdbmsVirtualGraphFactory.java:49) ~[stardog-virtual-core-7.2.1.jar:?]
        at com.complexible.stardog.virtual.DefaultVirtualGraphRegistry.createVirtualGraph(DefaultVirtualGraphRegistry.java:365) ~[stardog-virtual-core-7.2.1.jar:?]
        at com.complexible.stardog.virtual.DefaultVirtualGraphRegistry.createVirtualGraph(DefaultVirtualGraphRegistry.java:346) ~[stardog-virtual-core-7.2.1.jar:?]
        at com.complexible.stardog.virtual.DefaultVirtualGraphRegistry.add(DefaultVirtualGraphRegistry.java:211) ~[stardog-virtual-core-7.2.1.jar:?]
        at com.complexible.stardog.virtual.SecuredVirtualGraphRegistry.add(SecuredVirtualGraphRegistry.java:149) ~[stardog-virtual-core-7.2.1.jar:?]
        at com.complexible.stardog.protocols.http.server.virtual.admin.VirtualGraphHttpService.addVG(VirtualGraphHttpService.java:414) ~[stardog-virtual-protocols-http-server-7.2.1.jar:?]
        at com.complexible.stardog.protocols.http.server.virtual.admin.VirtualGraphHttpService.add(VirtualGraphHttpService.java:213) ~[stardog-virtual-protocols-http-server-7.2.1.jar:?]
        at com.stardog.http.server.undertow.jaxrs.ExtractRoutes.lambda$handleIt$5(ExtractRoutes.java:192) ~[stardog-protocols-http-server-7.2.1.jar:?]
        at org.apache.shiro.subject.support.SubjectRunnable.doRun(SubjectRunnable.java:120) [shiro-core-1.3.0.jar:1.3.0]
        at org.apache.shiro.subject.support.SubjectRunnable.run(SubjectRunnable.java:108) [shiro-core-1.3.0.jar:1.3.0]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_192]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_192]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_192]
Caused by: java.sql.SQLException: JZ00L: Login failed.  Examine the SQLWarnings chained to this exception for the reason(s).
        at com.sybase.jdbc4.jdbc.ErrorMessage.raiseError(ErrorMessage.java:832) ~[?:?]
        at com.sybase.jdbc4.tds.Tds.processLoginAckToken(Tds.java:5561) ~[?:?]
        at com.sybase.jdbc4.tds.Tds.doLogin(Tds.java:727) ~[?:?]
        at com.sybase.jdbc4.tds.Tds.login(Tds.java:581) ~[?:?]
        at com.sybase.jdbc4.jdbc.SybConnection.tryLogin(SybConnection.java:530) ~[?:?]
        at com.sybase.jdbc4.jdbc.SybConnection.handleHAFailover(SybConnection.java:3824) ~[?:?]
        at com.sybase.jdbc4.jdbc.SybConnection.<init>(SybConnection.java:382) ~[?:?]
        at com.sybase.jdbc4.jdbc.SybConnection.<init>(SybConnection.java:282) ~[?:?]
        at com.sybase.jdbc4.jdbc.SybDriver.connect(SybDriver.java:245) ~[?:?]
        at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:319) ~[tomcat-jdbc-9.0.24.jar:?]
        at org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:212) ~[tomcat-jdbc-9.0.24.jar:?]
        at org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:744) ~[tomcat-jdbc-9.0.24.jar:?]
        at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:676) ~[tomcat-jdbc-9.0.24.jar:?]
        at org.apache.tomcat.jdbc.pool.ConnectionPool.init(ConnectionPool.java:483) ~[tomcat-jdbc-9.0.24.jar:?]
        at org.apache.tomcat.jdbc.pool.ConnectionPool.<init>(ConnectionPool.java:154) ~[tomcat-jdbc-9.0.24.jar:?]
        at org.apache.tomcat.jdbc.pool.DataSourceProxy.pCreatePool(DataSourceProxy.java:118) ~[tomcat-jdbc-9.0.24.jar:?]
        at org.apache.tomcat.jdbc.pool.DataSourceProxy.createPool(DataSourceProxy.java:107) ~[tomcat-jdbc-9.0.24.jar:?]
        at org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:131) ~[tomcat-jdbc-9.0.24.jar:?]
        at com.complexible.stardog.virtual.vega.rdbms.RdbmsDataSource.lambda$connect$0(RdbmsDataSource.java:58) ~[stardog-virtual-core-7.2.1.jar:?]

Are you able to connect from the same host with another client application using the same username and password?

Yes I'm able to connect to the same database using DBArtisan using my id and password.

And you've set jdbc.username and jdbc.password in the properties file?

Yes i did set those 2.

Unfortunately, I don't have much more to go on here. I would suggest consulting your DBA for advice.

Ok thank you. I will check with our DBA.

Let us know how it turns out. If you're still having issues, please open a support ticket to support@stardog.com and we can do some deeper debugging.

I did resolve that problem but now I get this error, any idea what this means:

ERROR 2020-05-14 10:28:09,604 [stardog-user-6] com.complexible.stardog.virtual.DefaultVirtualGraphRegistry:createVirtualGraph(368): Cannot initialize virtual graph sybase
java.lang.RuntimeException: java.sql.SQLException: JZ0GS: A Generic Security Services API exception occurred. The major error code is 13.
The major error message is: No valid credentials provided
The minor error code is -1.
The minor error message is: Failed to find any Kerberos tgt

My jdbc url looks like this:
jdbc.url=jdbc:sybase:Tds:vixxx.yyy.ms.com:10xxx/Sybase?JCONNECT_VERSION=6&REQUEST_KERBEROS_SESSION=true&SERVICE_PRINCIPAL_NAME=sybase/vixxx.yyy.ms.com

Can you run kinit sybase/vixxx.yyy.ms.com@DEFAULTRELM.COM replacing DEFAULTRELM.COM with your actual default realm or I think you can leave it off depending on your config.

I get this:
kinit(v5): Password incorrect while getting initial credentials
No AFS or NFS tokens obtained.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.