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

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

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

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


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==

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

Traceback (most recent call last):
File "/data/prd-monet/apps/reports/", line 23, in register_reports
File "/data/prd-monet/apps/morgoth/reports/", line 179, in do_register
File "/data/prd-monet/apps/morgoth/reports/", line 71, in register
return self.get_report()
File "/data/prd-monet/apps/morgoth/reports/", 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/", 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/", line 376, in get_or_create
return self.get(**lookup), False
File "/data/prd-monet/virtualenv/lib/python2.7/site-packages/django/db/models/", line 304, in get
num = len(clone)
File "/data/prd-monet/virtualenv/lib/python2.7/site-packages/django/db/models/", line 77, in len
File "/data/prd-monet/virtualenv/lib/python2.7/site-packages/django/db/models/", line 857, in _fetch_all
self._result_cache = list(self.iterator())
File "/data/prd-monet/virtualenv/lib/python2.7/site-packages/django/db/models/", line 220, in iterator
for row in compiler.results_iter():
File "/data/prd-monet/virtualenv/lib/python2.7/site-packages/django/db/models/sql/", 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/", line 785, in execute_sql
cursor = self.connection.cursor()
File "/data/prd-monet/virtualenv/lib/python2.7/site-packages/django/db/backends/", line 162, in cursor
cursor = util.CursorWrapper(self._cursor(), self)
File "/data/prd-monet/virtualenv/lib/python2.7/site-packages/django/db/backends/", line 132, in _cursor
File "/data/prd-monet/virtualenv/lib/python2.7/site-packages/django/db/backends/", line 127, in ensure_connection
File "/data/prd-monet/virtualenv/lib/python2.7/site-packages/django/db/backends/", line 115, in connect
self.connection = self.get_new_connection(conn_params)
File "/data/prd-monet/virtualenv/lib/python2.7/site-packages/djonet/", line 99, in get_new_connection
conn = Database.connect(**conn_params)
File "/data/prd-monet/virtualenv/lib/python2.7/site-packages/monetdb/sql/", line 28, in connect
return Connection(*args, **kwargs)
File "/data/prd-monet/virtualenv/lib/python2.7/site-packages/monetdb/sql/", line 60, in init
File "/data/prd-monet/virtualenv/lib/python2.7/site-packages/monetdb/", line 125, in connect
File "/data/prd-monet/virtualenv/lib/python2.7/site-packages/monetdb/", line 170, in _login
self.password, self.database, self.language)
File "/data/prd-monet/virtualenv/lib/python2.7/site-packages/monetdb/", 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 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
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant