Attempt to login fails due to proxy parsing exception

Bug #1007109 reported by Steve Beattie on 2012-05-31
14
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu Single Sign On Client
Status tracked in Trunk
Stable-3-0
Undecided
Unassigned
Stable-4-0
Undecided
Alejandro J. Cura
Trunk
Medium
Alejandro J. Cura
ubuntu-sso-client (Ubuntu)
Medium
dobey
Quantal
Medium
dobey

Bug Description

Attempting to use the reinstall previous purchases option fails in the 'Connect to Ubuntu Software Center' screen after entering the correct authentication information fails with the following message:

  invalid literal for int() with base10: '@as []'

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: software-center 5.2.2.1
ProcVersionSignature: Ubuntu 3.2.0-24.37-generic 3.2.14
Uname: Linux 3.2.0-24-generic x86_64
ApportVersion: 2.0.1-0ubuntu8
Architecture: amd64
CheckboxSubmission: 9c15077a0ca11678d04e060687c26674
CheckboxSystem: 5dc75472945f57d094b84e90feb97396
Date: Thu May 31 13:16:29 2012
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Release amd64 (20110426)
PackageArchitecture: all
ProcEnviron:
 TERM=screen
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: software-center
UpgradeStatus: Upgraded to precise on 2012-01-30 (122 days ago)

Related branches

Steve Beattie (sbeattie) wrote :
Gary Lasker (gary-lasker) wrote :

Hi Steve, and thanks for your report. I can't currently reproduce this error. Could you please tell me where that error message was displayed?

Thanks!
Gary

Steve Beattie (sbeattie) wrote :

Attached is a screenshot. I get here from File -> Reinstall Previous Purchases ...

Gary Lasker (gary-lasker) wrote :

Hi Steve, I spoke to Natalia Bidart about this bug and she graciously provided some debug steps that you could please try. In a terminal, run the following:

  $ U1_DEBUG=True python /usr/lib/ubuntu-sso-client/ubuntu-sso-login

And then try the "Reinstall Previous Purchases" process again. Please then paste any output in the terminal to this bug.

It may also be helpful to attach the most recent log files in ~/.cache/sso/ .

Many thanks for your help!

Steve Beattie (sbeattie) wrote :

~/.cache/sso/sso-client-gui.log only contains the following (from this run):

2012-06-01 12:16:01,939:939.825057983 - ubuntu_sso.gui.gtk - DEBUG - UbuntuSSOClientGUI: app_name 'Ubuntu Software Center', kwargs {'close_callback': <function main_quit at 0x215b140>, 'login_only': True, 'tc_url': '', 'policy_url': '', 'window_id': 0, 'ping_url': '', 'help_text': 'To reinstall previous purchases, sign in to the Ubuntu Single Sign-On account you used to pay for them.'}.
2012-06-01 12:16:02,025:25.5270004272 - ubuntu_sso.gui.gtk - DEBUG - UbuntuSSOClientGUI: backend created: <Interface <ProxyObject wrapping <dbus._dbus.SessionBus (session) at 0x2956710> com.ubuntu.sso /com/ubuntu/sso/accounts at 0x2a94490> implementing 'com.ubuntu.sso.UserManagement' at 0x2a94510>
2012-06-01 12:16:15,735:735.634088516 - ubuntu_sso.gui.gtk - INFO - on_login_error: args (<ubuntu_sso.gtk.gui.UbuntuSSOClientGUI object at 0x2986c10>, dbus.String(u'Ubuntu Software Center'), dbus.Dictionary({dbus.String(u'errtype'): dbus.String(u'ValueError'), dbus.String(u'message'): dbus.String(u"invalid literal for int() with base 10: '@as []'")}, signature=dbus.Signature('ss'))), kwargs {}.

~/.cache/sso/sso-client.log is identical to the debug output emitted on the command line, except for the following added line:

+2012-06-01 12:16:01,943:943.830013275 - ubuntu_sso.utils - DEBUG - _get_dir: trying use dir at '/usr/lib/python2.7/dist-packages/ubuntu-sso-client/data' (exists? False)

Hope this helps. Thanks.

Gary Lasker (gary-lasker) wrote :

Hi Natalia! You'll probably remember that we talked about this bug last week on IRC and you let me know what debug info to ask for, which Steve has now provided.

I've temporarily assigned this to you in the hope that you might take a look at the log data and then reassign the bug to the correct package and person, as you see fit.

Many thanks for your help! And many thanks to Steve for taking the time to help with this and for providing the information, etc.!!

Please let me know if there is anything that I can do to help as well.

Thanks again!

Changed in software-center (Ubuntu):
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → Natalia Bidart (nataliabidart)
Natalia Bidart (nataliabidart) wrote :

