[unixODBC-support] SOLVED Re: [unixODBC][FreeTDS][SQL Server]Unexpected EOF from the server

Dave Dumaresq ddumaresq at bccampus.ca
Thu May 5 21:16:03 BST 2011


It turns out the problem was with my configuration of odbc.ini. In my  
odbc.ini, I was pointing to the Driver (FreeTDS) in my odbcinst.ini,  
but needed to refer to my server, in freetds.conf.

Too many file references!

In my current setup (below), I've changed this by eliminating  
odbcinst.ini and putting the Driver line directly in odbc.ini, while  
adding the necessary reference to Servername, which is in my  
freetds.conf. I've also added enable-msdlib to my configure statement,  
but don't think it made any difference.

./configure --prefix=/usr/local/freetds --with-unixodbc=/usr/local/ 
unixODBC --enable-msdblib
cat freetds.conf
# Global settings are overridden by those in a database
# server specific section
[global]
         # TDS protocol version
;	tds version = 4.2

	# Whether to write a TDSDUMP file for diagnostic purposes
	# (setting this to /tmp is insecure on a multi-user system)
;	dump file = /tmp/freetds.log
;	debug flags = 0xffff

	# Command and connection timeouts
	timeout = 10
	connect timeout = 10
	
	# If you get out-of-memory errors, it may mean that your client
	# is trying to allocate a huge buffer for a TEXT field.
	# Try setting 'text size' to a more reasonable limit
	text size = 64512

# My Microsoft server
[freetds_dsn_myvista]
	host = dfd.present.bccampus.ca
	port = 1433
	tds version = 8.0
$ cat odbc.ini
[dsn_myvista]
Servername=freetds_dsn_myvista
Driver=/usr/local/freetds/lib/libtdsodbc.so
Description=My local vista box containing ACP
User=sa
Password=1234
Database=ldap

[Default]
Driver=/usr/local/freetds/lib/libtdsodbc.so


On 4-May-11, at 12:30 PM, Dave Dumaresq wrote:

> Greetings, I have freeTDS and unixODBC installed on Ubuntu 10.10,  
> and I'm connecting to an SQL Server 2005 host on port 1433 running  
> on a vista box.
>
> tsql works fine; however, isql fails with a final error message  
> 'Unexpected EOF from the server'
>
> $ sudo isql -v dsn_myvista
> [S1000][unixODBC][FreeTDS][SQL Server]Unable to connect to data source
> [01000][unixODBC][FreeTDS][SQL Server]Adaptive Server connection  
> failed
> [01000][unixODBC][FreeTDS][SQL Server]Unexpected EOF from the server
> [ISQL]ERROR: Could not SQLConnect
>
> The logs (below) seem to show that during the connection to  
> [dsn_myvista] the User Name and Authentication are NULL.
> Any suggests about what might be wrong?
>
> /etc/odbc.ini
> [dsn_myvista]
> Driver=FreeTDS
> Server=my.server.org
> Port=1433
> User=sa
> Password=***
> Database=ldap
>
> /etc/odbcinst.ini
> [FreeTDS]
> Driver=/usr/local/freetds/lib/libtdsodbc.so
>
> [ODBC]
> Trace        = Yes
> TraceFile    = /tmp/sql.log
> ForceTrace   = Yes
>
> $ more /tmp/sql.log
> [ODBC][1998][1304536761.718727][__handles.c][459]
> 		Exit:[SQL_SUCCESS]
> 			Environment = 0x945ef30
> [ODBC][1998][1304536761.719232][SQLAllocHandle.c][375]
> 		Entry:
> 			Handle Type = 2
> 			Input Handle = 0x945ef30
> [ODBC][1998][1304536761.719387][SQLAllocHandle.c][493]
> 		Exit:[SQL_SUCCESS]
> 			Output Handle = 0x945f690
> [ODBC][1998][1304536761.719573][SQLConnect.c][3654]
> 		Entry:
> 			Connection = 0x945f690
> 			Server Name = [dsn_myvista][length = 11 (SQL_NTS)]
> 			User Name = [NULL]
> 			Authentication = [NULL]
> 		DIAG [01000] [FreeTDS][SQL Server]Unexpected EOF from the server
>
> 		DIAG [01000] [FreeTDS][SQL Server]Adaptive Server connection failed
>
> 		DIAG [S1000] [FreeTDS][SQL Server]Unable to connect to data source
>
> [ODBC][1998][1304536761.761946][SQLConnect.c][4021]
> 		Exit:[SQL_ERROR]
> [ODBC][1998][1304536761.762111][SQLError.c][434]
> 		Entry:
> 			Connection = 0x945f690
> 			SQLState = 0xbfedc322
> 			Native = 0xbfedc124
> 			Message Text = 0xbfedc12d
> 			Buffer Length = 500
> 			Text Len Ptr = 0xbfedc12a
> [ODBC][1998][1304536761.762319][SQLError.c][471]
> 		Exit:[SQL_SUCCESS]
> 			SQLState = S1000
> 			Native = 0xbfedc124 -> 0
> 			Message Text = [[unixODBC][FreeTDS][SQL Server]Unable to connect  
> to data source]
> [ODBC][1998][1304536761.762513][SQLError.c][434]
> 		Entry:
> 			Connection = 0x945f690
> 			SQLState = 0xbfedc322
> 			Native = 0xbfedc124
> 			Message Text = 0xbfedc12d
> 			Buffer Length = 500
> 			Text Len Ptr = 0xbfedc12a
> [ODBC][1998][1304536761.762609][SQLError.c][471]
> 		Exit:[SQL_SUCCESS]
> 			SQLState = 01000
> 			Native = 0xbfedc124 -> 20002
> 			Message Text = [[unixODBC][FreeTDS][SQL Server]Adaptive Server  
> connection failed]
> [ODBC][1998][1304536761.762692][SQLError.c][434]
> 		Entry:
> 			Connection = 0x945f690
> 			SQLState = 0xbfedc322
> 			Native = 0xbfedc124
> 			Message Text = 0xbfedc12d
> 			Buffer Length = 500
> 			Text Len Ptr = 0xbfedc12a
> [ODBC][1998][1304536761.762841][SQLError.c][471]
> 		Exit:[SQL_SUCCESS]
> 			SQLState = 01000
> 			Native = 0xbfedc124 -> 20017
> 			Message Text = [[unixODBC][FreeTDS][SQL Server]Unexpected EOF  
> from the server]
> [ODBC][1998][1304536761.763083][SQLError.c][434]
> 		Entry:
> 			Connection = 0x945f690
> 			SQLState = 0xbfedc322
> 			Native = 0xbfedc124
> 			Message Text = 0xbfedc12d
> 			Buffer Length = 500
> 			Text Len Ptr = 0xbfedc12a
> [ODBC][1998][1304536761.763159][SQLError.c][471]
> 		Exit:[SQL_NO_DATA]
> [ODBC][1998][1304536761.763276][SQLError.c][514]
> 		Entry:
> 			Environment = 0x945ef30
> 			SQLState = 0xbfedc322
> 			Native = 0xbfedc124
> 			Message Text = 0xbfedc12d
> 			Buffer Length = 500
> 			Text Len Ptr = 0xbfedc12a
> [ODBC][1998][1304536761.763357][SQLError.c][551]
> 		Exit:[SQL_NO_DATA]
> [ODBC][1998][1304536761.763711][SQLFreeHandle.c][286]
> 		Entry:
> 			Handle Type = 2
> 			Input Handle = 0x945f690
> [ODBC][1998][1304536761.763818][SQLFreeHandle.c][337]
> 		Exit:[SQL_SUCCESS]
> [ODBC][1998][1304536761.763895][SQLFreeHandle.c][219]
> 		Entry:
> 			Handle Type = 1
> 			Input Handle = 0x945ef30
>
>
> --
> Dave Dumaresq
> Technical Analyst - BCcampus
> 200 - 555 Seymour St, Vancouver BC
> Phone: 604-412-7738
>
>
>
>
>
> _______________________________________________
> unixODBC-support mailing list
> unixODBC-support at mailman.unixodbc.org
> http://mailman.unixodbc.org/mailman/listinfo/unixodbc-support

--
Dave Dumaresq
Technical Analyst - BCcampus
200 - 555 Seymour St, Vancouver BC
Phone: 604-412-7738





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.unixodbc.org/pipermail/unixodbc-support/attachments/20110505/e6d9ab3e/attachment-0001.html>


More information about the unixODBC-support mailing list