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

Segmentation fault when connecting using SSL #543

Closed
rubendv opened this issue Apr 13, 2017 · 34 comments
Closed

Segmentation fault when connecting using SSL #543

rubendv opened this issue Apr 13, 2017 · 34 comments
Labels
wheel Bugs related to the wheel distribution, not happening installing from source
Milestone

Comments

@rubendv
Copy link

rubendv commented Apr 13, 2017

tl;dr

This segfault only affects the psycopg wheel package: the workaround is to build psycopg from source, e.g. using:

$ pip install --no-binary psycopg2

or the entry in the requirements.txt file:

psycopg2>=2.7,<2.8 --no-binary psycopg2

Running the delete_database function in this snippet against our database causes a segmentation fault in psycopg2==2.7 and 2.7.1, but not in 2.6.2. The segmentation fault seems to happen inside OpenSSL.
Debugging revealed that SSL_library_init is being called twice, once by the Python ssl module and once by the libpq library that comes with psycopg2, where it segfaults. Not sure if this function is allowed to be called twice or not.

import contextlib

import psycopg2

from fabfile.lib import info, parse_uri


@contextlib.contextmanager
def create_connection(connection_uri):
    connection_args = parse_uri(connection_uri)
    conn = psycopg2.connect(
        database='postgres', user=connection_args.username,
        password=connection_args.password, host=connection_args.hostname,
        port=connection_args.port if connection_args.port else 5432)
    conn.set_isolation_level(0)
    yield conn.cursor()
    conn.close()

def delete_database(connection_uri, database):
    hostname = parse_uri(connection_uri).hostname
    info('deleting database {} on {}'.format(database, hostname))
    with create_connection(connection_uri) as cur:
        cur.execute('''SELECT pg_terminate_backend(pg_stat_activity.pid)
                       FROM pg_stat_activity
                       WHERE pg_stat_activity.datname = %s
                         AND pid <> pg_backend_pid()''', (database, ))
        cur.execute('DROP DATABASE "{}"'.format(database))

The system openssl is 1.0.1f-1ubuntu2.22 on Ubuntu 14.04.

On psycopg2==2.6.2 this works fine.

On psycopg2==2.7 we get the following segmentation fault:

Program received signal SIGSEGV, Segmentation fault.
engine_unlocked_finish (e=e@entry=0x7ffff626bfa0 <update>, unlock_for_handlers=unlock_for_handlers@entry=1) at eng_init.c:92
92	eng_init.c: No such file or directory.
(gdb) bt
#0  engine_unlocked_finish (e=e@entry=0x7ffff626bfa0 <update>, unlock_for_handlers=unlock_for_handlers@entry=1) at eng_init.c:92
#1  0x00007ffff6251d69 in ENGINE_finish (e=0x7ffff626bfa0 <update>) at eng_init.c:146
#2  0x00007ffff6264f05 in EVP_DigestInit_ex (ctx=0x10cb600, type=0x7ffff6540080 <sha1_md>, impl=0x0) at digest.c:162
#3  0x00007ffff28fe8a4 in ssl23_connect () from /usr/local/lib/python2.7/dist-packages/psycopg2/.libs/./libssl-a65b360f.so.0.9.8e
#4  0x00007ffff2b63a9c in ?? () from /usr/local/lib/python2.7/dist-packages/psycopg2/.libs/libpq-cf361c55.so.5.8
#5  0x00007ffff2b63fbd in ?? () from /usr/local/lib/python2.7/dist-packages/psycopg2/.libs/libpq-cf361c55.so.5.8
#6  0x00007ffff2b5175e in PQconnectPoll () from /usr/local/lib/python2.7/dist-packages/psycopg2/.libs/libpq-cf361c55.so.5.8
#7  0x00007ffff2b520ce in ?? () from /usr/local/lib/python2.7/dist-packages/psycopg2/.libs/libpq-cf361c55.so.5.8
#8  0x00007ffff2b529bf in PQconnectdb () from /usr/local/lib/python2.7/dist-packages/psycopg2/.libs/libpq-cf361c55.so.5.8
#9  0x00007ffff2d8c241 in _conn_sync_connect (self=0x7ffff2ff8c80) at psycopg/connection_int.c:716
#10 conn_connect (self=self@entry=0x7ffff2ff8c80, async=<optimized out>) at psycopg/connection_int.c:812
#11 0x00007ffff2d8cf84 in connection_setup (async=<optimized out>, dsn=<optimized out>, self=0x7ffff2ff8c80) at psycopg/connection_type.c:1277
#12 connection_init (obj=obj@entry=<psycopg2.extensions.connection at remote 0x7ffff2ff8c80>, args=args@entry=('dbname=postgres host=**censored ip** user=admin password=**censored password** port=5432',), kwds=kwds@entry=0x0)
    at psycopg/connection_type.c:1362
#13 0x000000000055f6db in type_call.25495 (type=<optimized out>, type@entry=0x7ffff2fab460 <connectionType>, args=args@entry=('dbname=postgres host=**censored ip** user=admin password=**censored password** port=5432',), kwds=kwds@entry=0x0)
    at ../Objects/typeobject.c:745
#14 0x00000000004c8a7d in PyObject_Call (kw=0x0, arg=('dbname=postgres host=**censored ip** user=admin password=**censored password** port=5432',), func=<type at remote 0x7ffff2fab460>) at ../Objects/abstract.c:2529
#15 call_function_tail.5417 (callable=callable@entry=<type at remote 0x7ffff2fab460>, args=('dbname=postgres host=**censored ip** user=admin password=**censored password** port=5432',)) at ../Objects/abstract.c:2561
#16 0x00000000005ab155 in _PyObject_CallFunction_SizeT (callable=<type at remote 0x7ffff2fab460>, format=format@entry=0x7ffff2da3f60 "s") at ../Objects/abstract.c:2605
#17 0x00007ffff2d860b8 in psyco_connect (self=<optimized out>, args=<optimized out>, keywds=<optimized out>) at psycopg/psycopgmodule.c:111
#18 0x000000000052714b in ext_do_call (nk=<optimized out>, na=<optimized out>, flags=<optimized out>, pp_stack=0x7fffffffc340, func=<built-in function _connect>) at ../Python/ceval.c:4330
#19 PyEval_EvalFrameEx (
    f=f@entry=Frame 0x7ffff3071850, for file /usr/local/lib/python2.7/dist-packages/psycopg2/__init__.py, line 130, in connect (dsn='dbname=postgres host=**censored ip** user=admin password=**censored password** port=5432', connection_factory=None, cursor_factory=None, kwargs={'port': 5432, 'host': '**censored ip**', 'password': '**censored password**', 'user': 'admin', 'database': 'postgres'}, kwasync={}), throwflag=throwflag@entry=0) at ../Python/ceval.c:2705
#20 0x0000000000555551 in PyEval_EvalCodeEx (co=0x7ffff3047130, globals=<optimized out>, locals=locals@entry=0x0, args=<optimized out>, argcount=argcount@entry=0, kws=<optimized out>, kwcount=kwcount@entry=5,
    defs=defs@entry=0x7ffff305b838, defcount=3, closure=0x0) at ../Python/ceval.c:3252
#21 0x0000000000524338 in fast_function (nk=5, na=0, n=<optimized out>, pp_stack=0x7fffffffc530, func=<function at remote 0x7ffff3061050>) at ../Python/ceval.c:4116
#22 call_function (oparg=<optimized out>, pp_stack=0x7fffffffc530) at ../Python/ceval.c:4041
#23 PyEval_EvalFrameEx (
    f=f@entry=Frame 0xf37790, for file /home/ubuntu/workspace/external-database-create/awingu/clouddesktop-reposerver/fabfile/external_database/postgresql.py, line 21, in create_connection (connection_uri='postgresql://admin:**censored password**@**censored ip**:5432/', connection_args=<ParseResult(database='') at remote 0x7ffff3061938>), throwflag=throwflag@entry=0) at ../Python/ceval.c:2666
#24 0x0000000000567b1e in gen_send_ex.isra.0 (exc=0, arg=0x0) at ../Objects/genobject.c:85
#25 gen_iternext (gen=0x7ffff30626e0, gen@entry=<error reading variable: value has been optimized out>) at ../Objects/genobject.c:283
#26 0x00000000004c96a9 in wrap_next.25272 (self=<optimized out>, args=<optimized out>, wrapped=<optimized out>) at ../Objects/typeobject.c:4683
#27 0x00000000005244dd in PyObject_Call (kw=0x0, arg=(), func=<method-wrapper at remote 0x7ffff3050ad0>) at ../Objects/abstract.c:2529
#28 do_call (nk=<optimized out>, na=<optimized out>, pp_stack=0x7fffffffc6b0, func=<method-wrapper at remote 0x7ffff3050ad0>) at ../Python/ceval.c:4238
#29 call_function (oparg=<optimized out>, pp_stack=0x7fffffffc6b0) at ../Python/ceval.c:4043
#30 PyEval_EvalFrameEx (f=f@entry=Frame 0x7ffff2fbf5c0, for file /usr/lib/python2.7/contextlib.py, line 17, in __enter__ (self=<GeneratorContextManager(gen=<generator at remote 0x7ffff30626e0>) at remote 0x7ffff304a790>),
    throwflag=throwflag@entry=0) at ../Python/ceval.c:2666
#31 0x0000000000568b3a in PyEval_EvalCodeEx (closure=<optimized out>, defcount=<optimized out>, defs=0x0, kwcount=<optimized out>, kws=<optimized out>, argcount=-218368576, args=<optimized out>, locals=0x0, globals=<optimized out>,
    co=<optimized out>) at ../Python/ceval.c:3252
#32 function_call (func=func@entry=<function at remote 0x7ffff6af2c80>, arg=arg@entry=(<GeneratorContextManager(gen=<generator at remote 0x7ffff30626e0>) at remote 0x7ffff304a790>,), kw=kw@entry=0x0) at ../Objects/funcobject.c:526
#33 0x00000000004c2604 in PyObject_Call (kw=0x0, arg=(<GeneratorContextManager(gen=<generator at remote 0x7ffff30626e0>) at remote 0x7ffff304a790>,), func=<function at remote 0x7ffff6af2c80>) at ../Objects/abstract.c:2529
#34 instancemethod_call.8802 (func=<function at remote 0x7ffff6af2c80>, arg=(<GeneratorContextManager(gen=<generator at remote 0x7ffff30626e0>) at remote 0x7ffff304a790>,), kw=0x0) at ../Objects/classobject.c:2602
#35 0x00000000004c6e74 in PyObject_Call (kw=0x0, arg=(), func=<instancemethod at remote 0x7ffff4812aa0>) at ../Objects/abstract.c:2529
#36 PyObject_CallFunctionObjArgs (callable=callable@entry=<instancemethod at remote 0x7ffff4812aa0>) at ../Objects/abstract.c:2760
#37 0x0000000000526020 in PyEval_EvalFrameEx (
    f=f@entry=Frame 0x7ffff305d638, for file /home/ubuntu/workspace/external-database-create/awingu/clouddesktop-reposerver/fabfile/external_database/postgresql.py, line 53, in delete_database (connection_uri='postgresql://admin:**censored password**@**censored ip**:5432/', database='nghtdef_frontend', hostname='**censored ip**'), throwflag=throwflag@entry=0) at ../Python/ceval.c:2555
#38 0x00000000005247ea in fast_function (nk=<optimized out>, na=<optimized out>, n=2, pp_stack=0x7fffffffcd30, func=<function at remote 0x7ffff30617d0>) at ../Python/ceval.c:4106
---Type <return> to continue, or q <return> to quit---[
#39 call_function (oparg=<optimized out>, pp_stack=0x7fffffffcd30) at ../Python/ceval.c:4041
#40 PyEval_EvalFrameEx (
    f=f@entry=Frame 0xdac250, for file /home/ubuntu/workspace/external-database-create/awingu/clouddesktop-reposerver/fabfile/external_database/__init__.py, line 159, in delete (config={u'username': u'admin', u'conn_db': u'', u'protocol': u'postgresql', u'host': u'**censored ip**', u'import_path': u'postgresql', u'password': u'**censored password**', u'port': 5432}, connection_uri='postgresql://admin:**censored password**@**censored ip**:5432/', database_uris=('postgresql://nghtdef_frontend:nghtdef_frontend@**censored ip**:5432/nghtdef_frontend', 'postgresql://nghtdef_graphite:nghtdef_graphite@**censored ip**:5432/nghtdef_graphite'), connection_args=<ParseResult(database='') at remote 0x7ffff30f3e60>, scheme=u'postgresql', delete_user=<function at remote 0x7ffff3061758>, delete_database=<function at remote 0x7ffff30617d0>, exceptions=[], database_uri='postgresql://nghtdef_frontend:nghtdef_frontend@**censored ip**:5432/nghtdef_frontend', db_args=<ParseResult(database='nghtdef_frontend') at remote 0x7ffff3061848>), throwflag=throwflag@entry=0) at ../Python/ceval.c:2666
#41 0x0000000000568b3a in PyEval_EvalCodeEx (closure=<optimized out>, defcount=<optimized out>, defs=0x0, kwcount=<optimized out>, kws=<optimized out>, argcount=14336592, args=<optimized out>, locals=0x0, globals=<optimized out>,
    co=<optimized out>) at ../Python/ceval.c:3252