Started debugging this along with the SSO server crowd. Will mark as private since logs were pasted as comments.

visibility: public → private
Gary Lasker (gary-lasker) wrote :

Many thanks, Natalia! :)

Natalia Bidart (nataliabidart) wrote :

Steve,

We couldn't find anything particular for your account in the SSO end, and I've couldn't reproduce this locally.
Would you please run the following python script to try to authenticate directly to the SSO server?

https://pastebin.canonical.com/67796/

Please note that instead of 'email' and 'password' you should type your SSO email and your SSO password. If you save the above in a file, name it something like 'sso-test.py' and then run in a terminal:

$ python sso-test.py

and attach the whole output, including any traceback or message printed in the console.

Thanks!

Steve Beattie (sbeattie) wrote :

Hi,

When running the script as requested with my SSO login in place, I get no output whatsoever:

 $ python tmp/sso-test.py
 $ echo $?
 0

If I enter incorrect SSO information, I get a python traceback and an HTTP 401 Unauthorized error.

I should point out that it's only the Reinstall Previous Puchases screen where SSO authentication fails in software-center; I purchased the most recent humble bundle and have been able to register those purchases through software-center, and successfully authenticated through SSO while doing so.

Natalia Bidart (nataliabidart) wrote :

Update: I'm submitting a branch to the SSO trunk code so we can gather more debug from the login attempt from Steve. As soon as out nightlies are built, I will ask Steve to upgrade to our latest revno, and to reproduce the issue, so we can see what is really happening between the SSO client and the server.

Natalia Bidart (nataliabidart) wrote :

Steve,

is there any chance you install the sso packages from the ubuntuone-nightlies PPA, so we have have better debugging?

Instructions to do so are the following (in a terminal, run the following commands):

$ sudo apt-add-repository ppa:ubuntuone/nightlies
$ sudo apt-get update && sudo apt-get upgrade

Once that's completed, please run the following:

$ U1_DEBUG=True python /usr/lib/ubuntu-sso-client/ubuntu-sso-login

and then reproduce the error from the Software Center. Once that's done, please attach a file with the whole output of the terminal (or, equivalently, attach the log files at ~/.cache/sso/).

Thanks!

Steve Beattie (sbeattie) wrote :

Attached is the log messages from reproducing the error with the following installed:

$ apt-cache policy ubuntu-sso-client
ubuntu-sso-client:
  Installed: 4.1+r970-48~precise1
  Candidate: 4.1+r970-48~precise1
  Version table:
 *** 4.1+r970-48~precise1 0
        500 http://ppa.launchpad.net/ubuntuone/nightlies/ubuntu/ precise/main amd64 Packages
        100 /var/lib/dpkg/status

Note that everything after the line

  012-06-18 11:09:20,687:687.486886978 - ubuntu_sso.main - DEBUG - 'SSOLogin': emitting 'LoginError' with args (dbus.String(u'Ubuntu Software Center'), ValueError("invalid literal for int() with base 10: '@as []'",)) and kwargs {}

is the unwinding from canceling the sso login after the failure shows up.

Steve Beattie (sbeattie) wrote :

And the sso-client-gui.log file

Natalia Bidart (nataliabidart) wrote :

Hello Steve,

Considering that from the new logging output I can confirm that the code that queries the SSO API is never reached, I'm inclined to think that the proxy parsing is failing.

Would you please paste the output of running the following command in a terminal?

gsettings list-recursively org.gnome.system.proxy

As soon as I get this feedback, I will propose a branch to improve the proxy parsing and make it more robust.

Thanks!

Leo Arias (elopio) on 2012-06-20
tags: added: desktop+

On Wed, Jun 20, 2012 at 06:00:49PM -0000, Natalia Bidart wrote:
> gsettings list-recursively org.gnome.system.proxy

$ gsettings list-recursively org.gnome.system.proxy
org.gnome.system.proxy autoconfig-url ''
org.gnome.system.proxy ignore-hosts @as []
org.gnome.system.proxy mode 'none'
org.gnome.system.proxy use-same-proxy false
org.gnome.system.proxy.ftp host ''
org.gnome.system.proxy.ftp port 0
org.gnome.system.proxy.http authentication-password ''
org.gnome.system.proxy.http authentication-user ''
org.gnome.system.proxy.http enabled false
org.gnome.system.proxy.http host ''
org.gnome.system.proxy.http port 0
org.gnome.system.proxy.http use-authentication false
org.gnome.system.proxy.https host ''
org.gnome.system.proxy.https port 0
org.gnome.system.proxy.socks host ''
org.gnome.system.proxy.socks port 0

--
Steve Beattie
<email address hidden>
http://NxNW.org/~steve/

Thanks for the prompt reply!

So, apparently the value for "ignore-hosts" is malformed, so the next steps would be:

* understand why/how you ended up with malformed proxy settings
* make the proxy parsing code more robust in the SSO end

Could you please let me know if you changed your proxy settings somehow? If so, what UI/CLI/method you use to set them?

Thanks again, Natalia.

affects: software-center (Ubuntu) → ubuntu-sso-client (Ubuntu)
Changed in ubuntu-sso-client:
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → Natalia Bidart (nataliabidart)
summary: - Attempting to reinstall purchased fails in SSO re-authentication
+ Attempting to login fails due to proxy parsing exception
summary: - Attempting to login fails due to proxy parsing exception
+ Attempt to login fails due to proxy parsing exception
Steve Beattie (sbeattie) wrote :

I don't think I ever adjusted my proxy settings (I don't use one normally); if I did in the past (for testing something, perhaps), I would have used the Network panel in gnome-control-center (i.e. running 'gnome-control-center network').

What is the "correct" setting of ignore-hosts supposed to be?

(A VCS plugin for things like gsettings would probably useful to record the reasons for changes being made.)

Natalia Bidart (nataliabidart) wrote :

Steve,

Valid settings for the ignore-hosts key is a list of hosts to ignore. To workaround the issue you're having, you can just reset the value using:

$ gsettings reset org.gnome.system.proxy ignore-hosts

For me, that results in the following proxy settings:

$ gsettings list-recursively org.gnome.system.proxy
org.gnome.system.proxy autoconfig-url ''
org.gnome.system.proxy ignore-hosts ['localhost', '127.0.0.0/8']
org.gnome.system.proxy mode 'none'
org.gnome.system.proxy use-same-proxy false
org.gnome.system.proxy.ftp host ''
org.gnome.system.proxy.ftp port 0
org.gnome.system.proxy.http authentication-password ''
org.gnome.system.proxy.http authentication-user ''
org.gnome.system.proxy.http enabled false
org.gnome.system.proxy.http host ''
org.gnome.system.proxy.http port 8080
org.gnome.system.proxy.http use-authentication false
org.gnome.system.proxy.https host ''
org.gnome.system.proxy.https port 0
org.gnome.system.proxy.socks host ''
org.gnome.system.proxy.socks port 0

We, as SSO client providers, will improve the parsing to these parse errors are not propagated to the end user.
Thanks a lot for your feedback and help!

Natalia.

Alejandro J. Cura (alecu) wrote :

Here's how to reproduce the bug:

$ gsettings set org.gnome.system.proxy ignore-hosts []

After running that command the setting will be an empty list, so the output of "list-recursively" will show it like in the error:

$ gsettings get org.gnome.system.proxy ignore-hosts
@as []

It seems this only happens whenever a setting has an empty list, so our code should account for this.

Alejandro J. Cura (alecu) wrote :

After further research I found that the "@as" is the type annotation for g_variant_print as used by the gsettings command: http://developer.gnome.org/glib/2.32/glib-GVariant.html#g-variant-print

In this case it's harmless to just ignore it.

Changed in ubuntu-sso-client:
assignee: Natalia Bidart (nataliabidart) → Alejandro J. Cura (alecu)
Leo Arias (elopio) on 2012-06-23
tags: added: u1-proxy
dobey (dobey) on 2012-06-27
Changed in ubuntu-sso-client (Ubuntu Quantal):
assignee: Natalia Bidart (nataliabidart) → Rodney Dawes (dobey)
Natalia Bidart (nataliabidart) wrote :

Removing attachments with personal info so we can make this bug public to move forward with releases and SRUs.

dobey (dobey) on 2012-06-27
visibility: private → public
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubuntu-sso-client - 3.99.1-0ubuntu1

---------------
ubuntu-sso-client (3.99.1-0ubuntu1) quantal-proposed; urgency=low

  * New upstream release.
    - Handle type annotation when printed from gsettings. (LP: #1007109)
    - Remove back buttons in sign in/up pages. (LP: #1009107)
    - Disable tests broken by GTK+ 3.5 behavior change. (LP: #1014772)
    - Remove code duplication with dirspec. (LP: #1016151)
    - Stop using deprecated dict iteritems/itervalues calls. (LP: #1016707)
    - Stop using deprecated exception handling method. (LP: #1016711)
  * debian/control:
    - Update dependencies.
  * debian/*.install:
    - Remove modules that duplicated code with dirspec.
  * debian/patches:
    - Remove upstreamed patches.
 -- Rodney Dawes <email address hidden> Wed, 27 Jun 2012 15:10:41 -0400

Changed in ubuntu-sso-client (Ubuntu Quantal):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers