desktopcouch-service crashed with Unauthorized in request(): ('unauthorized', 'Authentication required.')

Bug #780972 reported by Anders Kaseorg
This bug affects 695 people
Affects Status Importance Assigned to Milestone
couchdb (Ubuntu)
Fix Released
Critical
dobey
Oneiric
Fix Released
Critical
dobey

Bug Description

Binary package hint: desktopcouch

This happens on every login.

ProblemType: Crash
DistroRelease: Ubuntu 11.10
Package: desktopcouch 1.0.7-0ubuntu2
ProcVersionSignature: Ubuntu 2.6.39-1.6-generic 2.6.39-rc6
Uname: Linux 2.6.39-1-generic x86_64
NonfreeKernelModules: openafs
Architecture: amd64
Date: Wed May 11 04:05:48 2011
EcryptfsInUse: Yes
ExecutablePath: /usr/lib/desktopcouch/desktopcouch-service
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Alpha amd64 (20101202)
InterpreterPath: /usr/bin/python2.7
PackageArchitecture: all
ProcCmdline: /usr/bin/python /usr/lib/desktopcouch/desktopcouch-service
ProcEnviron:
 SHELL=/bin/bash
 LANGUAGE=en_US:en
 PATH=(custom, user)
 LANG=en_US.utf8
PythonArgs: ['/usr/lib/desktopcouch/desktopcouch-service']
SourcePackage: desktopcouch
Title: desktopcouch-service crashed with Unauthorized in request(): ('unauthorized', 'Authentication required.')
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm admin cdrom dialout fuse lpadmin plugdev sambashare

Related branches

Revision history for this message
Anders Kaseorg (andersk) wrote :
tags: removed: need-duplicate-check
visibility: private → public
Revision history for this message
C de-Avillez (hggdh2) wrote :

Confirming. Seems to happen on, or just after, login.

Changed in desktopcouch (Ubuntu):
importance: Undecided → High
status: New → Confirmed
Revision history for this message
z3z (z3z) wrote :

I got this error when installing the extra services when I initially set up Ubuntu One. It's just happened, so not sure if it was a one-time thing, or if I'll experience it again. Ubuntu One seems to be working properly though, and did sync my files correctly.

Revision history for this message
MikhailValerie (mikhailvalerie) wrote :

Same as Rrrrube (see #3), I installed desktopcouch via the Ubuntu One services tab. The progress bar said installation was complete and then the error dialog appeared. I have not yet restarted so I can't confirm whether it appears after login. Restarting Ubuntu One and going back to the services tab shows "Value could not be retrieved. (Unauthorized: ('unauthorized', 'Authentication required.'))". Sync still seems to work fine though.

Revision history for this message
Christian Victor (post-kerm-it-deactivatedaccount) wrote :

+1

Revision history for this message
Francesco Muriana (f-muriana) wrote :

This bug affects me too

Revision history for this message
3vi1 (launchpad-net-eternaldusk) wrote :

I get this crash every time I start Firefox after a reboot (only on the first startup of the app though).

Revision history for this message
Robbie Williamson (robbiew) wrote :

I got this bug and found that if I disconnected using the GUI, and then reconnected from command-line: u1sdtool --connect, the problem went away. Maybe this is simply U1 needing to be restarted once couch-db is installed.

Revision history for this message
Andi Albrecht (andialbrecht) wrote :

Does anyone know a workaround for this bug? This also blocks development on applications created with quickly:

$ quickly create ubuntu-application foo
Creating project directory foo
Creating bzr repository and committing
Launching your newly created project!
Traceback (most recent call last):
  File "./foo", line 33, in <module>
    foo.main()
  File "/home/andi/devel/foo/foo/__init__.py", line 40, in main
    preferences.db_connect()
  File "/home/andi/devel/foo/foo_lib/preferences.py", line 50, in db_connect
    self._database = CouchDatabase(self._db_name, create=True)
  File "/usr/lib/pymodules/python2.7/desktopcouch/application/server.py", line 101, in __init__
    oauth_tokens=oauth_tokens, ctx=ctx)
  File "/usr/lib/pymodules/python2.7/desktopcouch/application/server.py", line 75, in __init__
    oauth_tokens=oauth_tokens, ctx=ctx, views_factory=views_factory)
  File "/usr/lib/pymodules/python2.7/desktopcouch/records/database.py", line 123, in __init__
    self._reconnect()
  File "/usr/lib/pymodules/python2.7/desktopcouch/application/server.py", line 85, in _reconnect
    super(DesktopDatabase, self)._reconnect(uri=uri)
  File "/usr/lib/pymodules/python2.7/desktopcouch/records/database.py", line 139, in _reconnect
    self._server.create(self._database_name)
  File "/usr/lib/pymodules/python2.7/couchdb/client.py", line 193, in create
    self.resource.put_json(validate_dbname(name))
  File "/usr/lib/pymodules/python2.7/couchdb/http.py", line 405, in put_json
    status, headers, data = self.put(*a, **k)
  File "/usr/lib/pymodules/python2.7/couchdb/http.py", line 384, in put
    return self._request('PUT', path, body=body, headers=headers, **params)
  File "/usr/lib/pymodules/python2.7/couchdb/http.py", line 419, in _request
    credentials=self.credentials)
  File "/usr/lib/pymodules/python2.7/desktopcouch/records/http.py", line 251, in request
    raise Unauthorized(error)
couchdb.http.Unauthorized: ('unauthorized', 'Authentication required.')
Congrats, your new project is setup! cd /home/andi/devel/foo/ to start hacking.

quickly run in the project folder brings up the same traceback.

Revision history for this message
Roman Yepishev (rye) wrote :

Andi Albrecht,
The credentials that desktopcouch is using to access local couchdb installation is stored in gnome-keyring (Desktop Couch user authentication), ~/.config/desktop-couch/desktop-couchdb.ini and it is also cached in ~/.local/share/desktop-couch/couchdb.html

By removing these entries and restarting desktopcouch (or logging out/logging in) the new set of credentials will be allocated and it should start working.

Revision history for this message
Andi Albrecht (andialbrecht) wrote :

Roman Yepishev: Thanks! I've tried to remove the desktop-couch
directories before, but didn't deleted the credentials in
gnome-keyring. However, when deleting the credentials from keyring,
the directories and restarting desktopcouch I run into the same
problems.

Is it a problem that the credentials show up twice after this
procedure?

Revision history for this message
3vi1 (launchpad-net-eternaldusk) wrote :

I removed those files, and the password keys, apt-get install --reinstalled desktopcouch, rebooted... and the problem returned the very first time I launched firefox.

Revision history for this message
Pranesh Prakash (the-solipsist) wrote :

For me the problem arises when I try to launch Thunderbird, not Firefox.

Revision history for this message
josa (johnny-sander) wrote :

Error when opening UbuntuOne, but no problems with Firefox or other programs.

Revision history for this message
Chandu (chandujr) wrote :

Error pops up when opening UbuntuOne.

Revision history for this message
Rodrigo Moya (rodrigo-moya) wrote :

This happens for me all the time when using evolution-couchdb

Revision history for this message
suhail kapoor (mail-suhail) wrote :

comes on firefox launch for me

Revision history for this message
Curtis Hovey (sinzui) wrote :

This error looks similar to the issues I experienced in bug 551409. That issue was caused by a mismatch in oauth/launchpadlib libraries. I have verified that I do not have alternate copies of the libraries in my path, but changes in the libs in /usr/lib may still be the issue.

Revision history for this message
Rainer Rohde (rainer-rohde) wrote :

Happens to me when starting Ubuntu One. I deleted the recommended files and the error still persists.

Revision history for this message
ludovicus (lewis-schmidt) wrote :

This is a repeat bug , x 20 logins. It occurs after trying to use the system settings path in the panel or when attempting to use the applets for email.

pls refer me to thelog that i should ctl-v. I looked at /var/log/syslog and didn't find anything useful.

is there a debug level i should change? (don't know where that setting is)
-L-

Changed in desktopcouch (Ubuntu):
assignee: nobody → Jason Gerard DeRose (jderose)
Revision history for this message
Jason Gerard DeRose (jderose) wrote :

So I've been digging into this the last day, and from what I can tell, this is actually a bug in CouchDB as shipped in Oneiric, not desktopcouch.

The problem seems to be that for whatever reason, OAuth isn't working on Oneric... what appears to be the exact same configuration works on Natty, fails on Oneiric.

I'll have more details later, but I'm highly motivated to get this working as it's blocking Novacut work right now.

Revision history for this message
Jason Gerard DeRose (jderose) wrote :

Okay, this is definitely a CouchDB issue, not desktopcouch. I have an easy way to reproduce it:

https://launchpad.net/dc3

Steps:

bzr checkout lp:dc3
cd dc3
./dc3-service # Works on both Natty and Oneiric [Ctrl + C to stop it]
./dc3-service --oauth # Works on Natty, borked on Oneiric

Revision history for this message
Jono Bacon (jonobacon) wrote :

Jason, what is the current status on a fix? I think this bug is driving us all crazy. :-)