#42 function_call (func=<optimized out>, arg=<optimized out>, kw=<optimized out>) at ../Objects/funcobject.c:526

#43 0x0000000000525cb7 in PyObject_Call (kw={},
    arg=({u'username': u'admin', u'conn_db': u'', u'protocol': u'postgresql', u'host': u'**censored ip**', u'import_path': u'postgresql', u'password': u'**censored password**', u'port': 5432}, 'postgresql://admin:**censored password**@**censored ip**:5432/', 'postgresql://nghtdef_frontend:nghtdef_frontend@**censored ip**:5432/nghtdef_frontend', 'postgresql://nghtdef_graphite:nghtdef_graphite@**censored ip**:5432/nghtdef_graphite'), func=<function at remote 0x7ffff30f3c80>) at ../Objects/abstract.c:2529
#44 ext_do_call (nk=<optimized out>, na=<optimized out>, flags=<optimized out>, pp_stack=0x7fffffffcf30, func=<function at remote 0x7ffff30f3c80>) at ../Python/ceval.c:4333
#45 PyEval_EvalFrameEx (
    f=f@entry=Frame 0x7ffff2fbf960, for file /usr/local/lib/python2.7/dist-packages/fabric/tasks.py, line 173, in run (self=<WrappedCallableTask(__module__='fabfile.external_database', name='delete', is_default=False, wrapped=<function at remote 0x7ffff30f3c80>, __name__='delete', __doc__='Delete one or more databases on an external database server.\n\n    Provide a connection_uri which can delete users and databases.\n    And one or more database_uri for the databases and users to be deleted.\n\n    The uri should be formatted as follows:\n    <scheme>://<username>:<password>@<hostname>[:<port>]/<database>\n    With scheme one of "postgresql", "mysql" or "mssql".\n    In the case of the connection_uri, there won\'t be a /<database> part.\n    ') at remote 0x7ffff2fb9b90>, args=({u'username': u'admin', u'conn_db': u'', u'protocol': u'postgresql', u'host': u'**censored ip**', u'import_path': u'postgresql', u'password': u'**censored password**', u'port': 5432}, 'postgresql://admin:**censored password**@**censored ip**:5432/', 'postgresql://nghtdef_fronte...(truncated), throwflag=throwflag@entry=0) at ../Python/ceval.c:2705
#46 0x0000000000568b3a in PyEval_EvalCodeEx (closure=<optimized out>, defcount=<optimized out>, defs=0x0, kwcount=<optimized out>, kws=<optimized out>, argcount=-218367648, args=<optimized out>, locals=0x0, globals=<optimized out>,
    co=<optimized out>) at ../Python/ceval.c:3252
#47 function_call (func=<optimized out>, arg=<optimized out>, kw=<optimized out>) at ../Objects/funcobject.c:526
#48 0x0000000000525cb7 in PyObject_Call (kw={},
    arg=(<WrappedCallableTask(__module__='fabfile.external_database', name='delete', is_default=False, wrapped=<function at remote 0x7ffff30f3c80>, __name__='delete', __doc__='Delete one or more databases on an external database server.\n\n    Provide a connection_uri which can delete users and databases.\n    And one or more database_uri for the databases and users to be deleted.\n\n    The uri should be formatted as follows:\n    <scheme>://<username>:<password>@<hostname>[:<port>]/<database>\n    With scheme one of "postgresql", "mysql" or "mssql".\n    In the case of the connection_uri, there won\'t be a /<database> part.\n    ') at remote 0x7ffff2fb9b90>, {u'username': u'admin', u'conn_db': u'', u'protocol': u'postgresql', u'host': u'**censored ip**', u'import_path': u'postgresql', u'password': u'**censored password**', u'port': 5432}, 'postgresql://admin:**censored password**@**censored ip**:5432/', 'postgresql://nghtdef_frontend:nghtdef_frontend@**censored ip**:5432/nghtdef_frontend', 'postgresql://nghtdef_graphite:nghtdef_graphite@**censored ip**...(truncated), func=<function at remote 0x7ffff50f4aa0>) at ../Objects/abstract.c:2529
#49 ext_do_call (nk=<optimized out>, na=<optimized out>, flags=<optimized out>, pp_stack=0x7fffffffd130, func=<function at remote 0x7ffff50f4aa0>) at ../Python/ceval.c:4333

#50 PyEval_EvalFrameEx (
    f=f@entry=Frame 0x7ffff2fbf790, for file /usr/local/lib/python2.7/dist-packages/fabric/tasks.py, line 170, in __call__ (self=<WrappedCallableTask(__module__='fabfile.external_database', name='delete', is_default=False, wrapped=<function at remote 0x7ffff30f3c80>, __name__='delete', __doc__='Delete one or more databases on an external database server.\n\n    Provide a connection_uri which can delete users and databases.\n    And one or more database_uri for the databases and users to be deleted.\n\n    The uri should be formatted as follows:\n    <scheme>://<username>:<password>@<hostname>[:<port>]/<database>\n    With scheme one of "postgresql", "mysql" or "mssql".\n    In the case of the connection_uri, there won\'t be a /<database> part.\n    ') at remote 0x7ffff2fb9b90>, args=({u'username': u'admin', u'conn_db': u'', u'protocol': u'postgresql', u'host': u'**censored ip**', u'import_path': u'postgresql', u'password': u'**censored password**', u'port': 5432}, 'postgresql://admin:**censored password**@**censored ip**:5432/', 'postgresql://nghtdef_f...(truncated), throwflag=throwflag@entry=0) at ../Python/ceval.c:2705
#51 0x0000000000568b3a in PyEval_EvalCodeEx (closure=<optimized out>, defcount=<optimized out>, defs=0x0, kwcount=<optimized out>, kws=<optimized out>, argcount=-218368112, args=<optimized out>, locals=0x0, globals=<optimized out>,
    co=<optimized out>) at ../Python/ceval.c:3252
#52 function_call (func=func@entry=<function at remote 0x7ffff50f4a28>,
    arg=arg@entry=(<WrappedCallableTask(__module__='fabfile.external_database', name='delete', is_default=False, wrapped=<function at remote 0x7ffff30f3c80>, __name__='delete', __doc__='Delete one or more databases on an external database server.\n\n    Provide a connection_uri which can delete users and databases.\n    And one or more database_uri for the databases and users to be deleted.\n\n    The uri should be formatted as follows:\n    <scheme>://<username>:<password>@<hostname>[:<port>]/<database>\n    With scheme one of "postgresql", "mysql" or "mssql".\n    In the case of the connection_uri, there won\'t be a /<database> part.\n    ') at remote 0x7ffff2fb9b90>, {u'username': u'admin', u'conn_db': u'', u'protocol': u'postgresql', u'host': u'**censored ip**', u'import_path': u'postgresql', u'password': u'**censored password**', u'port': 5432}, 'postgresql://admin:**censored password**@**censored ip**:5432/', 'postgresql://nghtdef_frontend:nghtdef_frontend@**censored ip**:5432/nghtdef_frontend', 'postgresql://nghtdef_graphite:nghtdef_graphite@**censored ip**...(truncated), kw=kw@entry=0x0) at ../Objects/funcobject.c:526
#53 0x00000000004c2604 in PyObject_Call (kw=0x0,
    arg=(<WrappedCallableTask(__module__='fabfile.external_database', name='delete', is_default=False, wrapped=<function at remote 0x7ffff30f3c80>, __name__='delete', __doc__='Delete one or more databases on an external database server.\n\n    Provide a connection_uri which can delete users and databases.\n    And one or more database_uri for the databases and users to be deleted.\n\n    The uri should be formatted as follows:\n    <scheme>://<username>:<password>@<hostname>[:<port>]/<database>\n    With scheme one of "postgresql", "mysql" or "mssql".\n    In the case of the connection_uri, there won\'t be a /<database> part.\n    ') at remote 0x7ffff2fb9b90>, {u'username': u'admin', u'conn_db': u'', u'protocol': u'postgresql', u'host': u'**censored ip**', u'import_path': u'postgresql', u'password': u'**censored password**', u'port': 5432}, 'postgresql://admin:**censored password**@**censored ip**:5432/', 'postgresql://nghtdef_frontend:nghtdef_frontend@**censored ip**:5432/nghtdef_frontend', 'postgresql://nghtdef_graphite:nghtdef_graphite@**censored ip**...(truncated), func=<function at remote 0x7ffff50f4a28>) at ../Objects/abstract.c:2529
---Type <return> to continue, or q <return> to quit---
#54 instancemethod_call.8802 (func=<function at remote 0x7ffff50f4a28>, func@entry=<instancemethod at remote 0x7ffff4856140>,
    arg=(<WrappedCallableTask(__module__='fabfile.external_database', name='delete', is_default=False, wrapped=<function at remote 0x7ffff30f3c80>, __name__='delete', __doc__='Delete one or more databases on an external database server.\n\n    Provide a connection_uri which can delete users and databases.\n    And one or more database_uri for the databases and users to be deleted.\n\n    The uri should be formatted as follows:\n    <scheme>://<username>:<password>@<hostname>[:<port>]/<database>\n    With scheme one of "postgresql", "mysql" or "mssql".\n    In the case of the connection_uri, there won\'t be a /<database> part.\n    ') at remote 0x7ffff2fb9b90>, {u'username': u'admin', u'conn_db': u'', u'protocol': u'postgresql', u'host': u'**censored ip**', u'import_path': u'postgresql', u'password': u'**censored password**', u'port': 5432}, 'postgresql://admin:**censored password**@**censored ip**:5432/', 'postgresql://nghtdef_frontend:nghtdef_frontend@**censored ip**:5432/nghtdef_frontend', 'postgresql://nghtdef_graphite:nghtdef_graphite@**censored ip**...(truncated),
    arg@entry=({u'username': u'admin', u'conn_db': u'', u'protocol': u'postgresql', u'host': u'**censored ip**', u'import_path': u'postgresql', u'password': u'**censored password**', u'port': 5432}, 'postgresql://admin:**censored password**@**censored ip**:5432/', 'postgresql://nghtdef_frontend:nghtdef_frontend@**censored ip**:5432/nghtdef_frontend', 'postgresql://nghtdef_graphite:nghtdef_graphite@**censored ip**:5432/nghtdef_graphite'), kw=kw@entry=0x0) at ../Objects/classobject.c:2602
#55 0x00000000004d26cf in PyObject_Call (kw=0x0,
    arg=({u'username': u'admin', u'conn_db': u'', u'protocol': u'postgresql', u'host': u'**censored ip**', u'import_path': u'postgresql', u'password': u'**censored password**', u'port': 5432}, 'postgresql://admin:**censored password**@**censored ip**:5432/', 'postgresql://nghtdef_frontend:nghtdef_frontend@**censored ip**:5432/nghtdef_frontend', 'postgresql://nghtdef_graphite:nghtdef_graphite@**censored ip**:5432/nghtdef_graphite'), func=<instancemethod at remote 0x7ffff4856140>)
    at ../Objects/abstract.c:2529
#56 slot_tp_call.25849 (self=<optimized out>,
    args=({u'username': u'admin', u'conn_db': u'', u'protocol': u'postgresql', u'host': u'**censored ip**', u'import_path': u'postgresql', u'password': u'**censored password**', u'port': 5432}, 'postgresql://admin:**censored password**@**censored ip**:5432/', 'postgresql://nghtdef_frontend:nghtdef_frontend@**censored ip**:5432/nghtdef_frontend', 'postgresql://nghtdef_graphite:nghtdef_graphite@**censored ip**:5432/nghtdef_graphite'), kwds=0x0) at ../Objects/typeobject.c:5432
#57 0x0000000000525cb7 in PyObject_Call (kw=0x0,
    arg=({u'username': u'admin', u'conn_db': u'', u'protocol': u'postgresql', u'host': u'**censored ip**', u'import_path': u'postgresql', u'password': u'**censored password**', u'port': 5432}, 'postgresql://admin:**censored password**@**censored ip**:5432/', 'postgresql://nghtdef_frontend:nghtdef_frontend@**censored ip**:5432/nghtdef_frontend', 'postgresql://nghtdef_graphite:nghtdef_graphite@**censored ip**:5432/nghtdef_graphite'),
    func=<WrappedCallableTask(__module__='fabfile.external_database', name='delete', is_default=False, wrapped=<function at remote 0x7ffff30f3c80>, __name__='delete', __doc__='Delete one or more databases on an external database server.\n\n    Provide a connection_uri which can delete users and databases.\n    And one or more database_uri for the databases and users to be deleted.\n\n    The uri should be formatted as follows:\n    <scheme>://<username>:<password>@<hostname>[:<port>]/<database>\n    With scheme one of "postgresql", "mysql" or "mssql".\n    In the case of the connection_uri, there won\'t be a /<database> part.\n    ') at remote 0x7ffff2fb9b90>) at ../Objects/abstract.c:2529
#58 ext_do_call (nk=<optimized out>, na=<optimized out>, flags=<optimized out>, pp_stack=0x7fffffffd650,
    func=<WrappedCallableTask(__module__='fabfile.external_database', name='delete', is_default=False, wrapped=<function at remote 0x7ffff30f3c80>, __name__='delete', __doc__='Delete one or more databases on an external database server.\n\n    Provide a connection_uri which can delete users and databases.\n    And one or more database_uri for the databases and users to be deleted.\n\n    The uri should be formatted as follows:\n    <scheme>://<username>:<password>@<hostname>[:<port>]/<database>\n    With scheme one of "postgresql", "mysql" or "mssql".\n    In the case of the connection_uri, there won\'t be a /<database> part.\n    ') at remote 0x7ffff2fb9b90>) at ../Python/ceval.c:4333
#59 PyEval_EvalFrameEx (
    f=f@entry=Frame 0x7ffff311ada8, for file /home/ubuntu/workspace/external-database-create/awingu/clouddesktop-reposerver/fabfile/external_database/__init__.py, line 74, in delete_all (config_name='postgresql', prefix='nghtdef', config={u'username': u'admin', u'conn_db': u'', u'protocol': u'postgresql', u'host': u'**censored ip**', u'import_path': u'postgresql', u'password': u'**censored password**', u'port': 5432}, connection_uri='postgresql://admin:**censored password**@**censored ip**:5432/', databases={'frontend_web': 'postgresql://nghtdef_frontend:nghtdef_frontend@**censored ip**:5432/nghtdef_frontend', 'graphite_web': 'postgresql://nghtdef_graphite:nghtdef_graphite@**censored ip**:5432/nghtdef_graphite'}),
    throwflag=throwflag@entry=0) at ../Python/ceval.c:2705
