Skip to Content.
Sympa Menu

freetds - [freetds] bugreport: tsql connect fails when log file is unwriteable

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Petr Klíma <qaxi AT seznam.cz>
  • To: freetds AT lists.ibiblio.org
  • Subject: [freetds] bugreport: tsql connect fails when log file is unwriteable
  • Date: Wed, 03 Mar 2010 11:01:48 +0100


tsql fails connect when log file is unwriteable.
No error message indicating "log file is unwriteable", but misterious "Unable to connect: Adaptive Server is unavailable or does not exist."

It has two efects ...

- you can not debug connections from php module on http server (runs under id=apache)
- when you try souch debug, all your applications using freetds directly or indirectly (php_mssql, php_odbc ...) fails to connect to server



Patch not provided, C knowledge not installed



supporting informations:
=====================================================
# tsql -C
Compile-time settings (established with the "configure" script)
Version: freetds v0.82
freetds.conf directory: /etc
MS db-lib source compatibility: yes
Sybase binary compatibility: yes
Thread safety: yes
iconv library: yes
TDS version: 4.2
iODBC: no
unixodbc: yes

# cat /etc/freetds.conf
[global]
initial block size = 512
text size = 64512

[hrochSRV2]
# connect to MSSQL 2008 server instance
tds version = 8.0
client charset = UTF-8
dump file = /tmp/freetds.log
dump file append = yes
host = hroch.xxxxxxxx.xx
port = 49327
instance = SRV2

# ---------------------------------------
# this is OK
# ---------------------------------------

# rm /tmp/freetds.log
# touch /tmp/freetds.log
# ll /tmp/freetds.log
-rw-r--r-- 1 root root 0 bre 3 10:35 /tmp/freetds.log
#
#
#
# export LANG=C; tsql -S hrochSRV2 -U aaaa -P bbbbb
locale is "C"
locale charset is "ANSI_X3.4-1968"
1> use AGROTEST ;
2> go
1> select kodfmista as id from cis_adresyF;
2> go
id
10
11
.
.
.
764200
(1353 rows affected)
1> exit
#

# ---------------------------------------
# this FAILS
# ---------------------------------------


# rm /tmp/freetds.log
# touch /tmp/freetds.log
# ll /tmp/freetds.log
-rw-r--r-- 1 root root 0 Mar 3 10:41 /tmp/freetds.log
#
#

# ---------------------------
# log as unprivileged user
# ---------------------------
# su -l -s /bin/bash apache
-bash-3.2$
-bash-3.2$
-bash-3.2$ export LANG=C; tsql -S hrochSRV2 -U aaaaaa -P bbbbbb
locale is "C"
locale charset is "ANSI_X3.4-1968"
Msg 20009, Level 9, State -1, Server OpenClient, Line -1
Unable to connect: Adaptive Server is unavailable or does not exist
There was a problem connecting to the server
-bash-3.2$


Petr Klíma
<qaxi AT seznam.cz>






Archive powered by MHonArc 2.6.24.

Top of Page