Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid connect() call in 'redirect' mode #3911

Closed
monetdb-team opened this issue Nov 30, 2020 · 0 comments
Closed

Invalid connect() call in 'redirect' mode #3911

monetdb-team opened this issue Nov 30, 2020 · 0 comments

Comments

@monetdb-team
Copy link

@monetdb-team monetdb-team commented Nov 30, 2020

Date: 2016-01-25 18:19:39 +0100
From: Alex <>
To: clients devs <>
Version: -- development
CC: ttyS15

Last updated: 2016-06-23 10:24:36 +0200

Comment 21751

Date: 2016-01-25 18:19:39 +0100
From: Alex <>

Created attachment 384
Issue fix

Tested on:

  • python-monetdb==11.19.3.2

I have got traceback, while trying to connect to server in 'redirect' mode:

Traceback (most recent call last):
File "/data/prd-monet/apps/reports/init.py", line 23, in register_reports
r.do_register()
File "/data/prd-monet/apps/morgoth/reports/init.py", line 179, in do_register
rm.register(*args)
File "/data/prd-monet/apps/morgoth/reports/init.py", line 71, in register
return self.get_report()
File "/data/prd-monet/apps/morgoth/reports/init.py", line 75, in get_report
name=self.group_name, defaults={"title": self.group_name})
File "/data/prd-monet/virtualenv/lib/python2.7/site-packages/django/db/models/manager.py", line 154, in get_or_create
return self.get_queryset().get_or_create(**kwargs)
File "/data/prd-monet/virtualenv/lib/python2.7/site-packages/django/db/models/query.py", line 376, in get_or_create
return self.get(**lookup), False
File "/data/prd-monet/virtualenv/lib/python2.7/site-packages/django/db/models/query.py", line 304, in get
num = len(clone)
File "/data/prd-monet/virtualenv/lib/python2.7/site-packages/django/db/models/query.py", line 77, in len
self._fetch_all()
File "/data/prd-monet/virtualenv/lib/python2.7/site-packages/django/db/models/query.py", line 857, in _fetch_all
self._result_cache = list(self.iterator())
File "/data/prd-monet/virtualenv/lib/python2.7/site-packages/django/db/models/query.py", line 220, in iterator
for row in compiler.results_iter():
File "/data/prd-monet/virtualenv/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 713, in results_iter
for rows in self.execute_sql(MULTI):
File "/data/prd-monet/virtualenv/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 785, in execute_sql
cursor = self.connection.cursor()
File "/data/prd-monet/virtualenv/lib/python2.7/site-packages/django/db/backends/init.py", line 162, in cursor
cursor = util.CursorWrapper(self._cursor(), self)
File "/data/prd-monet/virtualenv/lib/python2.7/site-packages/django/db/backends/init.py", line 132, in _cursor
self.ensure_connection()
File "/data/prd-monet/virtualenv/lib/python2.7/site-packages/django/db/backends/init.py", line 127, in ensure_connection
self.connect()
File "/data/prd-monet/virtualenv/lib/python2.7/site-packages/django/db/backends/init.py", line 115, in connect
self.connection = self.get_new_connection(conn_params)
File "/data/prd-monet/virtualenv/lib/python2.7/site-packages/djonet/base.py", line 99, in get_new_connection
conn = Database.connect(**conn_params)
File "/data/prd-monet/virtualenv/lib/python2.7/site-packages/monetdb/sql/init.py", line 28, in connect
return Connection(*args, **kwargs)
File "/data/prd-monet/virtualenv/lib/python2.7/site-packages/monetdb/sql/connections.py", line 60, in init
unix_socket=unix_socket)
File "/data/prd-monet/virtualenv/lib/python2.7/site-packages/monetdb/mapi.py", line 125, in connect
self._login()
File "/data/prd-monet/virtualenv/lib/python2.7/site-packages/monetdb/mapi.py", line 170, in _login
self.password, self.database, self.language)
File "/data/prd-monet/virtualenv/lib/python2.7/site-packages/monetdb/mapi.py", line 97, in connect
if not unix_socket and os.path.exists("/tmp/.s.monetdb.%i" % port):
TypeError: %d format: a number is required, not str
Python 2.7.11 (default, Jan 14 2016, 01:19:44)

Patch with fix is proposed.

Attached file: invalid_connect.patch (text/plain, 981 bytes)
Description: Issue fix

Comment 22070

Date: 2016-04-20 11:04:56 +0200
From: MonetDB Mercurial Repository <>

Changeset 6674c4ec995f made by Sjoerd Mullender sjoerd@acm.org in the MonetDB repo, refers to this bug.

For complete details, see http//devmonetdborg/hg/MonetDB?cmd=changeset;node=6674c4ec995f

Changeset description:

Fix calling the Connection.connect method.
This fixes bug #3911.

Comment 22071

Date: 2016-04-20 11:06:48 +0200
From: @sjoerdmullender

Should be fixed in the next release.
I've done it slightly differently than your patch. I've ust used named arguments for all of the arguments. That should be more future proof (given that the bug was introduced when the arguments of the connect method were rearranged but this call was not fixed).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant