Does not connect: exceptions.TypeError: get_ssl_context() takes exactly 2 arguments (1 given)

Bug #1009786 reported by Karl Hegbloom
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
u1sync
Fix Released
Undecided
Ubuntu One Client Engineering team
ubuntuone-client (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

As of either yesterday or today, syncdaemon will not connect. In ~/.cache/log/syncdaemon-exceptions.log I find:

2012-06-06 18:01:08,913 - twisted - ERROR - Unhandled error in Deferred:
2012-06-06 18:01:08,917 - twisted - ERROR - Unhandled Error
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 362, in callback
    self._startRunCallbacks(result)
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 458, in _startRunCallbacks
    self._runCallbacks()
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 545, in _runCallbacks
    current.result = callback(current.result, *args, **kw)
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1181, in unwindGenerator
    return _inlineCallbacks(None, gen, Deferred())
--- <exception caught here> ---
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1039, in _inlineCallbacks
    result = g.send(result)
  File "/usr/lib/python2.7/dist-packages/ubuntuone-client/ubuntuone/syncdaemon/action_queue.py", line 858, in _make_connection
    ssl_context = get_ssl_context(self.disable_ssl_verify)
exceptions.TypeError: get_ssl_context() takes exactly 2 arguments (1 given)

Related branches

Revision history for this message
Karl Hegbloom (karl.hegbloom) wrote :

Ok, sorry. I just updated again, and you've fixed it. Thank you.

dobey (dobey)
Changed in ubuntuone-client (Ubuntu):
status: New → Invalid
Revision history for this message
ScaryTom (t-denley) wrote :

I make use of the u1sync tool, and as of 6th June I'm getting this:

Unhandled Error
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/twisted/python/context.py", line 81, in callWithContext
    return func(*args,**kw)
  File "/usr/lib/python2.7/dist-packages/twisted/internet/posixbase.py", line 586, in _doReadOrWrite
    why = selectable.doRead()
  File "/usr/lib/python2.7/dist-packages/twisted/internet/_glibbase.py", line 55, in doRead
    self.reactor._simulate()
  File "/usr/lib/python2.7/dist-packages/twisted/internet/_glibbase.py", line 313, in _simulate
    self.runUntilCurrent()
--- <exception caught here> ---
  File "/usr/lib/python2.7/dist-packages/twisted/internet/base.py", line 773, in runUntilCurrent
    f(*a, **kw)
  File "/usr/local/lib/python2.7/dist-packages/u1sync/client.py", line 328, in _connect
    ctx = get_ssl_context(no_verify)
exceptions.TypeError: get_ssl_context() takes exactly 2 arguments (1 given)

no longer affects: ubuntuone-client
Revision history for this message
ScaryTom (t-denley) wrote :

hmm... seems that my vesion of context.py does not match that in the source of https://launchpad.net/ubuntu/+source/ubuntuone-storage-protocol/3.0.0-0ubuntu1, even though I have version 3.0.0-0ubuntu1 installed

/usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol/ubuntuone/storageprotocol/context.py

line 98:
def get_ssl_context(no_verify, hostname):

Revision history for this message
dobey (dobey) wrote :

Tom, Surely you have 3.0.0-0ubuntu1.1 installed?

Revision history for this message
Kevin Ray (kevindanray) wrote :

I'm having the same problem.

2012-06-11 13:38:41,071 - twisted - ERROR - Unhandled error in Deferred:
2012-06-11 13:38:41,075 - twisted - ERROR - Unhandled Error
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 362, in callback
    self._startRunCallbacks(result)
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 458, in _startRunCallbacks
    self._runCallbacks()
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 545, in _runCallbacks
    current.result = callback(current.result, *args, **kw)
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1181, in unwindGenerator
    return _inlineCallbacks(None, gen, Deferred())
--- <exception caught here> ---
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1039, in _inlineCallbacks
    result = g.send(result)
  File "/usr/lib/python2.7/dist-packages/ubuntuone-client/ubuntuone/syncdaemon/action_queue.py", line 858, in _make_connection
    ssl_context = get_ssl_context(self.disable_ssl_verify)
exceptions.TypeError: get_ssl_context() takes exactly 2 arguments (1 given)

Revision history for this message
ScaryTom (t-denley) wrote :

$ dpkg -s python-ubuntuone-storageprotocol
Package: python-ubuntuone-storageprotocol
Status: install ok installed
Priority: optional
Section: python
Installed-Size: 382
Maintainer: Ubuntu Developers <email address hidden>
Architecture: all
Source: ubuntuone-storage-protocol
Version: 3.0.0-0ubuntu1.1
Replaces: ubuntuone-storage-protocol
Provides: python2.7-ubuntuone-storageprotocol
Depends: python2.7, python (>= 2.7.1-0ubuntu2), python (<< 2.8), python-twisted-core, python-oauth (>= 1.0~svn1092), python-openssl, python-protobuf (>= 2.0.3-0ubuntu1), python-xdg
Conflicts: ubuntuone-storage-protocol
Conffiles:
 /etc/ssl/certs/UbuntuOne-Go_Daddy_CA.pem 3ddb4e4856a653f2caae15e06000df8f
 /etc/ssl/certs/UbuntuOne-Go_Daddy_Class_2_CA.pem 4f5a072d379bdf90bc2f3c126ceaaab2
Description: Python library for Ubuntu One file storage and sharing service
 This package provides the network client library for accessing
 Ubuntu One file storage and sharing. This is the Python interface to
 Ubuntu One's online file storage and sharing service.
Homepage: https://one.ubuntu.com
Original-Maintainer: Rick McBride

Revision history for this message
Rick McBride (rmcbride) wrote :

Confirmed by multiple users.

BTW why am I still listed as Original-Maintainer on Protocol?

Changed in u1sync:
assignee: nobody → Ubuntu One Desktop+ team (ubuntuone-desktop+)
status: New → Confirmed
Revision history for this message
Karl Hegbloom (karl.hegbloom) wrote : Re: [Bug 1009786] Re: Does not connect: exceptions.TypeError: get_ssl_context() takes exactly 2 arguments (1 given)

I thought this one was already fixed? Hmmmm.
On Jun 13, 2012 2:31 PM, "Rick McBride" <email address hidden> wrote:

> Confirmed by multiple users.
>
> BTW why am I still listed as Original-Maintainer on Protocol?
>
> ** Changed in: u1sync
> Assignee: (unassigned) => Ubuntu One Desktop+ team (ubuntuone-desktop+)
>
> ** Changed in: u1sync
> Status: New => Confirmed
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1009786
>
> Title:
> Does not connect: exceptions.TypeError: get_ssl_context() takes
> exactly 2 arguments (1 given)
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/u1sync/+bug/1009786/+subscriptions
>

Revision history for this message
dobey (dobey) wrote :

Karl, it is already fixed in ubuntuone-client, however it is not fixed in u1sync as it is a not well maintained additional tool, which is not generally recommended. The cause is the same, but the trace is slightly different there.

Revision history for this message
Kevin Ray (kevindanray) wrote :

The issue has been resolved for both of my workstations with the latest updates.

Revision history for this message
ScaryTom (t-denley) wrote :

Having taken the latest updates, I am now getting this:
Traceback (most recent call last):
  File "/usr/local/bin/u1sync", line 28, in <module>
    from u1sync.main import main
  File "/usr/local/lib/python2.7/dist-packages/u1sync/main.py", line 43, in <module>
    from u1sync.client import (
  File "/usr/local/lib/python2.7/dist-packages/u1sync/client.py", line 35, in <module>
    from ubuntuone.platform.xdg_base_directory import ubuntuone_log_dir
ImportError: No module named platform.xdg_base_directory

Revision history for this message
ScaryTom (t-denley) wrote :

I'm an idiot, ignore my last post.

For some reason I removed the python-ubuntuone-client package and didn't re-install it. With that done, I'm back to the original exception:

Unhandled Error
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/twisted/python/context.py", line 81, in callWithContext
    return func(*args,**kw)
  File "/usr/lib/python2.7/dist-packages/twisted/internet/posixbase.py", line 586, in _doReadOrWrite
    why = selectable.doRead()
  File "/usr/lib/python2.7/dist-packages/twisted/internet/_glibbase.py", line 55, in doRead
    self.reactor._simulate()
  File "/usr/lib/python2.7/dist-packages/twisted/internet/_glibbase.py", line 313, in _simulate
    self.runUntilCurrent()
--- <exception caught here> ---
  File "/usr/lib/python2.7/dist-packages/twisted/internet/base.py", line 773, in runUntilCurrent
    f(*a, **kw)
  File "/usr/local/lib/python2.7/dist-packages/u1sync/client.py", line 328, in _connect
    ctx = get_ssl_context(no_verify)
exceptions.TypeError: get_ssl_context() takes exactly 2 arguments (1 given)

Changed in u1sync:
status: Confirmed → Fix Committed
dobey (dobey)
Changed in u1sync:
status: Fix Committed → Fix Released
Revision history for this message
ScaryTom (t-denley) wrote :

Thanks for the fix. I've updated my backup server, and will report back with results tomorrow, after the overnight run.

Revision history for this message
ScaryTom (t-denley) wrote :

I can confirm that the latest version works correctly.

Revision history for this message
Mystic-Mirage (mystic-mirage) wrote :

Hi! I have ubuntuone-client 3.0.1-0ubuntu1.0.1 installed but I still getting same error as in bug description.

Revision history for this message
Mystic-Mirage (mystic-mirage) wrote :

Sorry. My error is reverse of this bug. I getting this:
get_ssl_context() takes exactly 1 argument (2 given)

Problem solved by replacing:
ssl_context = get_ssl_context(self.disable_ssl_verify, host)
to
ssl_context = get_ssl_context(self.disable_ssl_verify)

Revision history for this message
Mystic-Mirage (mystic-mirage) wrote :

Just ignore my posts. The problem was about non-propertly upgraded precise from oneiric because of ubuntu one ppa.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.