#60 0x0000000000568b3a in PyEval_EvalCodeEx (closure=<optimized out>, defcount=<optimized out>, defs=0x0, kwcount=<optimized out>, kws=<optimized out>, argcount=-216945240, args=<optimized out>, locals=0x0, globals=<optimized out>,
    co=<optimized out>) at ../Python/ceval.c:3252
#61 function_call (func=<optimized out>, arg=<optimized out>, kw=<optimized out>) at ../Objects/funcobject.c:526
#62 0x0000000000525cb7 in PyObject_Call (kw={}, arg=('postgresql', 'nghtdef'), func=<function at remote 0x7ffff30f3b90>) at ../Objects/abstract.c:2529
#63 ext_do_call (nk=<optimized out>, na=<optimized out>, flags=<optimized out>, pp_stack=0x7fffffffd850, func=<function at remote 0x7ffff30f3b90>) at ../Python/ceval.c:4333
#64 PyEval_EvalFrameEx (
    f=f@entry=Frame 0x7ffff2fbf3f0, for file /usr/local/lib/python2.7/dist-packages/fabric/tasks.py, line 173, in run (self=<WrappedCallableTask(__module__='fabfile.external_database', name='delete_all', is_default=False, wrapped=<function at remote 0x7ffff30f3b90>, __name__='delete_all', __doc__=None) at remote 0x7ffff30eec10>, args=('postgresql', 'nghtdef'), kwargs={}), throwflag=throwflag@entry=0) at ../Python/ceval.c:2705
#65 0x0000000000568b3a in PyEval_EvalCodeEx (closure=<optimized out>, defcount=<optimized out>, defs=0x0, kwcount=<optimized out>, kws=<optimized out>, argcount=-218369040, args=<optimized out>, locals=0x0, globals=<optimized out>,
    co=<optimized out>) at ../Python/ceval.c:3252
#66 function_call (func=<optimized out>, arg=<optimized out>, kw=<optimized out>) at ../Objects/funcobject.c:526
#67 0x0000000000525cb7 in PyObject_Call (kw={},
    arg=(<WrappedCallableTask(__module__='fabfile.external_database', name='delete_all', is_default=False, wrapped=<function at remote 0x7ffff30f3b90>, __name__='delete_all', __doc__=None) at remote 0x7ffff30eec10>, 'postgresql', 'nghtdef'), func=<function at remote 0x7ffff50f4aa0>) at ../Objects/abstract.c:2529
#68 ext_do_call (nk=<optimized out>, na=<optimized out>, flags=<optimized out>, pp_stack=0x7fffffffda50, func=<function at remote 0x7ffff50f4aa0>) at ../Python/ceval.c:4333
#69 PyEval_EvalFrameEx (
    f=f@entry=Frame 0xf2a6f0, for file /usr/local/lib/python2.7/dist-packages/fabric/tasks.py, line 276, in _execute (task=<WrappedCallableTask(__module__='fabfile.external_database', name='delete_all', is_default=False, wrapped=<function at remote 0x7ffff30f3b90>, __name__='delete_all', __doc__=None) at remote 0x7ffff30eec10>, host='localhost', my_env={'clean_revert': True, 'all_hosts': ['localhost'], 'effective_roles': [], 'command': 'external_database.delete_all'}, args=('postgresql', 'nghtdef'), kwargs={}, jobs=<JobQueue(_finished=False, _queued=[], _running=[], _debug=False, _num_of_jobs=0, _closed=False, _max=1, _comms_queue=None, _completed=[]) at remote 0x7ffff2fb9d10>, queue=None, multiprocessing=None, local_env={'effective_roles': [...], 'all_hosts': [...], 'port': '22', 'clean_revert': True, 'host': 'localhost', 'command': 'external_database.delete_all', 'user': 'root', 'host_string': 'localhost'}),
---Type <return> to continue, or q <return> to quit---
    throwflag=throwflag@entry=0) at ../Python/ceval.c:2705
#70 0x0000000000555551 in PyEval_EvalCodeEx (co=0x7ffff50bdf30, globals=<optimized out>, locals=locals@entry=0x0, args=<optimized out>, argcount=argcount@entry=8, kws=<optimized out>, kwcount=kwcount@entry=0, defs=defs@entry=0x0,
    defcount=defcount@entry=0, closure=0x0) at ../Python/ceval.c:3252
#71 0x0000000000525560 in fast_function (nk=0, na=8, n=<optimized out>, pp_stack=0x7fffffffdc40, func=<function at remote 0x7ffff50f4cf8>) at ../Python/ceval.c:4116
#72 call_function (oparg=<optimized out>, pp_stack=0x7fffffffdc40) at ../Python/ceval.c:4041
#73 PyEval_EvalFrameEx (
    f=f@entry=Frame 0xdabd50, for file /usr/local/lib/python2.7/dist-packages/fabric/tasks.py, line 386, in execute (task=<WrappedCallableTask(__module__='fabfile.external_database', name='delete_all', is_default=False, wrapped=<function at remote 0x7ffff30f3b90>, __name__='delete_all', __doc__=None) at remote 0x7ffff30eec10>, args=('postgresql', 'nghtdef'), kwargs={'hosts': [], 'roles': [], 'exclude_hosts': []}, my_env={'clean_revert': True, 'all_hosts': ['localhost'], 'effective_roles': [], 'command': 'external_database.delete_all'}, results={}, is_callable=False, new_kwargs={}, hosts=[...], roles=[...], exclude_hosts=[...], parallel=False, multiprocessing=None, pool_size=1, queue=None, jobs=<JobQueue(_finished=False, _queued=[], _running=[], _debug=False, _num_of_jobs=0, _closed=False, _max=1, _comms_queue=None, _completed=[]) at remote 0x7ffff2fb9d10>, host='localhost'), throwflag=throwflag@entry=0) at ../Python/ceval.c:2666
#74 0x0000000000568b3a in PyEval_EvalCodeEx (closure=<optimized out>, defcount=<optimized out>, defs=0x0, kwcount=<optimized out>, kws=<optimized out>, argcount=14335312, args=<optimized out>, locals=0x0, globals=<optimized out>,
    co=<optimized out>) at ../Python/ceval.c:3252
#75 function_call (func=<optimized out>, arg=<optimized out>, kw=<optimized out>) at ../Objects/funcobject.c:526
#76 0x0000000000525cb7 in PyObject_Call (kw={'hosts': [], 'roles': [], 'exclude_hosts': []}, arg=('external_database.delete_all', 'postgresql', 'nghtdef'), func=<function at remote 0x7ffff50f4de8>) at ../Objects/abstract.c:2529
#77 ext_do_call (nk=<optimized out>, na=<optimized out>, flags=<optimized out>, pp_stack=0x7fffffffde40, func=<function at remote 0x7ffff50f4de8>) at ../Python/ceval.c:4333
#78 PyEval_EvalFrameEx (
    f=f@entry=Frame 0xa138b0, for file /usr/local/lib/python2.7/dist-packages/fabric/main.py, line 756, in main (fabfile_locations=None, parser=<OptionParser(process_default_values=True, allow_interspersed_args=True, _long_opt={'--eagerly-disconnect': <Option(_long_opts=['--eagerly-disconnect'], help='disconnect from hosts as soon as possible', callback_args=None, callback=None, default=False, nargs=None, choices=None, dest='eagerly_disconnect', container=<...>, _short_opts=['-e'], action='store_true', const=None, callback_kwargs=None, type=None, metavar=None) at remote 0x7ffff533e3b0>, '--port': <Option(_long_opts=['--port'], help='SSH connection port', callback_args=None, callback=None, default='22', nargs=1, choices=None, dest='port', container=<...>, _short_opts=[], action='store', const=None, callback_kwargs=None, type='string', metavar=None) at remote 0x7ffff50cd950>, '--keepalive': <Option(_long_opts=['--keepalive'], help='enables a keepalive every N seconds', callback_args=None, callback=None, default=0, nargs=1, c...(truncated), throwflag=throwflag@entry=0) at ../Python/ceval.c:2705
#79 0x0000000000555551 in PyEval_EvalCodeEx (co=0x7ffff7e9eab0, globals=<optimized out>, locals=locals@entry=0x0, args=<optimized out>, argcount=argcount@entry=0, kws=<optimized out>, kwcount=kwcount@entry=0,
    defs=defs@entry=0x7ffff4e81968, defcount=1, closure=0x0) at ../Python/ceval.c:3252
#80 0x0000000000524338 in fast_function (nk=0, na=0, n=<optimized out>, pp_stack=0x7fffffffe030, func=<function at remote 0x7ffff4e89aa0>) at ../Python/ceval.c:4116
#81 call_function (oparg=<optimized out>, pp_stack=0x7fffffffe030) at ../Python/ceval.c:4041
#82 PyEval_EvalFrameEx (f=f@entry=Frame 0x7ffff7e713e0, for file /usr/local/bin/fab, line 11, in <module> (), throwflag=throwflag@entry=0) at ../Python/ceval.c:2666
#83 0x0000000000567d14 in PyEval_EvalCodeEx (closure=0x0, defcount=0, defs=0x0, kwcount=0, kws=0x0, argcount=0, args=0x0, locals=<� at remote 0x7ffff7e71558>,
    globals='Return true if the object is a user-defined function.\n\n    Function objects provide these attributes:\n        __doc__         documentation string\n        __name__        name with which this function was defined\n        func_code       code object containing compiled function bytecode\n        func_defaults   tuple of any default values for arguments\n        func_doc        (same as __doc__)\n        func_globals    global namespace in which this function was defined\n        func_name       (same as __name__)', co=0x7ffff7edb1b0) at ../Python/ceval.c:3252
#84 PyEval_EvalCode (locals=<� at remote 0x7ffff7e71558>,
    globals='Return true if the object is a user-defined function.\n\n    Function objects provide these attributes:\n        __doc__         documentation string\n        __name__        name with which this function was defined\n        func_code       code object containing compiled function bytecode\n        func_defaults   tuple of any default values for arguments\n        func_doc        (same as __doc__)\n        func_globals    global namespace in which this function was defined\n        func_name       (same as __name__)', co=0x7ffff7edb1b0) at ../Python/ceval.c:667
#85 run_mod.42576 (mod=mod@entry=0x977f18, filename=filename@entry=0x7fffffffe66b "/usr/local/bin/fab",
    globals=globals@entry={'__builtins__': <module at remote 0x7ffff7fa1b08>, '__file__': '/usr/local/bin/fab', '__package__': None, 'sys': <module at remote 0x7ffff7fa1bb0>, 're': <module at remote 0x7ffff7ed32b8>, '__name__': '__main__', 'main': <function at remote 0x7ffff4e89aa0>, '__doc__': None},
    locals=locals@entry={'__builtins__': <module at remote 0x7ffff7fa1b08>, '__file__': '/usr/local/bin/fab', '__package__': None, 'sys': <module at remote 0x7ffff7fa1bb0>, 're': <module at remote 0x7ffff7ed32b8>, '__name__': '__main__', 'main': <function at remote 0x7ffff4e89aa0>, '__doc__': None}, flags=flags@entry=0x7fffffffe1e0, arena=arena@entry=0x9a4a80) at ../Python/pythonrun.c:1370
#86 0x0000000000465bf4 in PyRun_FileExFlags (fp=fp@entry=0x9ef390, filename=filename@entry=0x7fffffffe66b "/usr/local/bin/fab", start=start@entry=257,
    globals=globals@entry={'__builtins__': <module at remote 0x7ffff7fa1b08>, '__file__': '/usr/local/bin/fab', '__package__': None, 'sys': <module at remote 0x7ffff7fa1bb0>, 're': <module at remote 0x7ffff7ed32b8>, '__name__': '__main__', 'main': <function at remote 0x7ffff4e89aa0>, '__doc__': None},
    locals=locals@entry={'__builtins__': <module at remote 0x7ffff7fa1b08>, '__file__': '/usr/local/bin/fab', '__package__': None, 'sys': <module at remote 0x7ffff7fa1bb0>, 're': <module at remote 0x7ffff7ed32b8>, '__name__': '__main__', 'main': <function at remote 0x7ffff4e89aa0>, '__doc__': None}, closeit=closeit@entry=1, flags=flags@entry=0x7fffffffe1e0) at ../Python/pythonrun.c:1356
#87 0x000000000046612d in PyRun_SimpleFileExFlags (fp=fp@entry=0x9ef390, filename=<optimized out>, filename@entry=0x7fffffffe66b "/usr/local/bin/fab", closeit=closeit@entry=1, flags=flags@entry=0x7fffffffe1e0)
    at ../Python/pythonrun.c:948
#88 0x0000000000466229 in PyRun_AnyFileExFlags (fp=fp@entry=0x9ef390, filename=filename@entry=0x7fffffffe66b "/usr/local/bin/fab", closeit=closeit@entry=1, flags=flags@entry=0x7fffffffe1e0) at ../Python/pythonrun.c:752
#89 0x0000000000466d92 in Py_Main (argc=<optimized out>, argv=0x7fffffffe398) at ../Modules/main.c:640
#90 0x00007ffff7815f45 in __libc_start_main (main=0x466e50 <main>, argc=9, argv=0x7fffffffe398, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffe388) at libc-start.c:287
#91 0x0000000000577c2e in _start ()

On psycopg2==2.7.1 we get the following segmentation fault:

Program received signal SIGSEGV, Segmentation fault.
__strcmp_ssse3 () at ../sysdeps/x86_64/multiarch/../strcmp.S:209
209	../sysdeps/x86_64/multiarch/../strcmp.S: No such file or directory.
(gdb) bt
#0  __strcmp_ssse3 () at ../sysdeps/x86_64/multiarch/../strcmp.S:209
#1  0x00007ffff6260699 in getrn (lh=lh@entry=0xa9eb60, data=data@entry=0x1030120, rhash=rhash@entry=0x7fffffff9da8) at lhash.c:432
#2  0x00007ffff6260972 in lh_insert (lh=0xa9eb60, data=0x1030120) at lhash.c:189
#3  0x00007ffff61dc8aa in OBJ_NAME_add (name=0x0, type=2, data=0x7ffff2869ec0 "\264\003") at o_names.c:207
#4  0x00007ffff28f1ff7 in SSL_library_init () from /usr/local/lib/python2.7/dist-packages/psycopg2/.libs/./libssl-cdf7ba29.so.1.0.2k
#5  0x00007ffff2b62e9c in ?? () from /usr/local/lib/python2.7/dist-packages/psycopg2/.libs/libpq-9c51d239.so.5.9
#6  0x00007ffff2b505dd in PQconnectPoll () from /usr/local/lib/python2.7/dist-packages/psycopg2/.libs/libpq-9c51d239.so.5.9
#7  0x00007ffff2b50e3e in ?? () from /usr/local/lib/python2.7/dist-packages/psycopg2/.libs/libpq-9c51d239.so.5.9
#8  0x00007ffff2b516ef in PQconnectdb () from /usr/local/lib/python2.7/dist-packages/psycopg2/.libs/libpq-9c51d239.so.5.9
#9  0x00007ffff2d8c241 in _conn_sync_connect (self=0x7ffff30bcc80) at psycopg/connection_int.c:716
#10 conn_connect (self=self@entry=0x7ffff30bcc80, async=<optimized out>) at psycopg/connection_int.c:812
#11 0x00007ffff2d8cf84 in connection_setup (async=<optimized out>, dsn=<optimized out>, self=0x7ffff30bcc80) at psycopg/connection_type.c:1277
#12 connection_init (obj=obj@entry=<psycopg2.extensions.connection at remote 0x7ffff30bcc80>, args=args@entry=('port=5432 host=**censored ip** password=**censored password** dbname=postgres user=admin',), kwds=kwds@entry=0x0)
    at psycopg/connection_type.c:1362
#13 0x000000000055f6db in type_call.25495 (type=<optimized out>, type@entry=0x7ffff2fab460 <connectionType>, args=args@entry=('port=5432 host=**censored ip** password=**censored password** dbname=postgres user=admin',), kwds=kwds@entry=0x0)
    at ../Objects/typeobject.c:745
#14 0x00000000004c8a7d in PyObject_Call (kw=0x0, arg=('port=5432 host=**censored ip** password=**censored password** dbname=postgres user=admin',), func=<type at remote 0x7ffff2fab460>) at ../Objects/abstract.c:2529
#15 call_function_tail.5417 (callable=callable@entry=<type at remote 0x7ffff2fab460>, args=('port=5432 host=**censored ip** password=**censored password** dbname=postgres user=admin',)) at ../Objects/abstract.c:2561
#16 0x00000000005ab155 in _PyObject_CallFunction_SizeT (callable=<type at remote 0x7ffff2fab460>, format=format@entry=0x7ffff2da3f60 "s") at ../Objects/abstract.c:2605
#17 0x00007ffff2d860b8 in psyco_connect (self=<optimized out>, args=<optimized out>, keywds=<optimized out>) at psycopg/psycopgmodule.c:111
#18 0x000000000052714b in ext_do_call (nk=<optimized out>, na=<optimized out>, flags=<optimized out>, pp_stack=0x7fffffffc340, func=<built-in function _connect>) at ../Python/ceval.c:4330
#19 PyEval_EvalFrameEx (
    f=f@entry=Frame 0x7ffff302c850, for file /usr/local/lib/python2.7/dist-packages/psycopg2/__init__.py, line 130, in connect (dsn='port=5432 host=**censored ip** password=**censored password** dbname=postgres user=admin', connection_factory=None, cursor_factory=None, kwargs={'port': 5432, 'host': '**censored ip**', 'password': '**censored password**', 'user': 'admin', 'database': 'postgres'}, kwasync={}), throwflag=throwflag@entry=0) at ../Python/ceval.c:2705
#20 0x0000000000555551 in PyEval_EvalCodeEx (co=0x7ffff2ff5130, globals=<optimized out>, locals=locals@entry=0x0, args=<optimized out>, argcount=argcount@entry=0, kws=<optimized out>, kwcount=kwcount@entry=5, 
    defs=defs@entry=0x7ffff3018888, defcount=3, closure=0x0) at ../Python/ceval.c:3252
#21 0x0000000000524338 in fast_function (nk=5, na=0, n=<optimized out>, pp_stack=0x7fffffffc530, func=<function at remote 0x7ffff300ff50>) at ../Python/ceval.c:4116
#22 call_function (oparg=<optimized out>, pp_stack=0x7fffffffc530) at ../Python/ceval.c:4041
#23 PyEval_EvalFrameEx (
    f=f@entry=Frame 0xef3580, for file /home/ubuntu/workspace/external-database-create/awingu/clouddesktop-reposerver/fabfile/external_database/postgresql.py, line 21, in create_connection (connection_uri='postgresql://admin:**censored password**@**censored ip**:5432/', connection_args=<ParseResult(database='') at remote 0x7ffff2fbc8c0>), throwflag=throwflag@entry=0) at ../Python/ceval.c:2666
#24 0x0000000000567b1e in gen_send_ex.isra.0 (exc=0, arg=0x0) at ../Objects/genobject.c:85
#25 gen_iternext (gen=0x7ffff301e730, gen@entry=<error reading variable: value has been optimized out>) at ../Objects/genobject.c:283
#26 0x00000000004c96a9 in wrap_next.25272 (self=<optimized out>, args=<optimized out>, wrapped=<optimized out>) at ../Objects/typeobject.c:4683
#27 0x00000000005244dd in PyObject_Call (kw=0x0, arg=(), func=<method-wrapper at remote 0x7ffff300ed90>) at ../Objects/abstract.c:2529
#28 do_call (nk=<optimized out>, na=<optimized out>, pp_stack=0x7fffffffc6b0, func=<method-wrapper at remote 0x7ffff300ed90>) at ../Python/ceval.c:4238
#29 call_function (oparg=<optimized out>, pp_stack=0x7fffffffc6b0) at ../Python/ceval.c:4043
#30 PyEval_EvalFrameEx (f=f@entry=Frame 0x7ffff2fbb5c0, for file /usr/lib/python2.7/contextlib.py, line 17, in __enter__ (self=<GeneratorContextManager(gen=<generator at remote 0x7ffff301e730>) at remote 0x7ffff2ffaa50>), 
    throwflag=throwflag@entry=0) at ../Python/ceval.c:2666
#31 0x0000000000568b3a in PyEval_EvalCodeEx (closure=<optimized out>, defcount=<optimized out>, defs=0x0, kwcount=<optimized out>, kws=<optimized out>, argcount=-218384960, args=<optimized out>, locals=0x0, globals=<optimized out>, 
    co=<optimized out>) at ../Python/ceval.c:3252
#32 function_call (func=func@entry=<function at remote 0x7ffff6af2c80>, arg=arg@entry=(<GeneratorContextManager(gen=<generator at remote 0x7ffff301e730>) at remote 0x7ffff2ffaa50>,), kw=kw@entry=0x0) at ../Objects/funcobject.c:526
#33 0x00000000004c2604 in PyObject_Call (kw=0x0, arg=(<GeneratorContextManager(gen=<generator at remote 0x7ffff301e730>) at remote 0x7ffff2ffaa50>,), func=<function at remote 0x7ffff6af2c80>) at ../Objects/abstract.c:2529
#34 instancemethod_call.8802 (func=<function at remote 0x7ffff6af2c80>, arg=(<GeneratorContextManager(gen=<generator at remote 0x7ffff301e730>) at remote 0x7ffff2ffaa50>,), kw=0x0) at ../Objects/classobject.c:2602
#35 0x00000000004c6e74 in PyObject_Call (kw=0x0, arg=(), func=<instancemethod at remote 0x7ffff4810aa0>) at ../Objects/abstract.c:2529
#36 PyObject_CallFunctionObjArgs (callable=callable@entry=<instancemethod at remote 0x7ffff4810aa0>) at ../Objects/abstract.c:2760
#37 0x0000000000526020 in PyEval_EvalFrameEx (
    f=f@entry=Frame 0x7ffff300b638, for file /home/ubuntu/workspace/external-database-create/awingu/clouddesktop-reposerver/fabfile/external_database/postgresql.py, line 53, in delete_database (connection_uri='postgresql://admin:**censored password**@**censored ip**:5432/', database='nghtdef_frontend', hostname='**censored ip**'), throwflag=throwflag@entry=0) at ../Python/ceval.c:2555
#38 0x00000000005247ea in fast_function (nk=<optimized out>, na=<optimized out>, n=2, pp_stack=0x7fffffffcd30, func=<function at remote 0x7ffff2fbc758>) at ../Python/ceval.c:4106
---Type <return> to continue, or q <return> to quit---
#39 call_function (oparg=<optimized out>, pp_stack=0x7fffffffcd30) at ../Python/ceval.c:4041
#40 PyEval_EvalFrameEx (
    f=f@entry=Frame 0xef27f0, for file /home/ubuntu/workspace/external-database-create/awingu/clouddesktop-reposerver/fabfile/external_database/__init__.py, line 159, in delete (config={u'username': u'admin', u'conn_db': u'', u'protocol': u'postgresql', u'host': u'**censored ip**', u'import_path': u'postgresql', u'password': u'**censored password**', u'port': 5432}, connection_uri='postgresql://admin:**censored password**@**censored ip**:5432/', database_uris=('postgresql://nghtdef_frontend:nghtdef_frontend@**censored ip**:5432/nghtdef_frontend', 'postgresql://nghtdef_graphite:nghtdef_graphite@**censored ip**:5432/nghtdef_graphite'), connection_args=<ParseResult(database='') at remote 0x7ffff3070e60>, scheme=u'postgresql', delete_user=<function at remote 0x7ffff2fbc6e0>, delete_database=<function at remote 0x7ffff2fbc758>, exceptions=[], database_uri='postgresql://nghtdef_frontend:nghtdef_frontend@**censored ip**:5432/nghtdef_frontend', db_args=<ParseResult(database='nghtdef_frontend') at remote 0x7ffff2fbc7d0>), throwflag=throwflag@entry=0) at ../Python/ceval.c:2666
#41 0x0000000000568b3a in PyEval_EvalCodeEx (closure=<optimized out>, defcount=<optimized out>, defs=0x0, kwcount=<optimized out>, kws=<optimized out>, argcount=15673328, args=<optimized out>, locals=0x0, globals=<optimized out>, 
    co=<optimized out>) at ../Python/ceval.c:3252
#42 function_call (func=<optimized out>, arg=<optimized out>, kw=<optimized out>) at ../Objects/funcobject.c:526
#43 0x0000000000525cb7 in PyObject_Call (kw={}, 
    arg=({u'username': u'admin', u'conn_db': u'', u'protocol': u'postgresql', u'host': u'**censored ip**', u'import_path': u'postgresql', u'password': u'**censored password**', u'port': 5432}, 'postgresql://admin:**censored password**@**censored ip**:5432/', 'postgresql://nghtdef_frontend:nghtdef_frontend@**censored ip**:5432/nghtdef_frontend', 'postgresql://nghtdef_graphite:nghtdef_graphite@**censored ip**:5432/nghtdef_graphite'), func=<function at remote 0x7ffff3070c80>) at ../Objects/abstract.c:2529
#44 ext_do_call (nk=<optimized out>, na=<optimized out>, flags=<optimized out>, pp_stack=0x7fffffffcf30, func=<function at remote 0x7ffff3070c80>) at ../Python/ceval.c:4333
#45 PyEval_EvalFrameEx (
    f=f@entry=Frame 0x7ffff2fbb960, for file /usr/local/lib/python2.7/dist-packages/fabric/tasks.py, line 173, in run (self=<WrappedCallableTask(__module__='fabfile.external_database', name='delete', is_default=False, wrapped=<function at remote 0x7ffff3070c80>, __name__='delete', __doc__='Delete one or more databases on an external database server.\n\n    Provide a connection_uri which can delete users and databases.\n    And one or more database_uri for the databases and users to be deleted.\n\n    The uri should be formatted as follows:\n    <scheme>://<username>:<password>@<hostname>[:<port>]/<database>\n    With scheme one of "postgresql", "mysql" or "mssql".\n    In the case of the connection_uri, there won\'t be a /<database> part.\n    ') at remote 0x7ffff3034e90>, args=({u'username': u'admin', u'conn_db': u'', u'protocol': u'postgresql', u'host': u'**censored ip**', u'import_path': u'postgresql', u'password': u'**censored password**', u'port': 5432}, 'postgresql://admin:**censored password**@**censored ip**:5432/', 'postgresql://nghtdef_fronte...(truncated), throwflag=throwflag@entry=0) at ../Python/ceval.c:2705
#46 0x0000000000568b3a in PyEval_EvalCodeEx (closure=<optimized out>, defcount=<optimized out>, defs=0x0, kwcount=<optimized out>, kws=<optimized out>, argcount=-218384032, args=<optimized out>, locals=0x0, globals=<optimized out>, 
    co=<optimized out>) at ../Python/ceval.c:3252
#47 function_call (func=<optimized out>, arg=<optimized out>, kw=<optimized out>) at ../Objects/funcobject.c:526
#48 0x0000000000525cb7 in PyObject_Call (kw={}, 
    arg=(<WrappedCallableTask(__module__='fabfile.external_database', name='delete', is_default=False, wrapped=<function at remote 0x7ffff3070c80>, __name__='delete', __doc__='Delete one or more databases on an external database server.\n\n    Provide a connection_uri which can delete users and databases.\n    And one or more database_uri for the databases and users to be deleted.\n\n    The uri should be formatted as follows:\n    <scheme>://<username>:<password>@<hostname>[:<port>]/<database>\n    With scheme one of "postgresql", "mysql" or "mssql".\n    In the case of the connection_uri, there won\'t be a /<database> part.\n    ') at remote 0x7ffff3034e90>, {u'username': u'admin', u'conn_db': u'', u'protocol': u'postgresql', u'host': u'**censored ip**', u'import_path': u'postgresql', u'password': u'**censored password**', u'port': 5432}, 'postgresql://admin:**censored password**@**censored ip**:5432/', 'postgresql://nghtdef_frontend:nghtdef_frontend@**censored ip**:5432/nghtdef_frontend', 'postgresql://nghtdef_graphite:nghtdef_graphite@**censored ip**...(truncated), func=<function at remote 0x7ffff50f4aa0>) at ../Objects/abstract.c:2529
#49 ext_do_call (nk=<optimized out>, na=<optimized out>, flags=<optimized out>, pp_stack=0x7fffffffd130, func=<function at remote 0x7ffff50f4aa0>) at ../Python/ceval.c:4333
#50 PyEval_EvalFrameEx (
    f=f@entry=Frame 0x7ffff2fbb790, for file /usr/local/lib/python2.7/dist-packages/fabric/tasks.py, line 170, in __call__ (self=<WrappedCallableTask(__module__='fabfile.external_database', name='delete', is_default=False, wrapped=<function at remote 0x7ffff3070c80>, __name__='delete', __doc__='Delete one or more databases on an external database server.\n\n    Provide a connection_uri which can delete users and databases.\n    And one or more database_uri for the databases and users to be deleted.\n\n    The uri should be formatted as follows:\n    <scheme>://<username>:<password>@<hostname>[:<port>]/<database>\n    With scheme one of "postgresql", "mysql" or "mssql".\n    In the case of the connection_uri, there won\'t be a /<database> part.\n    ') at remote 0x7ffff3034e90>, args=({u'username': u'admin', u'conn_db': u'', u'protocol': u'postgresql', u'host': u'**censored ip**', u'import_path': u'postgresql', u'password': u'**censored password**', u'port': 5432}, 'postgresql://admin:**censored password**@**censored ip**:5432/', 'postgresql://nghtdef_f...(truncated), throwflag=throwflag@entry=0) at ../Python/ceval.c:2705
#51 0x0000000000568b3a in PyEval_EvalCodeEx (closure=<optimized out>, defcount=<optimized out>, defs=0x0, kwcount=<optimized out>, kws=<optimized out>, argcount=-218384496, args=<optimized out>, locals=0x0, globals=<optimized out>, 
    co=<optimized out>) at ../Python/ceval.c:3252
#52 function_call (func=func@entry=<function at remote 0x7ffff50f4a28>, 
    arg=arg@entry=(<WrappedCallableTask(__module__='fabfile.external_database', name='delete', is_default=False, wrapped=<function at remote 0x7ffff3070c80>, __name__='delete', __doc__='Delete one or more databases on an external database server.\n\n    Provide a connection_uri which can delete users and databases.\n    And one or more database_uri for the databases and users to be deleted.\n\n    The uri should be formatted as follows:\n    <scheme>://<username>:<password>@<hostname>[:<port>]/<database>\n    With scheme one of "postgresql", "mysql" or "mssql".\n    In the case of the connection_uri, there won\'t be a /<database> part.\n    ') at remote 0x7ffff3034e90>, {u'username': u'admin', u'conn_db': u'', u'protocol': u'postgresql', u'host': u'**censored ip**', u'import_path': u'postgresql', u'password': u'**censored password**', u'port': 5432}, 'postgresql://admin:**censored password**@**censored ip**:5432/', 'postgresql://nghtdef_frontend:nghtdef_frontend@**censored ip**:5432/nghtdef_frontend', 'postgresql://nghtdef_graphite:nghtdef_graphite@**censored ip**...(truncated), kw=kw@entry=0x0) at ../Objects/funcobject.c:526
#53 0x00000000004c2604 in PyObject_Call (kw=0x0, 
    arg=(<WrappedCallableTask(__module__='fabfile.external_database', name='delete', is_default=False, wrapped=<function at remote 0x7ffff3070c80>, __name__='delete', __doc__='Delete one or more databases on an external database server.\n\n    Provide a connection_uri which can delete users and databases.\n    And one or more database_uri for the databases and users to be deleted.\n\n    The uri should be formatted as follows:\n    <scheme>://<username>:<password>@<hostname>[:<port>]/<database>\n    With scheme one of "postgresql", "mysql" or "mssql".\n    In the case of the connection_uri, there won\'t be a /<database> part.\n    ') at remote 0x7ffff3034e90>, {u'username': u'admin', u'conn_db': u'', u'protocol': u'postgresql', u'host': u'**censored ip**', u'import_path': u'postgresql', u'password': u'**censored password**', u'port': 5432}, 'postgresql://admin:**censored password**@**censored ip**:5432/', 'postgresql://nghtdef_frontend:nghtdef_frontend@**censored ip**:5432/nghtdef_frontend', 'postgresql://nghtdef_graphite:nghtdef_graphite@**censored ip**...(truncated), func=<function at remote 0x7ffff50f4a28>) at ../Objects/abstract.c:2529
---Type <return> to continue, or q <return> to quit---
#54 instancemethod_call.8802 (func=<function at remote 0x7ffff50f4a28>, func@entry=<instancemethod at remote 0x7ffff4855140>, 
    arg=(<WrappedCallableTask(__module__='fabfile.external_database', name='delete', is_default=False, wrapped=<function at remote 0x7ffff3070c80>, __name__='delete', __doc__='Delete one or more databases on an external database server.\n\n    Provide a connection_uri which can delete users and databases.\n    And one or more database_uri for the databases and users to be deleted.\n\n    The uri should be formatted as follows:\n    <scheme>://<username>:<password>@<hostname>[:<port>]/<database>\n    With scheme one of "postgresql", "mysql" or "mssql".\n    In the case of the connection_uri, there won\'t be a /<database> part.\n    ') at remote 0x7ffff3034e90>, {u'username': u'admin', u'conn_db': u'', u'protocol': u'postgresql', u'host': u'**censored ip**', u'import_path': u'postgresql', u'password': u'**censored password**', u'port': 5432}, 'postgresql://admin:**censored password**@**censored ip**:5432/', 'postgresql://nghtdef_frontend:nghtdef_frontend@**censored ip**:5432/nghtdef_frontend', 'postgresql://nghtdef_graphite:nghtdef_graphite@**censored ip**...(truncated), 
    arg@entry=({u'username': u'admin', u'conn_db': u'', u'protocol': u'postgresql', u'host': u'**censored ip**', u'import_path': u'postgresql', u'password': u'**censored password**', u'port': 5432}, 'postgresql://admin:**censored password**@**censored ip**:5432/', 'postgresql://nghtdef_frontend:nghtdef_frontend@**censored ip**:5432/nghtdef_frontend', 'postgresql://nghtdef_graphite:nghtdef_graphite@**censored ip**:5432/nghtdef_graphite'), kw=kw@entry=0x0) at ../Objects/classobject.c:2602
#55 0x00000000004d26cf in PyObject_Call (kw=0x0, 
    arg=({u'username': u'admin', u'conn_db': u'', u'protocol': u'postgresql', u'host': u'**censored ip**', u'import_path': u'postgresql', u'password': u'**censored password**', u'port': 5432}, 'postgresql://admin:**censored password**@**censored ip**:5432/', 'postgresql://nghtdef_frontend:nghtdef_frontend@**censored ip**:5432/nghtdef_frontend', 'postgresql://nghtdef_graphite:nghtdef_graphite@**censored ip**:5432/nghtdef_graphite'), func=<instancemethod at remote 0x7ffff4855140>)
    at ../Objects/abstract.c:2529
#56 slot_tp_call.25849 (self=<optimized out>, 
    args=({u'username': u'admin', u'conn_db': u'', u'protocol': u'postgresql', u'host': u'**censored ip**', u'import_path': u'postgresql', u'password': u'**censored password**', u'port': 5432}, 'postgresql://admin:**censored password**@**censored ip**:5432/', 'postgresql://nghtdef_frontend:nghtdef_frontend@**censored ip**:5432/nghtdef_frontend', 'postgresql://nghtdef_graphite:nghtdef_graphite@**censored ip**:5432/nghtdef_graphite'), kwds=0x0) at ../Objects/typeobject.c:5432
#57 0x0000000000525cb7 in PyObject_Call (kw=0x0, 
    arg=({u'username': u'admin', u'conn_db': u'', u'protocol': u'postgresql', u'host': u'**censored ip**', u'import_path': u'postgresql', u'password': u'**censored password**', u'port': 5432}, 'postgresql://admin:**censored password**@**censored ip**:5432/', 'postgresql://nghtdef_frontend:nghtdef_frontend@**censored ip**:5432/nghtdef_frontend', 'postgresql://nghtdef_graphite:nghtdef_graphite@**censored ip**:5432/nghtdef_graphite'), 
    func=<WrappedCallableTask(__module__='fabfile.external_database', name='delete', is_default=False, wrapped=<function at remote 0x7ffff3070c80>, __name__='delete', __doc__='Delete one or more databases on an external database server.\n\n    Provide a connection_uri which can delete users and databases.\n    And one or more database_uri for the databases and users to be deleted.\n\n    The uri should be formatted as follows:\n    <scheme>://<username>:<password>@<hostname>[:<port>]/<database>\n    With scheme one of "postgresql", "mysql" or "mssql".\n    In the case of the connection_uri, there won\'t be a /<database> part.\n    ') at remote 0x7ffff3034e90>) at ../Objects/abstract.c:2529
#58 ext_do_call (nk=<optimized out>, na=<optimized out>, flags=<optimized out>, pp_stack=0x7fffffffd650, 
    func=<WrappedCallableTask(__module__='fabfile.external_database', name='delete', is_default=False, wrapped=<function at remote 0x7ffff3070c80>, __name__='delete', __doc__='Delete one or more databases on an external database server.\n\n    Provide a connection_uri which can delete users and databases.\n    And one or more database_uri for the databases and users to be deleted.\n\n    The uri should be formatted as follows:\n    <scheme>://<username>:<password>@<hostname>[:<port>]/<database>\n    With scheme one of "postgresql", "mysql" or "mssql".\n    In the case of the connection_uri, there won\'t be a /<database> part.\n    ') at remote 0x7ffff3034e90>) at ../Python/ceval.c:4333
#59 PyEval_EvalFrameEx (
    f=f@entry=Frame 0x7ffff3118da8, for file /home/ubuntu/workspace/external-database-create/awingu/clouddesktop-reposerver/fabfile/external_database/__init__.py, line 74, in delete_all (config_name='postgresql', prefix='nghtdef', config={u'username': u'admin', u'conn_db': u'', u'protocol': u'postgresql', u'host': u'**censored ip**', u'import_path': u'postgresql', u'password': u'**censored password**', u'port': 5432}, connection_uri='postgresql://admin:**censored password**@**censored ip**:5432/', databases={'frontend_web': 'postgresql://nghtdef_frontend:nghtdef_frontend@**censored ip**:5432/nghtdef_frontend', 'graphite_web': 'postgresql://nghtdef_graphite:nghtdef_graphite@**censored ip**:5432/nghtdef_graphite'}), 
    throwflag=throwflag@entry=0) at ../Python/ceval.c:2705
