Closed gpow81 closed 1 year ago
@gpow81 So for NTLM, it's not necessary to enable encryption, having encrypt=false
is just fine.
Does linux need to be a member of the windows domain?
Yes, your client linux machine needs to be part of the domain. Since you confirmed your linux machine is domain joined, the one other reason I can think of as to why it failed to connect is because of your connection string. Try the following connection string instead:
jdbc:sqlserver://<your-server's-FQDN>:port;DatabaseName=db_name;encrypt=false;integratedSecurity=true;user=blabla;password=blabla;authenticationScheme=NTLM
So, exclude the domain=MYDOMAIN
property/value pair, and rather have the domain name included in the server field in the connection string.
Can you also provide more details, what driver version are you using and JDK version? Could you also provide the SQL Server logs as well when that error occurs? Thanks.
I realize you confirmed you're domain joined, but just for my own confirmation can you verify by running realm list
on your linux client?
Thank you for your help. Unfortunately removing the domain property and adding to the server name did not change the error. This linux (SLES15) server didn't have realm used/installed for domain join. There is a net tool which I believe might have been used to join the domain. And allows me to show some information (I replaced the actual vales):
net ads info LDAP server: 192.x.x.x LDAP server name: host.domain.com Realm: DOMAIN.COM Bind Path: dc=DOMAIN,dc=COM LDAP port: 389 Server time: Fri, 12 May 2023 14:53:54 CDT KDC server: 192.x.x.x Server time offset: 0 Last machine account password change: Fri, 12 May 2023 07:36:26 CDT
Is it possible that I am still missing something in the domain for this? I am able to log in to linux using my AD creds and I am also able to obtain a ticket by running kinit command. I will try to get logs from SQL team but I think last time they told me there were none so it seems that it is failing during or even before prelogin. Although in tcpdump I can see that it is reaching the SQL server. bit thanks for trying to help!
That's really strange. Just as a quick test (since you mentioned you were able to use kinit), could you try a kerberos authentication? You'll need to remove the user and password properties and just set authenticationScheme=JavaKerberos
. I'm just curious if this would fail too because kerberos also requires to be domain joined, but you were able to do a kinit.
Is it possible that I am still missing something in the domain?
Not that I know of. From my own experience, after domain joining the machine NTLM auth should work. Also, what driver version are you on?
hi @gpow81
Apologies, you do need the domain
property for NTLM authentication. Could you please tell us what driver version and SQL Server version you are using? Please note NTLM is not supported on Linux SQL Server.
Also, please provide a FINEST log that will give us more info on where the failure is occurring. Please see Tracing driver operation on how to enable logging for the driver.
Thanks.
@tkyc , when I tried the kerberos authentication I got "Login failed for user … " error. I run it after successful kinit. I am using 12.2.0 driver @lilgreenbird It's 12.2.0. The mysql server is on MS Windows but I will double check that. I will try to set log to Finest which might be a bit tricky since the error happens during the installation of the product so the path of log4jd properties/xml file is not even there yet. I will try to precreate it before install. I will report back as soon as I have more. thank you helping out!
edit: I probably can use /usr/lub64/jvm/java…./conf/logging.properties? I saw in strace that it reads it at some point.
@lilgreenbird I was able to get log in the finest log level. But I need to do a lot of sanitizing before I can share it. That log is huge, perhaps there is some more specific part that would be helpful?
Turned out that log was so big because the program was trying to conect dozens of times. After limiting it to only first attempt it is not that long. Here it is after sanitizing all the names.
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.SQLServerDriver:1 connect
FINER: ENTRY Arguments not traced.
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.SQLServerDriver connect
FINE: Microsoft JDBC Driver 12.2.0.0 for SQL Server
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.SQLServerDriver connect
FINER: System Property: java.specification.vendor Value: Oracle Corporation
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.SQLServerDriver connect
FINER: System Property: java.specification.version Value: 11
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.SQLServerDriver connect
FINER: System Property: java.class.path Value: /opt/ucd/server/bin/launcher.jar
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.SQLServerDriver connect
FINER: System Property: java.class.version Value: 55.0
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.SQLServerDriver connect
FINER: System Property: java.runtime.name Value: OpenJDK Runtime Environment
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.SQLServerDriver connect
FINER: System Property: java.runtime.version Value: 11.0.18+0-suse-150000.3.93.1-x8664
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.SQLServerDriver connect
FINER: System Property: java.vendor Value: Oracle Corporation
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.SQLServerDriver connect
FINER: System Property: java.version Value: 11.0.18
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.SQLServerDriver connect
FINER: System Property: java.vm.name Value: OpenJDK 64-Bit Server VM
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.SQLServerDriver connect
FINER: System Property: java.vm.vendor Value: Oracle Corporation
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.SQLServerDriver connect
FINER: System Property: java.vm.version Value: 11.0.18+0-suse-150000.3.93.1-x8664
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.SQLServerDriver connect
FINER: System Property: java.vm.specification.vendor Value: Oracle Corporation
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.SQLServerDriver connect
FINER: System Property: java.vm.specification.version Value: 11
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.SQLServerDriver connect
FINER: System Property: os.name Value: Linux
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.SQLServerDriver connect
FINER: System Property: os.version Value: 5.14.21-150400.24.46-default
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.SQLServerDriver connect
FINER: System Property: os.arch Value: amd64
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.Util parseUrl
FINE: Property:serverName Value:myhost
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.Util parseUrl
FINE: Property:portNumber Value:60000
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.Util parseUrl
FINE: Property:databaseName Value:mydatabase
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.Util parseUrl
FINE: Property:encrypt Value:false
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.Util parseUrl
FINE: Property:integratedSecurity Value:true
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.Util parseUrl
FINE: Property:domain Value:MYDOM
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.Util parseUrl
FINE: Property:password
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.Util parseUrl
FINE: Property:authenticationScheme Value:NTLM
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.SQLServerConnection
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSReader nextPacket
FINEST: TDSReader@1 (ConnectionID:1 ClientConnectionId: 00000000-0000-0000-aaaa-000000000000) Moving to next packet -- unlinking consumed packet
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSReader readBytes
FINEST: TDSReader@1 (ConnectionID:1 ClientConnectionId: 00000000-0000-0000-aaaa-000000000000) Reading 5 bytes from offset 0
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream readInternal
FINEST: com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream@2392212b Read 5 bytes
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream readInternal
FINEST: com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream@2392212b Reading 1620 bytes
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSChannel$SSLHandshakeInputStream readInternal
FINEST: TDSChannel (ConnectionID:1) (SSLHandshakeInputStream): Reading 1620 bytes...
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSReader readBytes
FINEST: TDSReader@1 (ConnectionID:1 ClientConnectionId: 00000000-0000-0000-aaaa-000000000000) Reading 1620 bytes from offset 5
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream readInternal
FINEST: com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream@2392212b Read 1620 bytes
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.PermissiveX509TrustManager checkServerTrusted
FINER: TDSChannel (ConnectionID:1) (PermissiveX509TrustManager): Trusting server certificate
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSChannel$ProxyOutputStream writeInternal
FINEST: com.microsoft.sqlserver.jdbc.TDSChannel$ProxyOutputStream@7e11ab3d Writing 107 bytes
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSChannel$SSLHandshakeOutputStream writeInternal
FINEST: TDSChannel (ConnectionID:1) (SSLHandshakeOutputStream): Starting new TDS packet...
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSWriter writeBytes
FINEST: TDSWriter@560cbf1a (ConnectionID:1) Writing 8 bytes
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSChannel$SSLHandshakeOutputStream writeInternal
FINEST: TDSChannel (ConnectionID:1) (SSLHandshakeOutputStream): Writing 107 bytes...
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSWriter writeBytes
FINEST: TDSWriter@560cbf1a (ConnectionID:1) Writing 107 bytes
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSChannel$ProxyOutputStream flush
FINEST: com.microsoft.sqlserver.jdbc.TDSChannel$ProxyOutputStream@7e11ab3d Flushing
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSChannel$SSLHandshakeOutputStream flush
FINEST: TDSChannel (ConnectionID:1) (SSLHandshakeOutputStream): Ignored a request to flush the stream
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSChannel$ProxyOutputStream writeInternal
FINEST: com.microsoft.sqlserver.jdbc.TDSChannel$ProxyOutputStream@7e11ab3d Writing 6 bytes
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSChannel$SSLHandshakeOutputStream writeInternal
FINEST: TDSChannel (ConnectionID:1) (SSLHandshakeOutputStream): Writing 6 bytes...
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSWriter writeBytes
FINEST: TDSWriter@560cbf1a (ConnectionID:1) Writing 6 bytes
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSChannel$ProxyOutputStream writeInternal
FINEST: com.microsoft.sqlserver.jdbc.TDSChannel$ProxyOutputStream@7e11ab3d Writing 45 bytes
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSChannel$SSLHandshakeOutputStream writeInternal
FINEST: TDSChannel (ConnectionID:1) (SSLHandshakeOutputStream): Writing 45 bytes...
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSWriter writeBytes
FINEST: TDSWriter@560cbf1a (ConnectionID:1) Writing 45 bytes
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSChannel$ProxyOutputStream flush
FINEST: com.microsoft.sqlserver.jdbc.TDSChannel$ProxyOutputStream@7e11ab3d Flushing
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSChannel$SSLHandshakeOutputStream flush
FINEST: TDSChannel (ConnectionID:1) (SSLHandshakeOutputStream): Ignored a request to flush the stream
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream readInternal
FINEST: com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream@2392212b Reading 5 bytes
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSChannel$SSLHandshakeInputStream readInternal
FINEST: TDSChannel (ConnectionID:1) (SSLHandshakeInputStream): Reading 5 bytes...
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSChannel$SSLHandshakeInputStream ensureSSLPayload
FINEST: TDSChannel (ConnectionID:1) (SSLHandshakeInputStream): No handshake response bytes available. Flushing SSL handshake output stream.
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSChannel$SSLHandshakeOutputStream endMessage
FINEST: TDSChannel (ConnectionID:1) (SSLHandshakeOutputStream): Finishing TDS message
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSWriter endMessage
FINEST: TDSWriter@560cbf1a (ConnectionID:1) Finishing TDS message
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSChannel logPacket
FINEST: /192.168.206.241:39100 SPID:0 TDSWriter@560cbf1a (ConnectionID:1) sending packet (166 bytes)
---- hexdump removed -----
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSChannel$SSLHandshakeInputStream ensureSSLPayload
FINEST: TDSChannel (ConnectionID:1) (SSLHandshakeInputStream): Reading first packet of SSL handshake response
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream readInternal
FINEST: com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream@55e7a35c Reading 8 bytes
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream readInternal
FINEST: com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream@55e7a35c Read 8 bytes
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream readInternal
FINEST: com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream@55e7a35c Reading 51 bytes
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream readInternal
FINEST: com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream@55e7a35c Read 51 bytes
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSChannel logPacket
FINEST: /192.168.206.241:39100 SPID:0 TDSReader@1 (ConnectionID:1 ClientConnectionId: 00000000-0000-0000-aaaa-000000000000) received Packet:2 (51 bytes)
---- hexdump removed -----
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSReader nextPacket
FINEST: TDSReader@1 (ConnectionID:1 ClientConnectionId: 00000000-0000-0000-aaaa-000000000000) Moving to next packet -- unlinking consumed packet
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSReader readBytes
FINEST: TDSReader@1 (ConnectionID:1 ClientConnectionId: 00000000-0000-0000-aaaa-000000000000) Reading 5 bytes from offset 0
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream readInternal
FINEST: com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream@2392212b Read 5 bytes
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream readInternal
FINEST: com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream@2392212b Reading 1 bytes
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSChannel$SSLHandshakeInputStream readInternal
FINEST: TDSChannel (ConnectionID:1) (SSLHandshakeInputStream): Reading 1 bytes...
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSReader readBytes
FINEST: TDSReader@1 (ConnectionID:1 ClientConnectionId: 00000000-0000-0000-aaaa-000000000000) Reading 1 bytes from offset 5
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream readInternal
FINEST: com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream@2392212b Read 1 bytes
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream readInternal
FINEST: com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream@2392212b Reading 5 bytes
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSChannel$SSLHandshakeInputStream readInternal
FINEST: TDSChannel (ConnectionID:1) (SSLHandshakeInputStream): Reading 5 bytes...
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSReader readBytes
FINEST: TDSReader@1 (ConnectionID:1 ClientConnectionId: 00000000-0000-0000-aaaa-000000000000) Reading 5 bytes from offset 6
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream readInternal
FINEST: com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream@2392212b Read 5 bytes
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream readInternal
FINEST: com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream@2392212b Reading 40 bytes
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSChannel$SSLHandshakeInputStream readInternal
FINEST: TDSChannel (ConnectionID:1) (SSLHandshakeInputStream): Reading 40 bytes...
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSReader readBytes
FINEST: TDSReader@1 (ConnectionID:1 ClientConnectionId: 00000000-0000-0000-aaaa-000000000000) Reading 40 bytes from offset 11
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream readInternal
FINEST: com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream@2392212b Read 40 bytes
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSChannel enableSSL
FINEST: TDSChannel (ConnectionID:1) Rewiring proxy streams after handshake
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSChannel enableSSL
FINEST: TDSChannel (ConnectionID:1) Getting SSL InputStream
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSChannel enableSSL
FINEST: TDSChannel (ConnectionID:1) Getting SSL OutputStream
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSChannel enableSSL
FINER: TDSChannel (ConnectionID:1) SSL enabled
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.SSPIAuthentication enrichSpnWithRealm
FINER: Deriving realm
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.SSPIAuthentication enrichSpnWithRealm
FINER: Attempt to derive realm using canonical host name with InetAddress
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.SSPIAuthentication enrichSpnWithRealm
FINER: Derived realm: MYDOM.COM
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.NTLMAuthentication$NTLMContext
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSChannel$ProxyOutputStream writeInternal
FINEST: com.microsoft.sqlserver.jdbc.TDSChannel$ProxyOutputStream@7e11ab3d Writing 402 bytes
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSChannel$ProxyOutputStream flush
FINEST: com.microsoft.sqlserver.jdbc.TDSChannel$ProxyOutputStream@7e11ab3d Flushing
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSChannel disableSSL
FINER: TDSChannel (ConnectionID:1) Disabling SSL...
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSChannel disableSSL
FINEST: TDSChannel (ConnectionID:1) Rewiring proxy streams for SSL socket close
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSChannel disableSSL
FINER: TDSChannel (ConnectionID:1) Closing SSL socket
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSChannel$ProxyOutputStream writeInternal
FINEST: com.microsoft.sqlserver.jdbc.TDSChannel$ProxyOutputStream@7e11ab3d Writing 31 bytes
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSChannel$ProxyOutputStream flush
FINEST: com.microsoft.sqlserver.jdbc.TDSChannel$ProxyOutputStream@7e11ab3d Flushing
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream readInternal
FINEST: com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream@2392212b Reading 5 bytes
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream readInternal
FINEST: com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream@2392212b Read -1 bytes
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSChannel disableSSL
FINER: TDSChannel (ConnectionID:1) SSL disabled
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSCommand onRequestComplete
FINEST: TDSCommand@33a630fa (logon): request complete
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSCommand startResponse
FINEST: TDSCommand@33a630fa (logon): Reading response...
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream readInternal
FINEST: com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream@55e7a35c Reading 8 bytes
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream readInternal
FINEST: com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream@55e7a35c Read 8 bytes
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream readInternal
FINEST: com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream@55e7a35c Reading 223 bytes
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream readInternal
FINEST: com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream@55e7a35c Read 223 bytes
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSChannel logPacket
FINEST: /192.168.206.241:39100 SPID:0 TDSReader@2 (ConnectionID:1 ClientConnectionId: 00000000-0000-0000-aaaa-000000000000) received Packet:1 (223 bytes)
---- hexdump removed -----
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSCommand onResponseEOM
FINEST: TDSCommand@33a630fa (logon): disabling interrupts
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSReader nextPacket
FINEST: TDSReader@2 (ConnectionID:1 ClientConnectionId: 00000000-0000-0000-aaaa-000000000000) Moving to next packet -- unlinking consumed packet
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSParser parse
FINEST: TDSReader@2 (ConnectionID:1 ClientConnectionId: 00000000-0000-0000-aaaa-000000000000): logon: Processing TDS_SSPI (0xED)
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSReader readBytes
FINEST: TDSReader@2 (ConnectionID:1 ClientConnectionId: 00000000-0000-0000-aaaa-000000000000) Reading 220 bytes from offset 3
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.NTLMAuthentication parseNtlmChallenge
FINEST: com.microsoft.sqlserver.jdbc.NTLMAuthentication@6b04acb2 NTLM Challenge Message target info: AvId 2
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.NTLMAuthentication parseNtlmChallenge
FINEST: com.microsoft.sqlserver.jdbc.NTLMAuthentication@6b04acb2 NTLM Challenge Message target info: AvId 1
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.NTLMAuthentication parseNtlmChallenge
FINEST: com.microsoft.sqlserver.jdbc.NTLMAuthentication@6b04acb2 NTLM Challenge Message target info: AvId 4
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.NTLMAuthentication parseNtlmChallenge
FINEST: com.microsoft.sqlserver.jdbc.NTLMAuthentication@6b04acb2 NTLM Challenge Message target info: AvId 3
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.NTLMAuthentication parseNtlmChallenge
FINEST: com.microsoft.sqlserver.jdbc.NTLMAuthentication@6b04acb2 NTLM Challenge Message target info: AvId 5
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.NTLMAuthentication parseNtlmChallenge
FINEST: com.microsoft.sqlserver.jdbc.NTLMAuthentication@6b04acb2 NTLM Challenge Message target info: AvId 7
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.NTLMAuthentication parseNtlmChallenge
FINEST: com.microsoft.sqlserver.jdbc.NTLMAuthentication@6b04acb2 NTLM Challenge Message target info: AvId 0
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSParser parse
FINEST: TDSReader@2 (ConnectionID:1 ClientConnectionId: 00000000-0000-0000-aaaa-000000000000): logon: Processing EOF
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSCommand startRequest
FINEST: TDSCommand@33a630fa (logon): starting request...
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSWriter writeBytes
FINEST: TDSWriter@560cbf1a (ConnectionID:1) Writing 8 bytes
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSWriter writeBytes
FINEST: TDSWriter@560cbf1a (ConnectionID:1) Writing 480 bytes
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSCommand startResponse
FINEST: TDSCommand@33a630fa (logon): finishing request
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSWriter endMessage
FINEST: TDSWriter@560cbf1a (ConnectionID:1) Finishing TDS message
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSChannel logPacket
FINEST: /192.168.206.241:39100 SPID:0 TDSWriter@560cbf1a (ConnectionID:1) sending packet (488 bytes)
11 01 01 E8 00 00 01 00 4E 54 4C 4D 53 53 50 00 ........NTLMSSP.
03 00 00 00 00 00 00 00 58 00 00 00 30 01 30 01 ........X...0.0.
70 00 00 00 0A 00 0A 00 A0 01 00 00 1C 00 1C 00 p...............
AA 01 00 00 1A 00 1A 00 C6 01 00 00 00 00 00 00 ................
E0 01 00 00 05 B0 88 00 00 00 00 00 00 00 00 00 ................
3C 9A 75 35 E3 C4 A3 31 F2 12 DD 5D 11 47 74 F5 <.u5...1...].Gt.
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 39 B3 C0 F7 09 08 2F 36 ........9...../6
8D 12 C6 1B 27 CF E5 D8 01 01 00 00 00 00 00 00 ....'...........
---- hexdump removed -----
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSCommand onRequestComplete
FINEST: TDSCommand@33a630fa (logon): request complete
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSCommand startResponse
FINEST: TDSCommand@33a630fa (logon): Reading response...
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream readInternal
FINEST: com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream@55e7a35c Reading 8 bytes
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream readInternal
FINEST: com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream@55e7a35c Read 8 bytes
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream readInternal
FINEST: com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream@55e7a35c Reading 258 bytes
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream readInternal
FINEST: com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream@55e7a35c Read 258 bytes
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSChannel logPacket
FINEST: /192.168.206.241:39100 SPID:79 TDSReader@2 (ConnectionID:1 ClientConnectionId: 00000000-0000-0000-aaaa-000000000000) received Packet:2 (258 bytes)
04 01 01 0A 00 4F 01 00 AA F2 00 14 48 00 00 01 .....O......H...
0E 66 00 4C 00 6F 00 67 00 69 00 6E 00 20 00 66 .f.L.o.g.i.n. .f
00 61 00 69 00 6C 00 65 00 64 00 2E 00 20 00 54 .a.i.l.e.d... .T
00 68 00 65 00 20 00 6C 00 6F 00 67 00 69 00 6E .h.e. .l.o.g.i.n
00 20 00 69 00 73 00 20 00 66 00 72 00 6F 00 6D . .i.s. .f.r.o.m
00 20 00 61 00 6E 00 20 00 75 00 6E 00 74 00 72 . .a.n. .u.n.t.r
00 75 00 73 00 74 00 65 00 64 00 20 00 64 00 6F .u.s.t.e.d. .d.o
00 6D 00 61 00 69 00 6E 00 20 00 61 00 6E 00 64 .m.a.i.n. .a.n.d
00 20 00 63 00 61 00 6E 00 6E 00 6F 00 74 00 20 . .c.a.n.n.o.t.
00 62 00 65 00 20 00 75 00 73 00 65 00 64 00 20 .b.e. .u.s.e.d.
00 77 00 69 00 74 00 68 00 20 00 49 00 6E 00 74 .w.i.t.h. .I.n.t
00 65 00 67 00 72 00 61 00 74 00 65 00 64 00 20 .e.g.r.a.t.e.d.
00 61 00 75 00 74 00 68 00 65 00 6E 00 74 00 69 .a.u.t.h.e.n.t.i
00 63 00 61 00 74 00 69 00 6F 00 6E 00 2E 00 0C .c.a.t.i.o.n....
48 00 41 00 44 00 53 00 51 00 4C 00 32 00 32 00 X.X.X.X.X.L.2.2.
47 00 50 00 30 00 31 00 00 01 00 00 00 FD 02 00 G.P.0.1.........
00 00 00 00 00 00 00 00 00 00 ..........
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSCommand onResponseEOM
FINEST: TDSCommand@33a630fa (logon): disabling interrupts
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSReader nextPacket
FINEST: TDSReader@2 (ConnectionID:1 ClientConnectionId: 00000000-0000-0000-aaaa-000000000000) Moving to next packet -- unlinking consumed packet
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSParser parse
FINEST: TDSReader@2 (ConnectionID:1 ClientConnectionId: 00000000-0000-0000-aaaa-000000000000): logon: Processing TDS_ERR (0xAA)
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSReader readBytes
FINEST: TDSReader@2 (ConnectionID:1 ClientConnectionId: 00000000-0000-0000-aaaa-000000000000) Reading 204 bytes from offset 11
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSReader readBytes
FINEST: TDSReader@2 (ConnectionID:1 ClientConnectionId: 00000000-0000-0000-aaaa-000000000000) Reading 24 bytes from offset 216
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSParser parse
FINEST: TDSReader@2 (ConnectionID:1 ClientConnectionId: 00000000-0000-0000-aaaa-000000000000): logon: Processing TDS_DONE (0xFD)
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSParser parse
FINEST: TDSReader@2 (ConnectionID:1 ClientConnectionId: 00000000-0000-0000-aaaa-000000000000): logon: Processing EOF
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.SQLServerException logException
FINE: *** SQLException: com.microsoft.sqlserver.jdbc.SQLServerException: Login failed. The login is from an untrusted domain and cannot be used with Integrated authentication. ClientConnectionId:00000000-0000-0000-aaaa-000000000000 Msg 18452, Level 14, State 1, Login failed. The login is from an untrusted domain and cannot be used with Integrated authentication. ClientConnectionId:00000000-0000-0000-aaaa-000000000000
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSChannel close
FINEST: TDSChannel (ConnectionID:1): Closing inputStream...
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream close
FINEST: com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream@55e7a35c Closing
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSChannel close
FINEST: TDSChannel (ConnectionID:1): Closing outputStream...
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.TDSChannel close
FINER: TDSChannel (ConnectionID:1): Closing TCP socket...
May 15, 2023 8:42:01 AM com.microsoft.sqlserver.jdbc.SQLServerConnection login
FINE: ConnectionID:1 ClientConnectionId: 00000000-0000-0000-aaaa-000000000000 sleeping milisec: 100
May 15, 2023 8:42:02 AM com.microsoft.sqlserver.jdbc.SQLServerConnection login
FINE: ConnectionID:1 This attempt server name: myhost port: 60000 InstanceName: null useParallel: false
May 15, 2023 8:42:02 AM com.microsoft.sqlserver.jdbc.SQLServerConnection login
FINE: ConnectionID:1 This attempt endtime: 1684158129574
Right now, I want to suspect it's an issue with the SPN with the SQL Server, if you could get the sql server logs it should indicate if it is. Could you also confirm you sql server version? Also, for the domain user used to authenticate, can you confirm that user is added to SQL Server as a login?
Can you explain what you mean by having user added as a login? From my understanding it may be either SQL login or Domain login. And as far as I know this is a domain login in our case. Are you saying that it should be both?
I am still trying to get logs. Is the SQL log only place where we can find some explanation or it would be worth looking into AD logs as well? or domain controller?
Problem has been solved. I was told that user was missing some group membership.
My final jdbc string was
jdbc:sqlserver://server:port;DatabaseName=db_name;encrypt=false;integratedSecurity=true;domain=MYDOMAIN;authenticationScheme=NTLM
The user and password was provided in next prompt coming from the product installation wizard without the MYDOMAIN\ prefix.
Thank you all for your help!
ah that's good to know! we will go ahead and close this issue please let us know if you have more questions
Question
Hi I am hopping that this is the right place and I can ask multiple questions in one thread. I really struggle with this and vendors are not helpful at all I am installing a product (on Linux SLES) which is using jdbc driver to connect to MS SQL database and I need to use Windows login for the connection (it works fine with a local SQL login but I can't use that).
From all my reaserch so far, I should be using authenticateScheme=NTLM but everything I tried so far failed. Also the database is not using an encryption.
Is encryption a requirement for NTLM by any chance?
Here is the jdbc string which got me closest so far: jdbc:sqlserver://server:port;DatabaseName=db_name;encrypt=false;integratedSecurity=true;domain=MYDOMAIN;user=blabla;password=blabla;authenticationScheme=NTLM
Error I get: com.microsoft.sqlserver.jdbc.SQLServerException: Login failed. The login is from an untrusted domain and cannot be used with Integrated authentication
Does linux need to be a member of the windows domain? It is in my case (with winbind and samba) but I just want to make sure I understand this.
I am logged in as root user when I do the install. I tried switching to the domain user and run install from it but I was getting same error.
Please let me know what else I should check. Thank you