thegooglecodearchive / pymssql

Automatically exported from code.google.com/p/pymssql
GNU Lesser General Public License v2.1
0 stars 0 forks source link

freetds.conf not found in /home/rsyring/dev/freetds/built/etc/freetds.conf (not looking in /etc/freetds ) #104

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
READ FIRST Please (and then delete):

* Support requests should be posted here (not reported as bugs):
http://groups.google.com/group/pymssql
* 1.x branch of pymssql is no longer supported, please don't report bugs
for it

What steps will reproduce the problem?
1. Install the pymssql-2.0.0b1_dev_20111018-py2.7-linux-x86_64.egg
2. Run a query
3. See where it looks for info (with strace)

What is the expected output? What do you see instead?

I expect it to look in /etc/freetds/freetds.conf

What do I see:

24985 open("/home/oetelaar/.freetds.conf", O_RDONLY) = -1 ENOENT (No such file 
or directory)
24985 open("/home/rsyring/dev/freetds/built/etc/freetds.conf", O_RDONLY) = -1 
ENOENT (No such file or directory)

This means it uses some build directory (which is not on my machine)
Then it tries my home directory (where I did not have a freetds.conf file.

What version of the product are you using? On what operating system?
Linux Ubuntu : 
# python -V
Python 2.7.3
# uname -a
Linux i7-ssd-pc 3.2.0-33-generic #52-Ubuntu SMP Thu Oct 18 16:29:15 UTC 2012 
x86_64 x86_64 x86_64 GNU/Linux

Please provide any additional information below.
- Looks like a build/package problem

Original issue reported on code.google.com by oetelaar.automatisering on 19 Nov 2012 at 6:03

GoogleCodeExporter commented 9 years ago
I found this problem because of encoding issues.
The error message : UnicodeDecodeError: 'utf8' codec can't decode byte 0xeb in 
position 6: invalid continuation byte python 2.7

started my investigation that ended by adding the UTF-8 encoding in the 
.freetds.conf file in my homedirectory

# server specific section
[global]
        # TDS protocol version
    tds version = 8.0
    client charset = UTF-8 

Original comment by oetelaar.automatisering on 19 Nov 2012 at 6:10

GoogleCodeExporter commented 9 years ago
Oops, it looks like Randy built the FreeTDS library with paths to his home 
directory in it:

vagrant@lucid64:~/dev/hg-repos/pymssql$ strings freetds/nix_64/lib/libsybdb.a
| grep rsyring | sort -u /home/rsyring/dev/freetds/built/etc /home/rsyring/dev/freetds/built/etc/freetds.conf /home/rsyring/dev/freetds/built/etc/locales.conf /home/rsyring/dev/freetds/freetds-0.91/src/dblib /home/rsyring/dev/freetds/freetds-0.91/src/replacements /home/rsyring/dev/freetds/freetds-0.91/src/tds

Original comment by msabr...@gmail.com on 7 Jan 2013 at 3:45

GoogleCodeExporter commented 9 years ago

Original comment by msabr...@gmail.com on 7 Jan 2013 at 5:32

GoogleCodeExporter commented 9 years ago
Hey Randy,

It's probably been a long time and you might not remember, but do you know what 
settings you used to build FreeTDS?

I thought maybe we could rebuild the bundled FreeTDS and have it looks for 
freetds.conf in a more standard location.

Original comment by msabr...@gmail.com on 30 Aug 2013 at 4:47

GoogleCodeExporter commented 9 years ago
Fixed with 
https://github.com/pymssql/pymssql/commit/24cea499ac711bf92100895694c3badaab90f7
c0.

Tested with:

marca@marca-ubuntu12:~/dev/git-repos/pymssql$ rm .so .c marca@marca-ubuntu12:~/dev/git-repos/pymssql$ PYMSSQL_BUILD_WITH_BUNDLED_FREETDS=1 python setup.py build_ext -i setup.py: platform.system() => 'Linux' setup.py: platform.architecture() => ('64bit', 'ELF') setup.py: platform.linux_distribution() => ('Ubuntu', '12.04', 'precise') setup.py: platform.libc_ver() => ('glibc', '2.7') setup.py: libc_has_vasprintf_chk = True setup.py: Using bundled FreeTDS in /home/marca/dev/git-repos/pymssql/freetds/nix_64 ... marca@marca-ubuntu12:~/dev/git-repos/pymssql$ strace -e open python test_debug_queries.py 2>&1 | grep 'freetds.conf' open("/home/marca/.freetds.conf", O_RDONLY) = 3 open("/etc/freetds/freetds.conf", O_RDONLY) = 3 open("/home/marca/.freetds.conf", O_RDONLY) = 3

Original comment by msabr...@gmail.com on 25 Sep 2013 at 12:20