#60 0x0000000000568b3a in PyEval_EvalCodeEx (closure=<optimized out>, defcount=<optimized out>, defs=0x0, kwcount=<optimized out>, kws=<optimized out>, argcount=-216953432, args=<optimized out>, locals=0x0, globals=<optimized out>, 
    co=<optimized out>) at ../Python/ceval.c:3252
#61 function_call (func=<optimized out>, arg=<optimized out>, kw=<optimized out>) at ../Objects/funcobject.c:526
#62 0x0000000000525cb7 in PyObject_Call (kw={}, arg=('postgresql', 'nghtdef'), func=<function at remote 0x7ffff3070b90>) at ../Objects/abstract.c:2529
#63 ext_do_call (nk=<optimized out>, na=<optimized out>, flags=<optimized out>, pp_stack=0x7fffffffd850, func=<function at remote 0x7ffff3070b90>) at ../Python/ceval.c:4333
#64 PyEval_EvalFrameEx (
    f=f@entry=Frame 0x7ffff2fbb3f0, for file /usr/local/lib/python2.7/dist-packages/fabric/tasks.py, line 173, in run (self=<WrappedCallableTask(__module__='fabfile.external_database', name='delete_all', is_default=False, wrapped=<function at remote 0x7ffff3070b90>, __name__='delete_all', __doc__=None) at remote 0x7ffff3034e10>, args=('postgresql', 'nghtdef'), kwargs={}), throwflag=throwflag@entry=0) at ../Python/ceval.c:2705
#65 0x0000000000568b3a in PyEval_EvalCodeEx (closure=<optimized out>, defcount=<optimized out>, defs=0x0, kwcount=<optimized out>, kws=<optimized out>, argcount=-218385424, args=<optimized out>, locals=0x0, globals=<optimized out>, 
    co=<optimized out>) at ../Python/ceval.c:3252
#66 function_call (func=<optimized out>, arg=<optimized out>, kw=<optimized out>) at ../Objects/funcobject.c:526
#67 0x0000000000525cb7 in PyObject_Call (kw={}, 
    arg=(<WrappedCallableTask(__module__='fabfile.external_database', name='delete_all', is_default=False, wrapped=<function at remote 0x7ffff3070b90>, __name__='delete_all', __doc__=None) at remote 0x7ffff3034e10>, 'postgresql', 'nghtdef'), func=<function at remote 0x7ffff50f4aa0>) at ../Objects/abstract.c:2529
#68 ext_do_call (nk=<optimized out>, na=<optimized out>, flags=<optimized out>, pp_stack=0x7fffffffda50, func=<function at remote 0x7ffff50f4aa0>) at ../Python/ceval.c:4333
#69 PyEval_EvalFrameEx (
    f=f@entry=Frame 0xca61d0, for file /usr/local/lib/python2.7/dist-packages/fabric/tasks.py, line 276, in _execute (task=<WrappedCallableTask(__module__='fabfile.external_database', name='delete_all', is_default=False, wrapped=<function at remote 0x7ffff3070b90>, __name__='delete_all', __doc__=None) at remote 0x7ffff3034e10>, host='localhost', my_env={'clean_revert': True, 'all_hosts': ['localhost'], 'effective_roles': [], 'command': 'external_database.delete_all'}, args=('postgresql', 'nghtdef'), kwargs={}, jobs=<JobQueue(_finished=False, _queued=[], _running=[], _debug=False, _num_of_jobs=0, _closed=False, _max=1, _comms_queue=None, _completed=[]) at remote 0x7ffff3034f50>, queue=None, multiprocessing=None, local_env={'effective_roles': [...], 'all_hosts': [...], 'port': '22', 'clean_revert': True, 'host': 'localhost', 'command': 'external_database.delete_all', 'user': 'root', 'host_string': 'localhost'}), 
---Type <return> to continue, or q <return> to quit---
    throwflag=throwflag@entry=0) at ../Python/ceval.c:2705
#70 0x0000000000555551 in PyEval_EvalCodeEx (co=0x7ffff50bdf30, globals=<optimized out>, locals=locals@entry=0x0, args=<optimized out>, argcount=argcount@entry=8, kws=<optimized out>, kwcount=kwcount@entry=0, defs=defs@entry=0x0, 
    defcount=defcount@entry=0, closure=0x0) at ../Python/ceval.c:3252
#71 0x0000000000525560 in fast_function (nk=0, na=8, n=<optimized out>, pp_stack=0x7fffffffdc40, func=<function at remote 0x7ffff50f4cf8>) at ../Python/ceval.c:4116
#72 call_function (oparg=<optimized out>, pp_stack=0x7fffffffdc40) at ../Python/ceval.c:4041
#73 PyEval_EvalFrameEx (
    f=f@entry=Frame 0xf97530, for file /usr/local/lib/python2.7/dist-packages/fabric/tasks.py, line 386, in execute (task=<WrappedCallableTask(__module__='fabfile.external_database', name='delete_all', is_default=False, wrapped=<function at remote 0x7ffff3070b90>, __name__='delete_all', __doc__=None) at remote 0x7ffff3034e10>, args=('postgresql', 'nghtdef'), kwargs={'hosts': [], 'roles': [], 'exclude_hosts': []}, my_env={'clean_revert': True, 'all_hosts': ['localhost'], 'effective_roles': [], 'command': 'external_database.delete_all'}, results={}, is_callable=False, new_kwargs={}, hosts=[...], roles=[...], exclude_hosts=[...], parallel=False, multiprocessing=None, pool_size=1, queue=None, jobs=<JobQueue(_finished=False, _queued=[], _running=[], _debug=False, _num_of_jobs=0, _closed=False, _max=1, _comms_queue=None, _completed=[]) at remote 0x7ffff3034f50>, host='localhost'), throwflag=throwflag@entry=0) at ../Python/ceval.c:2666
#74 0x0000000000568b3a in PyEval_EvalCodeEx (closure=<optimized out>, defcount=<optimized out>, defs=0x0, kwcount=<optimized out>, kws=<optimized out>, argcount=16348464, args=<optimized out>, locals=0x0, globals=<optimized out>, 
    co=<optimized out>) at ../Python/ceval.c:3252
#75 function_call (func=<optimized out>, arg=<optimized out>, kw=<optimized out>) at ../Objects/funcobject.c:526
#76 0x0000000000525cb7 in PyObject_Call (kw={'hosts': [], 'roles': [], 'exclude_hosts': []}, arg=('external_database.delete_all', 'postgresql', 'nghtdef'), func=<function at remote 0x7ffff50f4de8>) at ../Objects/abstract.c:2529
#77 ext_do_call (nk=<optimized out>, na=<optimized out>, flags=<optimized out>, pp_stack=0x7fffffffde40, func=<function at remote 0x7ffff50f4de8>) at ../Python/ceval.c:4333
#78 PyEval_EvalFrameEx (
    f=f@entry=Frame 0xa138b0, for file /usr/local/lib/python2.7/dist-packages/fabric/main.py, line 756, in main (fabfile_locations=None, parser=<OptionParser(process_default_values=True, allow_interspersed_args=True, _long_opt={'--eagerly-disconnect': <Option(_long_opts=['--eagerly-disconnect'], help='disconnect from hosts as soon as possible', callback_args=None, callback=None, default=False, nargs=None, choices=None, dest='eagerly_disconnect', container=<...>, _short_opts=['-e'], action='store_true', const=None, callback_kwargs=None, type=None, metavar=None) at remote 0x7ffff533e3b0>, '--port': <Option(_long_opts=['--port'], help='SSH connection port', callback_args=None, callback=None, default='22', nargs=1, choices=None, dest='port', container=<...>, _short_opts=[], action='store', const=None, callback_kwargs=None, type='string', metavar=None) at remote 0x7ffff50cd950>, '--keepalive': <Option(_long_opts=['--keepalive'], help='enables a keepalive every N seconds', callback_args=None, callback=None, default=0, nargs=1, c...(truncated), throwflag=throwflag@entry=0) at ../Python/ceval.c:2705
#79 0x0000000000555551 in PyEval_EvalCodeEx (co=0x7ffff7e9eab0, globals=<optimized out>, locals=locals@entry=0x0, args=<optimized out>, argcount=argcount@entry=0, kws=<optimized out>, kwcount=kwcount@entry=0, 
    defs=defs@entry=0x7ffff4e81968, defcount=1, closure=0x0) at ../Python/ceval.c:3252
#80 0x0000000000524338 in fast_function (nk=0, na=0, n=<optimized out>, pp_stack=0x7fffffffe030, func=<function at remote 0x7ffff4e89aa0>) at ../Python/ceval.c:4116
#81 call_function (oparg=<optimized out>, pp_stack=0x7fffffffe030) at ../Python/ceval.c:4041
#82 PyEval_EvalFrameEx (f=f@entry=Frame 0x7ffff7e713e0, for file /usr/local/bin/fab, line 11, in <module> (), throwflag=throwflag@entry=0) at ../Python/ceval.c:2666
#83 0x0000000000567d14 in PyEval_EvalCodeEx (closure=0x0, defcount=0, defs=0x0, kwcount=0, kws=0x0, argcount=0, args=0x0, locals=<� at remote 0x7ffff7e71558>, 
    globals='Return true if the object is a user-defined function.\n\n    Function objects provide these attributes:\n        __doc__         documentation string\n        __name__        name with which this function was defined\n        func_code       code object containing compiled function bytecode\n        func_defaults   tuple of any default values for arguments\n        func_doc        (same as __doc__)\n        func_globals    global namespace in which this function was defined\n        func_name       (same as __name__)', co=0x7ffff7edb1b0) at ../Python/ceval.c:3252
#84 PyEval_EvalCode (locals=<� at remote 0x7ffff7e71558>, 
    globals='Return true if the object is a user-defined function.\n\n    Function objects provide these attributes:\n        __doc__         documentation string\n        __name__        name with which this function was defined\n        func_code       code object containing compiled function bytecode\n        func_defaults   tuple of any default values for arguments\n        func_doc        (same as __doc__)\n        func_globals    global namespace in which this function was defined\n        func_name       (same as __name__)', co=0x7ffff7edb1b0) at ../Python/ceval.c:667
#85 run_mod.42576 (mod=mod@entry=0x977f18, filename=filename@entry=0x7fffffffe66b "/usr/local/bin/fab", 
    globals=globals@entry={'__builtins__': <module at remote 0x7ffff7fa1b08>, '__file__': '/usr/local/bin/fab', '__package__': None, 'sys': <module at remote 0x7ffff7fa1bb0>, 're': <module at remote 0x7ffff7ed32b8>, '__name__': '__main__', 'main': <function at remote 0x7ffff4e89aa0>, '__doc__': None}, 
    locals=locals@entry={'__builtins__': <module at remote 0x7ffff7fa1b08>, '__file__': '/usr/local/bin/fab', '__package__': None, 'sys': <module at remote 0x7ffff7fa1bb0>, 're': <module at remote 0x7ffff7ed32b8>, '__name__': '__main__', 'main': <function at remote 0x7ffff4e89aa0>, '__doc__': None}, flags=flags@entry=0x7fffffffe1e0, arena=arena@entry=0x9a4a80) at ../Python/pythonrun.c:1370
#86 0x0000000000465bf4 in PyRun_FileExFlags (fp=fp@entry=0x9ef390, filename=filename@entry=0x7fffffffe66b "/usr/local/bin/fab", start=start@entry=257, 
    globals=globals@entry={'__builtins__': <module at remote 0x7ffff7fa1b08>, '__file__': '/usr/local/bin/fab', '__package__': None, 'sys': <module at remote 0x7ffff7fa1bb0>, 're': <module at remote 0x7ffff7ed32b8>, '__name__': '__main__', 'main': <function at remote 0x7ffff4e89aa0>, '__doc__': None}, 
    locals=locals@entry={'__builtins__': <module at remote 0x7ffff7fa1b08>, '__file__': '/usr/local/bin/fab', '__package__': None, 'sys': <module at remote 0x7ffff7fa1bb0>, 're': <module at remote 0x7ffff7ed32b8>, '__name__': '__main__', 'main': <function at remote 0x7ffff4e89aa0>, '__doc__': None}, closeit=closeit@entry=1, flags=flags@entry=0x7fffffffe1e0) at ../Python/pythonrun.c:1356
#87 0x000000000046612d in PyRun_SimpleFileExFlags (fp=fp@entry=0x9ef390, filename=<optimized out>, filename@entry=0x7fffffffe66b "/usr/local/bin/fab", closeit=closeit@entry=1, flags=flags@entry=0x7fffffffe1e0)
    at ../Python/pythonrun.c:948
#88 0x0000000000466229 in PyRun_AnyFileExFlags (fp=fp@entry=0x9ef390, filename=filename@entry=0x7fffffffe66b "/usr/local/bin/fab", closeit=closeit@entry=1, flags=flags@entry=0x7fffffffe1e0) at ../Python/pythonrun.c:752
#89 0x0000000000466d92 in Py_Main (argc=<optimized out>, argv=0x7fffffffe398) at ../Modules/main.c:640
#90 0x00007ffff7815f45 in __libc_start_main (main=0x466e50 <main>, argc=9, argv=0x7fffffffe398, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffe388) at libc-start.c:287
#91 0x0000000000577c2e in _start ()
@dvarrazzo
Copy link
Member

I think I know what it is, and it is not pretty :(

#4  0x00007ffff28f1ff7 in SSL_library_init () from
    /usr/local/lib/python2.7/dist-packages/psycopg2/.libs/./libssl-cdf7ba29.so.1.0.2k

you are using a wheel package, which is self-contained and is bundled with its own version of libssl. Python uses the system version of the library. The two libraries together probably clash on some global object, or step onto each other's private structure.

I think the problem cannot be solved, which is sad: the wheel package is probably not compatible with the ssl module, or whatever else binds to openssl. The workaround is to install psycopg from source, e.g. using pip install --no-binary psycopg2. I'm leaving this issue open because we should do some of the following:

  • document the issue
  • detect the problem on connect(), i.e. that ssl is loaded so we can't use crypt. Or something else? This wouldn't avoid crashing if psycopg is loaded before ssl though.

Thorny problem.

@dvarrazzo
Copy link
Member

Improve docs by 2.7.2

@dvarrazzo dvarrazzo added this to the psycopg 2.7.2 milestone Jun 8, 2017
@oliverseal
Copy link

Wow. This one burned me for a couple of hours. All I was getting was "segmentation fault" on ubuntu 16.04 with a tornado + aiopg app. I have to investigate the core to get here. Rolling back to psycopg2==2.6.2 seems to have resolved things for me.

@dvarrazzo
Copy link
Member

@oliverseal Yeah, that's very unfortunate and unfortunately I don't see a way to solve it. You can still use 2.7 forcing source installation.

I've added a warning in the docs about the problem, but if you had to dig deeper it may mean that warning is not enough. Please feel free to suggest how we can improve the docs further to help people not waste too much time.

@rubendv
Copy link
Author

rubendv commented Jul 5, 2017

Would it be possible to not bundle libssl in the wheel and use the one that comes with python instead?

@dvarrazzo
Copy link
Member

@rubendv I don't think so because it's the libpq to bind to the libssl, not psycopg directly.

Maybe there could be a way to exclude the libssl from the wheel generation; then we should check the binary compatibility libssl offers. It would be actually interesting to take a look into that.

@thanatos
Copy link

thanatos commented Oct 24, 2017

Why keep the wheel, in the meantime, given how broken it is? Building from source should work for far more environments than the wheel, or at least, error out if the appropriate libraries / headers are available. Presently, naïvely attempting to install psycopg2 would appear to just be broken for many people (it appears to be broken on Ubuntu, for example), and for those of us deploying in automated fashions, adding --no-binary would seem to imply the huge toll of building everything from source.

@dvarrazzo
Copy link
Member

dvarrazzo commented Oct 25, 2017

@thanatos I have maintained this library for more 10 years and I can tell you that people incapable of reading the first line of the manual, of installing the -dev packages, opening bugs because of the mysterious writing "I can't find pg_config: please add it to the path" are an endless army.

The wheel is presently only broken for people also using libssl, which are a minority. People who have automated deployment by just sticking psycopg2 in requirements.txt have done it wrong: if you depend on psycopg2 you are guaranteed something will break if the behaviour of the library changes. A more conservative approach would be to depend on psycopg2>=2.6,<2.7 through which you would have only received bugfixes, not behavioural changes, and you wouldn't have received the wheel package. Now that you have tested that psycopg 2.7 works for your program compiled from source please use psycopg2>=2.7,<2.8 --no-binary :all: in your requirements, and yes, rebuild everything: as you have automated it it's just pressing a button.

For every person complaining about this segfault I have 100 OSX dummies who stopped complaining. It is a net win for me.

@dvarrazzo
Copy link
Member

Issue re-opened, because documenting a workaround doesn't effectively close it.

@dvarrazzo dvarrazzo reopened this Oct 25, 2017
@thanatos
Copy link

The wheel is presently only broken for people also using libssl, which are a minority.

My understanding is that the standard library's ssl module links against the system libssl. Now, some people might be getting lucky, in that they never import that module, but I just don't think it is unreasonable to ask that libraries such as psycopg2 to work regardless of whether or not I import certain libraries from the standard library, within reason. (Perhaps some dependency of a dependency in my stack is importing ssl, but how much control I have over that, I don't know, and I don't believe I have either a good way of detecting who that is or even doing anything about it.)

would be to depend on psycopg2>=2.6,<2.7 through which you would have only received bugfixes, not behavioural changes

My options here are also fairly limited: we actually do attempt to pin dependencies s.t. we don't pull in behavioral changes inadvertently. However, we have a large number of dependencies, and our time is severely limited; we don't always have time to chase down libraries to see if they use some custom, home-grown versioning scheme, and what that is. For the most part, we don't bother, as it is usually not specified anywhere and thus a fool's errand; my life would be a lot easier if folks would just use semver (and if pip would get better support for it, such as what cargo or npm have). In particular, I don't see a good reason for psycopg2 to not follow it, and it also doesn't appear to be explicitly stated anywhere, though perhaps one could argue that it could be inferred from the changelog. (The point of movements such as semver, however, is to streamline stuff and reduce the amount of inference and guesswork that I need to do.)

psycopg2>=2.7,<2.8 --no-binary :all:

I wasn't aware that this was even valid syntax for a requirements file. However, it unfortunately seems to apply to the entire set, not the single requirement (and thus doesn't work around the issue of subsequently needing to rebuild everything). (If I make a requirements file with that and a single other requirement, pip outputs that it is skipping wheels for both, and all of their dependencies.)

This also ignores that things being pulled in through other dependencies are going to need to push their dependencies through setup.py, and I'm not sure if it provides a similar mechanism.

Issue re-opened

Thank you.

For every person complaining about this segfault I have 100 OSX dummies who stopped complaining. It is a net win for me.

I'm not against bundling the postgres library; that seems fairly safe to do; it's the bundled libssl, since it so heavily conflicts with the standard library's. libssl is essentially guaranteed to exist (since the stdlib links against it) so it would seem to me that leaving that library alone out would solve both the segfaults, and folks who can't understand how to build from source from bugging you, would it not?

@dvarrazzo
Copy link
Member

dvarrazzo commented Oct 26, 2017

@thanatos

Of course I'm not happy that psycopg segfaults in any condition, let alone in conjunction with the use of a stdlib module. It would be great if we could exclude libssl from the wheel package; unfortunately this is not possible because libssl doesn't have a stable ABI. It is true that it pretty much exists everywhere; the problem is that we don't know what shape it has.

It would also be great if the workflow could be:

$ pip install psycopg2
... ponder ponder ...
It appears you don't have build tool. Please use "pip install --binary psycopg2" and hope
for the best, alternatively please install the build tools
$ pip install --binary psycopg2
... ponder ponder ...
wheel installed.

however there is no "prefer source" or "prefer binary" option in pip, AFAICS. Maybe it's worth asking them?

As per the issue that --no-binary applies to the whole requirements.txt files, again, it seems a pip shortcoming, not ours.

As per the semantic versioning: we do it. The 2 is there to stay in psycopg2: there will be a psycopg3 to change things heavily. We increase the second number when we add features or change some behaviour in some subtle way. We increase the third number when we fix bug. So yeah, we do semver and you can use the >=2.X,<2.(X+1) pattern on psycopg. If others don't it's not exactly our problem, no?

So to recap, the problem with psycopg wheels is caused by a combination of

  • libssl doesn't version its ABI
  • pip doesn't allow a package to specify "source preferred"
  • pip --no-binary :all: is too aggressive

on the first being fixed I don't hold my breath. Point three could be just a bug, the second would be nice, but I don't have the energy to lobby the pip guys.

If you can help with some of the above, be my guest. If not, please don't insist that we drop the wheel support because some random guy in pypi rolls three dice to choose their version numbers and you don't feel like adding version guards in your req's file. I'm happy to work on the shortcomings of the libraries I maintain and to give alternatives to work around problems, but I have limited agency upstream (the libraries we use) and downstream (the users we have).

@dvarrazzo
Copy link
Member

Looked better into all the packages going no-binary in requirements.txt. I thought :all: referred to the entry it appears into only and meant no version but no, it doesn't. Docs are here.

The right solution is to use --no-binary psycopg2. For example this file:

$ cat requirements.txt 
psycopg2>=2.7,<2.8 --no-binary psycopg2
lxml

Installs:

$ pip install -r requirements.txt --no-cache
Collecting psycopg2<2.8,>=2.7 (from -r requirements.txt (line 1))
  Downloading psycopg2-2.7.3.2.tar.gz (425kB)
Collecting lxml (from -r requirements.txt (line 2))
  Downloading lxml-4.1.0-cp27-cp27mu-manylinux1_x86_64.whl (5.6MB)
Installing collected packages: psycopg2, lxml
  Running setup.py install for psycopg2 ... done
Successfully installed lxml-4.1.0 psycopg2-2.7.3.2

where lxml is installed from wheel and psycopg from source.

I will update the documentation to suggest this workaround.

dvarrazzo added a commit that referenced this issue Oct 27, 2017
:all: applies to the entire file. --no-binary psycopg2 is the solution.

See issue #543
@dvarrazzo
Copy link
Member

I would like to work to solve this problem, but I can't actually reproduce it.

Tried importing libssl both by psycopg and by urllib/requests with a script like the following, which in my understanding should have triggered the segfault

from __future__ import print_function

import requests
s = requests.get('https://github.com')
print("from requests:", len(s.content))

try:
    from urllib2 import urlopen
except ImportError:
    from urllib.request import urlopen

f = urlopen('https://github.com')
print("from urllib:", len(f.read()))

import psycopg2
cnn = psycopg2.connect('host=localhost sslmode=require')
cur = cnn.cursor()
cur.execute("select 1")
print("from psycopg:", cur.fetchone())

checking in /proc/PID/map_files I can see both the libraries are actually imported:

$ ls -l /proc/12994/map_files/ | grep libcrypto
lr-------- 1 piro piro 64 Nov 16 23:52 7fea9fb7f000-7fea9fda5000 -> /home/piro/dev/psycopg2/env3/lib/python3.5/site-packages/psycopg2/.libs/libcrypto-34813f62.so.1.0.2l
[...]
lr-------- 1 piro piro 64 Nov 16 23:52 7feab07a1000-7feab09bb000 -> /lib/x86_64-linux-gnu/libcrypto.so.1.0.0

however the program completes without segfaulting.

Tested on Python 2.7.12 and 3.5.2 on Ubuntu 16.04.3 64 bit.

Any suggestion about how to trigger the segfault reliably?

@dvarrazzo
Copy link
Member

@rubendv would you be able to provide a standalone test to reproduce the issue? I've tried in an ubuntu 14:04 docker image containing:

ii  libssl1.0.0:amd64        1.0.1f-1ubuntu2.23          amd64
ii  python                   2.7.5-5ubuntu3              amd64

I couldn't reproduce the segfault, tested with psycopg 2.7.1 (the one you tested with) and 2.7.3.2 (the current one).

Your test depends on a module whose behaviour is not clear (just importing fabric.api doesn't seem to import _ssl) and #603 seems suggesting that triggering the bug requires a specific order.

A more self-contained test in a dockerfile would be welcome to fix the problem, thank you.

@kezabelle
Copy link

Whilst I can't easily reproduce it, I have experienced the same issue using requests==2.18.4 and psycopg2==2.7.3.1

In my cases, it seems to occur more frequently (and even then, not actually frequently) when requests.ConnectionError is raised (and subsequently caught & handled, such that the program continues)

Below is the debug information I have from the OSX console, which is ... possibly useless? I certainly wouldn't be able to diagnose anything from it.

Given its up to thread 7 (or 8 in some cases) I assume I was running a Django project under gunicorn at the time. I'm fairly certain I had similar crashes using the Django runserver but the data for that doesn't have any relevant information whatsoever.

Path:                  /Users/USER/*/python3.5
Identifier:            python3.5
Code Type:             X86-64 (Native)
Parent Process:        python3.5 [2896]
OS Version:            Mac OS X 10.11.6 (15G1004)
Crashed Thread:        7
Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       EXC_I386_GPFLT

Thread 7 Crashed:
0   libssl.1.0.0.dylib            	0x0000000102908fae freelist_extract + 89
1   libssl.1.0.0.dylib            	0x0000000102908f01 ssl3_setup_read_buffer + 125
2   libssl.1.0.0.dylib            	0x000000010290910c ssl3_setup_buffers + 14
3   libssl.1.0.0.dylib            	0x000000010290ae40 ssl23_connect + 363
4   libpq.5.8.dylib               	0x00000001028e5400 pgtls_open_client + 2186
5   libpq.5.8.dylib               	0x00000001028d275d PQconnectPoll + 1360
6   libpq.5.8.dylib               	0x00000001028d0eee connectDBComplete + 106
7   libpq.5.8.dylib               	0x00000001028d1042 PQconnectdb + 36
8   _psycopg.cpython-35m-darwin.so	0x00000001028973b6 conn_connect + 166
9   _psycopg.cpython-35m-darwin.so	0x0000000102898780 connection_init + 304
10  python                        	0x0000000100b04b29 type_call + 297
11  python                        	0x0000000100aad181 PyObject_Call + 97
12  python                        	0x0000000100aad466 _PyObject_CallFunction_SizeT + 246
13  _psycopg.cpython-35m-darwin.so	0x0000000102892c54 psyco_connect + 180
[...]
165 libsystem_pthread.dylib       	0x00007fff8f38e99d _pthread_body + 131
166 libsystem_pthread.dylib       	0x00007fff8f38e91a _pthread_start + 168
167 libsystem_pthread.dylib       	0x00007fff8f38c351 thread_start + 13

And now what I assume is some assembly:

Thread 7 crashed with X86 Thread State (64-bit):
  rax: 0x00007fe706160c10  rbx: 0x00007fe706160380  rcx: 0x0000000000000266  rdx: 0x000000010292ed31
  rdi: 0x0000000000000009  rsi: 0x000000000000000c  rbp: 0x00007000023a1d40  rsp: 0x00007000023a1d20
   r8: 0x0000000000005600   r9: 0x0000000000000000  r10: 0x000000005b32b633  r11: 0x00007fe702a00000
  r12: 0x0000000000000000  r13: 0x00007fe702aa3770  r14: 0xe500030317818c00  r15: 0x0000000000004548
  rip: 0x0000000102908fae  rfl: 0x0000000000010286  cr2: 0x00002df652a05000

I appreciate that more anecdata probably doesn't offer up any new information or help, but just in case :)

@dvarrazzo
Copy link
Member

Observation:

  • SSL_library_init is not reentrant, and all the reports seem suggesting multithread environment (gunicorn, fabfile).
  • libpq calls SSL_library_init at every connection (why, even?...)
  • libpq calls SSL_library_init only in the CONNECTION_SSL_STARTUP step
  • If this is a concurrency problem (as it smells), connecting with the GIL should be enough to avoid problems, but it's probably a bad hit for performance.
  • If we call PQconnectdb on connection there is no way to isolate CONNECTION_SSL_STARTUP.
  • But if we use PQconnectPoll and do the wait ourselves we may isolate CONNECTION_SSL_STARTUP and reacquire the lock just there
  • We use PQconnectdb in normal psycopg mode, we use PQconnectPoll in green and async mode
  • We could ditch PQconnectdb altogether and roll our own with our own PQconnectPoll + wait, protecting the SSL step.

dvarrazzo added a commit that referenced this issue Jan 13, 2018
The idea is to release a package 'psycopg2-binary' to allow installing
binary, and leave the psycopg2 package to be source only, to avoid
pushing the unreliability of the wheel pacakge by default (see issue #543).

Version number bumped to test with new packages.
@dvarrazzo
Copy link
Member

Starting from psycopg 2.7.4, a new package will be introduced: psycopg2-binary. The psycopg2 wheel package will be still available but will importing it will raise an explanatory warning.

Starting from psycopg 2.8, only psycopg2-binary will be available as wheel package and 'pip install psycopg2' will require build tools on the client. In case of missing build prerequisites, setup.py will also inform about the availability of the psycopg2-binary package.

dvarrazzo added a commit that referenced this issue Jan 29, 2018
dvarrazzo added a commit that referenced this issue Jan 29, 2018
The idea is to release a package 'psycopg2-binary' to allow installing
binary, and leave the psycopg2 package to be source only, to avoid
pushing the unreliability of the wheel pacakge by default (see issue #543).

Version number bumped to test with new packages.
fungjj92 pushed a commit to project-icp/bee-pollinator-app that referenced this issue Oct 15, 2018
The wheel package for `psycopg2` is not compatible with the Python `ssl`
module due to their dependency on different versions of OpenSSL (the
wheel packages its own version, while `ssl` uses the system version).

Attempts to resolve by installing the dependency from source proved
challenging because we install `psycopg2` via Ansible
(`postgresql-support`) in a way that makes it difficult to supply the
`--no-binary` override for `pip`. Instead, we've downgraded to a version
prior to wheel support.

Lastly, the `libpq5` and `libpq-dev` dependencies needed to be
downgraded as well. This is because `psycopg2==2.6.2` is unable to make
sense of a `libpq` version greater than 9.

See: psycopg/psycopg2#543
rajadain pushed a commit to project-icp/bee-pollinator-app that referenced this issue Oct 15, 2018
The wheel package for `psycopg2` is not compatible with the Python `ssl`
module due to their dependency on different versions of OpenSSL (the
wheel packages its own version, while `ssl` uses the system version).

Attempts to resolve by installing the dependency from source proved
challenging because we install `psycopg2` via Ansible
(`postgresql-support`) in a way that makes it difficult to supply the
`--no-binary` override for `pip`. Instead, we've downgraded to a version
prior to wheel support.

Lastly, the `libpq5` and `libpq-dev` dependencies needed to be
downgraded as well. This is because `psycopg2==2.6.2` is unable to make
sense of a `libpq` version greater than 9.

See: psycopg/psycopg2#543
@matthew-brett
Copy link

I'm happy to help fix the wheels, as above - where should I do a PR?

@ofek
Copy link

ofek commented Apr 7, 2019

@matthew-brett That would be awesome!

cc @dvarrazzo

@dvarrazzo
Copy link
Member

@matthew-brett I guess the https://github.com/psycopg/psycopg2-wheels package is the right place.

matthew-brett added a commit to matthew-brett/psycopg2 that referenced this issue Apr 10, 2019
We believe that OpenSSL 1.1.x will fix the threading issues previously
reported with binary builds:

psycopg#543

Require the OpenSSL 1.1.x Windows library names.
@matthew-brett
Copy link

@rubendv - and others on this thread - we may well have a fix for the threading problems, in psycopg/psycopg2-wheels#8, but getting default wheels back, depends on having a test for this issue - see #837. We need a test case that we can run, that crashes using current psycopg2-binary. I'd really like a test database that I can put in the wheel repository for testing, or generate on the fly, but if you can't provide that, then a database that I can keep on my encrypted desktop drive, would be a lot better than nothing.

@ofek
Copy link

ofek commented Apr 18, 2019

#836 (comment)

bors bot added a commit to chronhq/backend that referenced this issue Oct 27, 2019
167: Update psycopg2 requirement from ~=2.8.3 to ~=2.8.4 in /config r=MiklerGM a=dependabot-preview[bot]

Updates the requirements on [psycopg2](https://github.com/psycopg/psycopg2) to permit the latest version.
<details>
<summary>Changelog</summary>

*Sourced from [psycopg2's changelog](https://github.com/psycopg/psycopg2/blob/master/NEWS).*

> Current release
> ---------------
> 
> What's new in psycopg 2.8.4
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> - Fixed building with Python 3.8 (:ticket:`[#854](https://github.com/psycopg/psycopg2/issues/854)`).
> - Don't swallow keyboard interrupts on connect when a password is specified
>   in the connection string (:ticket:`[#898](https://github.com/psycopg/psycopg2/issues/898)`).
> - Don't advance replication cursor when the message wasn't confirmed
>   (:ticket:`[#940](https://github.com/psycopg/psycopg2/issues/940)`).
> - Fixed inclusion of ``time.h`` on linux (:ticket:`[#951](https://github.com/psycopg/psycopg2/issues/951)`).
> - Fixed int overflow for large values in `~psycopg2.extensions.Column.table_oid`
>   and `~psycopg2.extensions.Column.type_code` (:ticket:`[#961](https://github.com/psycopg/psycopg2/issues/961)`).
> - `~psycopg2.errorcodes` map and `~psycopg2.errors` classes updated to
>   PostgreSQL 12.
> - Wheel package compiled against OpenSSL 1.1.1d and PostgreSQL at least 11.4.
> 
> 
> What's new in psycopg 2.8.3
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> - Added *interval_status* parameter to
>   `~psycopg2.extras.ReplicationCursor.start_replication()` method and other
>   facilities to send automatic replication keepalives at periodic intervals
>   (:ticket:`[#913](https://github.com/psycopg/psycopg2/issues/913)`).
> - Fixed namedtuples caching introduced in 2.8 (:ticket:`[#928](https://github.com/psycopg/psycopg2/issues/928)`).
> 
> 
> What's new in psycopg 2.8.2
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> - Fixed `~psycopg2.extras.RealDictCursor` when there are repeated columns
>   (:ticket:`[#884](https://github.com/psycopg/psycopg2/issues/884)`).
> - Binary packages built with openssl 1.1.1b. Should fix concurrency problems
>   (:tickets:`[#543](psycopg/psycopg2#543), [#836](https://github.com/psycopg/psycopg2/issues/836)`).
> 
> 
> What's new in psycopg 2.8.1
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> - Fixed `~psycopg2.extras.RealDictRow` modifiability (:ticket:`[#886](https://github.com/psycopg/psycopg2/issues/886)`).
> - Fixed "there's no async cursor" error polling a connection with no cursor
>   (:ticket:`[#887](https://github.com/psycopg/psycopg2/issues/887)`).
> 
> 
> What's new in psycopg 2.8
> -------------------------
> 
> New features:
></tr></table> ... (truncated)
</details>
<details>
<summary>Commits</summary>

- See full diff in [compare view](https://github.com/psycopg/psycopg2/commits)
</details>
<br />

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Pull request limits (per update run and/or open at any time)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)



</details>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
machikhin pushed a commit to tessia-project/tessia that referenced this issue Mar 4, 2020
bors bot added a commit to chronhq/backend that referenced this issue Apr 6, 2020
230: Update psycopg2 requirement from ~=2.8.4 to ~=2.8.5 in /config r=whirish a=dependabot-preview[bot]

Updates the requirements on [psycopg2](https://github.com/psycopg/psycopg2) to permit the latest version.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/psycopg/psycopg2/blob/master/NEWS">psycopg2's changelog</a>.</em></p>
<blockquote>
<h2>Current release</h2>
<p>What's new in psycopg 2.8.5
^^^^^^^^^^^^^^^^^^^^^^^^^^^</p>
<ul>
<li>Fixed use of <code>!connection_factory</code> and <code>!cursor_factory</code> together
(:ticket:<code>[#1019](https://github.com/psycopg/psycopg2/issues/1019)</code>).</li>
<li>Added support for <code>~logging.LoggerAdapter</code> in
<code>~psycopg2.extras.LoggingConnection</code> (:ticket:<code>[#1026](https://github.com/psycopg/psycopg2/issues/1026)</code>).</li>
<li><code>~psycopg2.extensions.Column</code> objects in <code>cursor.description</code> can be sliced
(:ticket:<code>[#1034](https://github.com/psycopg/psycopg2/issues/1034)</code>).</li>
<li>Added AIX support (:ticket:<code>[#1061](https://github.com/psycopg/psycopg2/issues/1061)</code>).</li>
<li>Fixed <code>~copy.copy()</code> of <code>~psycopg2.extras.DictCursor</code> rows (:ticket:<code>[#1073](https://github.com/psycopg/psycopg2/issues/1073)</code>).</li>
</ul>
<p>What's new in psycopg 2.8.4
^^^^^^^^^^^^^^^^^^^^^^^^^^^</p>
<ul>
<li>Fixed building with Python 3.8 (:ticket:<code>[#854](https://github.com/psycopg/psycopg2/issues/854)</code>).</li>
<li>Don't swallow keyboard interrupts on connect when a password is specified
in the connection string (:ticket:<code>[#898](https://github.com/psycopg/psycopg2/issues/898)</code>).</li>
<li>Don't advance replication cursor when the message wasn't confirmed
(:ticket:<code>[#940](https://github.com/psycopg/psycopg2/issues/940)</code>).</li>
<li>Fixed inclusion of <code>time.h</code> on linux (:ticket:<code>[#951](https://github.com/psycopg/psycopg2/issues/951)</code>).</li>
<li>Fixed int overflow for large values in <code>~psycopg2.extensions.Column.table_oid</code>
and <code>~psycopg2.extensions.Column.type_code</code> (:ticket:<code>[#961](https://github.com/psycopg/psycopg2/issues/961)</code>).</li>
<li><code>~psycopg2.errorcodes</code> map and <code>~psycopg2.errors</code> classes updated to
PostgreSQL 12.</li>
<li>Wheel package compiled against OpenSSL 1.1.1d and PostgreSQL at least 11.4.</li>
</ul>
<p>What's new in psycopg 2.8.3
^^^^^^^^^^^^^^^^^^^^^^^^^^^</p>
<ul>
<li>Added <em>interval_status</em> parameter to
<code>~psycopg2.extras.ReplicationCursor.start_replication()</code> method and other
facilities to send automatic replication keepalives at periodic intervals
(:ticket:<code>[#913](https://github.com/psycopg/psycopg2/issues/913)</code>).</li>
<li>Fixed namedtuples caching introduced in 2.8 (:ticket:<code>[#928](https://github.com/psycopg/psycopg2/issues/928)</code>).</li>
</ul>
<p>What's new in psycopg 2.8.2
^^^^^^^^^^^^^^^^^^^^^^^^^^^</p>
<ul>
<li>Fixed <code>~psycopg2.extras.RealDictCursor</code> when there are repeated columns
(:ticket:<code>[#884](https://github.com/psycopg/psycopg2/issues/884)</code>).</li>
<li>Binary packages built with openssl 1.1.1b. Should fix concurrency problems
(:tickets:<code>[#543](psycopg/psycopg2#543), [#836](https://github.com/psycopg/psycopg2/issues/836)</code>).</li>
</ul>
</tr></table> ... (truncated)
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a href="https://github.com/psycopg/psycopg2/commits">compare view</a></li>
</ul>
</details>
<br />


Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Pull request limits (per update run and/or open at any time)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)



</details>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wheel Bugs related to the wheel distribution, not happening installing from source
Projects
None yet
Development

No branches or pull requests

10 participants