Sqlalchemy & Ubuntu14.04.4 I get TypeError: expected string or buffer
The Problem is only with Postgresql/Multicorn to MSSQL 2008-DB (other Postgresql and Mysql-DB's are working)
How can I fix it?
File "/usr/local/lib/python2.7/dist-packages/multicorn-1.3.2-py2.7-linux-x86_64.egg/multicorn/sqlalchemyfdw.py", line 356, in begin self.transaction = self.connection.begin()
File "/usr/local/lib/python2.7/dist-packages/multicorn-1.3.2-py2.7-linux-x86_64.egg/multicorn/sqlalchemyfdw.py", line 352, in connection
self._connection = self.engine.connect()
File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1641, in connect
return self._connection_cls(self, **kwargs)
File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 59, in __init__
self.__connection = connection or engine.raw_connection()
File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1699, in raw_connection
return self.pool.unique_connection()
File "/usr/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 220, in unique_connection
return _ConnectionFairy(self).checkout()
File "/usr/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 431, in __init__
rec = self._connection_record = pool._do_get()
File "/usr/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 772, in _do_get
return self._create_connection()
File "/usr/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 225, in _create_connection
return _ConnectionRecord(self)
File "/usr/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 322, in __init__
exec_once(self.connection, self)
File "/usr/lib/python2.7/dist-packages/sqlalchemy/event.py", line 392, in exec_once
self(*args, **kw)
File "/usr/lib/python2.7/dist-packages/sqlalchemy/event.py", line 409, in __call__
fn(*args, **kw)
File "/usr/lib/python2.7/dist-packages/sqlalchemy/util/langhelpers.py", line 1049, in go
return once_fn(*arg, **kw)
File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/strategies.py", line 168, in first_connect
dialect.initialize(c)
File "/usr/lib/python2.7/dist-packages/sqlalchemy/dialects/mssql/base.py", line 1129, in initialize
super(MSDialect, self).initialize(connection)
File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 170, in initialize
self._get_server_version_info(connection)
File "/usr/lib/python2.7/dist-packages/sqlalchemy/dialects/mssql/pymssql.py", line 72, in _get_server_version_info
r"Microsoft SQL Server.*? - (\d+).(\d+).(\d+).(\d+)", vers)
File "/usr/lib/python2.7/re.py", line 137, in match
return _compile(pattern, flags).match(string)
TypeError: expected string or buffer
Comments (10)
-
repo owner -
repo owner OK, server version. Multicorn seems to be some unified Posgresql connectivity system. I know nothing about it, though it seems very strange that you'd use pymssql to connect to a postgresql backend?
Can you please share the output of:
select @@version
preferably using whatever connectivity system you have in place? thanks
-
reporter Microsoft SQL Server 2008 R2 (SP1) - 10.50.2500.0 (X64) Jun 17 2011 00:54:03 Copyright (c) Microsoft Corporation Standard Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1)
-
repo owner - changed status to invalid
apparently this is part of multicorn's connectivity system and it looks like https://github.com/Kozea/Multicorn/issues/134 is this exact same bug that I'm guessing is yours since it is worded identically. SQLAlchemy is not in the business of maintaining other people's projects for free. Please contact the maintainers of the project you're using.
-
reporter the problem is since an update of multicorn, ubuntu, sqlalchemy and all other packages and my update from Postgresql 9.3.5 to PostgreSQL 9.5.0 on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2, 64-bit
The MSSQL Database is completely untouched (no changes or updates)
I get the error if I Select something in MSSQL over my Postgresql with Multicorn Extension
TESTCASE:
create foreign table NAV_OPEN_VENDOR ( "vendor" varchar, "posting_date" date, "remamount" numeric ) server alchemy_srv options ( tablename 'open_vendor', db_url 'mssql+pymssql://user:pass@192.168.1.100/database' );
In PostgreSQL: SELECT * from NAV_OPEN_VENDOR; -> TypeError: expected string or buffer
-
reporter I'm the poster of https://github.com/Kozea/Multicorn/issues/134 but they can't help me :(
-
reporter so you think its a problem in multicorn code?
-
repo owner it looks like they just haven't responded. welcome to open source! They need to fix their system so that the correct version string is reported to the SQLAlchemy driver.
-
repo owner also, when you cross-post bug reports on projects, always include the upstream bug report. making me figure this out myself has wasted half an hour of my time.
-
reporter hm okay thanks ... sorry
- Log in to comment
There's no information here on how to reproduce. please provide a test case per the guidelines at http://stackoverflow.com/help/mcve, thanks!