Revision history for this message
Jono Bacon (jonobacon) wrote :

Jason - I just saw dc3, I am not sure if shipping an alternative to desktopcouch is a solution at this point in the cycle. Do you have a fix or planned fix for the current couchdb/desktopcouch in Oneiric?

Martin Pitt (pitti)
Changed in desktopcouch (Ubuntu Oneiric):
milestone: none → ubuntu-11.10-beta-2
assignee: Jason Gerard DeRose (jderose) → Ubuntu One (ubuntuone)
assignee: Ubuntu One (ubuntuone) → Ubuntu One hackers (ubuntuone-hackers)
Revision history for this message
Jason Gerard DeRose (jderose) wrote :

Jono: so I had just gotten to clearly figuring out that the problem is CouchDB, not desktopcouh.

dc3 isn't my proposed solution... it's my own hair brained thing, but I basically wrote it trying to figure out this bug, and now it has taken on a life of its own (for me anyway). Tomorrow I'm going to look closely at the CouchDB and Erlang diff between Natty and Oneric.

Martin: I'm happy to try and figure out this bug, although there likely is someone on the Ubuntu One team that could figure it out faster. Also, thanks for your blog post and IRC session on PyGI... they're still the best documentation out there :-D

Ubuntu One Team: Here's what I know so far: desktopcouch is correctly writing the CouchDB config, and is correctly oauth signing requests to CouchDB, but CouchDB for some reason isn't correctly verifying the oauth signed requests. Basic auth requests still work though.

Revision history for this message
crtm (carlosrtm) wrote :

Crash when installing the extra services. I'm using Thunderbird (not evolution)

Revision history for this message
Jason Gerard DeRose (jderose) wrote :

Whoa, 20k line diff between Natty and Oneiric! So doing some greping just trying to narrow down the culprit:

jderose@jgd-test:~/bzr/couchdb/natty/debian$ grep -il oauth patches/*
patches/couchio-fix-0012-replicator_ssl.patch
patches/moz0003-spidermonkey1.8.5_autotools.patch

`couchio-fix-0012-replicator_ssl.patch` was in natty also, so that leaves the giant `moz0003-spidermonkey1.8.5_autotools.patch` suspect. greping shows:

jderose@jgd-test:~/bzr/couchdb/natty/debian$ grep -i oauth patches/moz0003-spidermonkey1.8.5_autotools.patch
diff -Nur -x '*.orig' -x '*~' couchdb-1.0.1//src/erlang-oauth/Makefile.in couchdb-1.0.1.new//src/erlang-oauth/Makefile.in
--- couchdb-1.0.1//src/erlang-oauth/Makefile.in 2010-08-11 19:18:53.000000000 +0100
+++ couchdb-1.0.1.new//src/erlang-oauth/Makefile.in 2011-06-14 18:31:47.583886027 +0100

Now, at a glance I'm not sure what to make of the above, but it makes me wonder if the moz0003 patch mistakenly resulted in oauth support not being built for CouchDB at all. Looks like that diff is mostly generated by autotools (thus the 20k lines), so it's pretty hard to read.

Revision history for this message
Jason Gerard DeRose (jderose) wrote :

Hmm, interesting... so I just built and installed the Natty version of the CouchDB package on Oneiric... problem still exists, which suggests a change in Erlang or one of the other CouchDB dependencies might be causing the problem.

Revision history for this message
Jason Gerard DeRose (jderose) wrote :

Okay, another interesting result: I built and installed couchdb 1.0.1-0ubuntu16 (the Oneiric version) under Natty, and there are no problems... you can make oauth requests to CouchDB just fine.

Now I suspect Erlang issues even more strongly. Between Natty and Oneiric, erlang was upgraded from 13.b.3 to 14.b.2, and I see in the CouchDB 1.0.3 release notes that it:

 * Fixed OAuth signature computation in OTP R14B02.
 * Fixed compatibility issues with Erlang R14B02.
 * Fixed error when restarting replications in OTP R14B02.

http://couchdb.apache.org/downloads.html

So looks like there are several patched we'd need to add.

Revision history for this message
Jason Gerard DeRose (jderose) wrote :

I'm not sure what the Launchpad best practice is in this case, but I filled a bug for the Erlang issue against CouchDB:

https://bugs.launchpad.net/ubuntu/+source/couchdb/+bug/837190

tags: added: iso-testing
Revision history for this message
streetpunk234 (spatiegames) wrote :

Happened while installing desktopcouch-ubuntuone in daily build in vbox

Revision history for this message
Jeff Licquia (jeff-licquia) wrote :

FWIW, didn't happen to me until today. I've been running onieric for a little over a week, and haven't had the problem until today. Ran update last night, which required a reboot (kernel update).

Revision history for this message
Rigved Rakshit (rigved) wrote :

I got this same bug but in version 1.0.7-0ubuntu3.

Revision history for this message
Rigved Rakshit (rigved) wrote :

Sorry, forgot to mention this-

Uname: Linux 3.0.0-9-generic #15-Ubuntu SMP i686 i686 i386 GNU/Linux

Revision history for this message
streetpunk234 (spatiegames) wrote :

Happened again after installing 11.10 beta and updating and installing vbox guest additions.

Revision history for this message
José Antonio (josian2200) wrote :

I'm getting this error every time I launch by the first time the Ubuntu One application after installing all the additional packages in services.

Revision history for this message
Laura Czajkowski (czajkowski) wrote :

got this error after restart after upgrading from natty to oneiric

Revision history for this message
John S. Gruber (jsjgruber) wrote :

Jason Gerard Derose:

Thanks for your fine work on pinning this problem down to couchdb-bin vs. erlang-base and the couchdb-bin 1.0.3 changes. Great work!

--

It seems to me that Jason's effort to get a newer version of couchdb-bin into Oneiric, if possible, is the best plan. I've tested the new version of couchdb-bin he built and it solves the problem for the program I experience the problem with (lernid preferences).

Just in case it doesn't turn out to be feasible to upgrade couchdb-bin to a new release I did just a little work and went looking for a patch in 1.0.3 that would solve this. I built the package with jan's svn r1039345 as the only change at this resolves the problem for me.

For the reason above I'm not proposing this for merge in ubuntu at this time, but just in case it turns out to be needed I've uploaded the bzr branch with only that change to lp:~jsjgruber/+junk/lp780972-whole. The build I tested is couchdb - 1.0.1-0ubuntu17~jsg4.whole.patch in ppa:jsjgruber/ppatwo . The encoding change to src/erlang-oauth/oauth_uri.erl seems necessary and sufficient.

See https://bugs.launchpad.net/ubuntu/+source/couchdb/+bug/817656

Changed in desktopcouch (Ubuntu Oneiric):
status: Confirmed → Triaged
Revision history for this message
John S. Gruber (jsjgruber) wrote :

It's getting late to do anything else, so I am proposing the cherry-pick from couchdb upstream svn r1039345.

Test build is in ppa:jsjgruber/ppa couchdb -- 1.0.1-0ubuntu17~jsg4.whole.patch (note the ppa name)

i386 build log is at: https://launchpad.net/~jsjgruber/+archive/ppa/+build/2773697/+files/buildlog_ubuntu-oneiric-i386.couchdb_1.0.1-0ubuntu17%7Ejsg4.whole.patch_BUILDING.txt.gz

to test use the command:

python -c "from desktopcouch.application.server import *; d=DesktopDatabase('test', create=True)"

Which should return without a traceback. The bug causes this to produce an unauthorized exception.

tags: added: rls-mgr-o-tracking
Revision history for this message
iheartubuntu (iheartubuntu) wrote :

Just did a fresh install of 11.10 on my laptop and have this problem... which seems to be a common problem for U1 for a long time now. My other computers are running 10.10 and none of them have problems after installing the U1 nightlies PPA on them.

Revision history for this message
Christopher Kyle Horton (christhehorton) wrote :

Same as #3 for me...nice that I'll have to put up with issues like this, now that I've installed 11.10 as my primary OS next to 11.04 on my desktop since the latter started freezing up completely for me several times today.

Revision history for this message
Beuntje-ict (beuntje-ict) wrote :

Value could not be retrieved. (Unauthorized: ('unauthorized', 'Authentication required.'))

crash occurs after install just before enabling the contact and link sync in firefox

Revision history for this message
iMac (imac-netstatz) wrote :

I get this error sometimes when leaving evolution. It seems I have an empty CouchDB contacts addressbook that was setup automatically for me some time ago.

Revision history for this message
iMac (imac-netstatz) wrote :

And this Desktop CouchDB addressbook in evolution can not be removed. "Error address book cannot be removed"

Revision history for this message
iMac (imac-netstatz) wrote :

This bug seems to be 100% reproducible upon clean boot if I try to deleted my Ubuntu One CouchDB from evolution.

Revision history for this message
iMac (imac-netstatz) wrote :

I noticed I didn't have the desktopcouch-ubuntuone package installed, as the control panel recommended it for additional syncing options. After the installation the error was triggered again, and the same message passed to the console, even though I was clearly logged in. See attached screenshot.

Revision history for this message
John S. Gruber (jsjgruber) wrote :

It's quite thoughtful of those experiencing this bug to report on it here. Thanks go out to everyone.

Since this bug has been triaged it probably is no longer worth everyone's time to comment on the circumstances when they see it. Now it's up to those assigned to it to work out how best to upgrade couchdb to fix it. Once it is released this bug will probably be marked as fixed and that will be a good opportunity for everyone to make sure they aren't still seeing a problem.

In the meantime it probably *is* worth the time of those experiencing the bug to mark the bug at the topof this report as affecting them so Oneiric managers can best judge the bug's impact.

dobey (dobey)
Changed in desktopcouch (Ubuntu Oneiric):
importance: High → Critical
affects: desktopcouch (Ubuntu Oneiric) → couchdb (Ubuntu Oneiric)
Changed in couchdb (Ubuntu Oneiric):
assignee: Ubuntu One hackers (ubuntuone-hackers) → Rodney Dawes (dobey)
milestone: ubuntu-11.10-beta-2 → none
milestone: none → ubuntu-11.10-beta-2
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package couchdb - 1.0.1-0ubuntu17

---------------
couchdb (1.0.1-0ubuntu17) oneiric; urgency=high

  * Backport svn r1039345 from 1.0.3 (LP: #780972)
 -- John S Gruber <email address hidden> Fri, 02 Sep 2011 01:02:01 -0400

Changed in couchdb (Ubuntu Oneiric):
status: Triaged → Fix Released
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

Note, this looks like it will actually still need rebooting the system or at least killing off couchdb/desktopcouch processes before the command in comment 39 can be used successfully ( python -c "from desktopcouch.application.server import *; d=DesktopDatabase('test', create=True)" )

Revision history for this message
iheartubuntu (iheartubuntu) wrote :

I have updated my system, rebooted and still get the error message within the Ubuntu One Control Panel on the "Services" tab.

Revision history for this message
GodNobody (godnobody) wrote :

Same here!!!!!!!!!!!!

Revision history for this message
Rainer Rohde (rainer-rohde) wrote :

Same here as well. From my point of view, nothing has really changed...

Revision history for this message
Curtis Hovey (sinzui) wrote :

Did you install the new couchdb version 1.0.1-0ubuntu17? I do not see it in the archives yet.

Revision history for this message
GodNobody (godnobody) wrote :

Working for me after two reboots...thanks!!!!!!

Revision history for this message
Christopher Kyle Horton (christhehorton) wrote :

Fix seems to work for me too. Thanks!

Revision history for this message
Rainer Rohde (rainer-rohde) wrote :

Here too now!

Revision history for this message
KnightStalker (knightstalker123) wrote :

I can confirm that this bug is resolved after installing new updates and rebooting =)

Revision history for this message
Francis (fc-gonzalez) wrote : Re: [Bug 780972] Re: desktopcouch-service crashed with Unauthorized in request(): ('unauthorized', 'Authentication required.')

I can confirm that this bug is resolved after installing the new couchdb version 1.0.1-0ubuntu17

El 14/09/11 12:59, KnightStalker escribió:
> I can confirm that this bug is resolved after installing new updates and
> rebooting =)
>

Revision history for this message
Khairul Aizat Kamarudzzaman (fenris) wrote :

i also can confirm that this bugs is resolved after installing the new couchdb

Revision history for this message
Christian Heitjan (heitjan) wrote :

Bug is gone after last update.

Am 19.08.2011 22:48, schrieb Curtis Hovey:
> This error looks similar to the issues I experienced in bug 551409. That
> issue was caused by a mismatch in oauth/launchpadlib libraries. I have
> verified that I do not have alternate copies of the libraries in my
> path, but changes in the libs in /usr/lib may still be the issue.
>

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.