Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 45819 invoked from network); 11 Aug 2010 14:07:59 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 11 Aug 2010 14:07:59 -0000 Received: (qmail 44982 invoked by uid 500); 11 Aug 2010 14:07:58 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 44701 invoked by uid 500); 11 Aug 2010 14:07:55 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 44693 invoked by uid 99); 11 Aug 2010 14:07:54 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Aug 2010 14:07:54 +0000 X-ASF-Spam-Status: No, hits=3.6 required=10.0 tests=FREEMAIL_FROM,FS_REPLICA,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jochenkempf@gmail.com designates 209.85.215.180 as permitted sender) Received: from [209.85.215.180] (HELO mail-ey0-f180.google.com) (209.85.215.180) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Aug 2010 14:07:49 +0000 Received: by eyz10 with SMTP id 10so75182eyz.11 for ; Wed, 11 Aug 2010 07:07:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:content-type; bh=ey2fFtqdX+NCVr82bd8GwhbsfqIvUMayZ12/LR+nmGg=; b=FDkpwMQmAs6jf8FdmbdepsPdfA6NjRE7pCu6B663B07aLDkEMWJbBTnsBAYRJR40i0 oKh6wKjtq1kjhaxzh+ux4wVywQ3Jab/s/YqKjwE6FB8y8QgcZkwOZ1PeB0U3erxmrZwT qTP5aq220G3RAMNuUWdchhvK7P4D/dSN0gAPI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=fvYoC0XMR5SmxR0gh8rOhQ7iAao5V5eS78HFC8IczmuKRXtR7gFauF0S79tzliDJqW pMJ07L9opEVg+TqlJzLBaabo41YHDoKX79lg4gZo+TutUPrcmugmcZ7xP+0mFmlxcVu3 jat0Iw+LZ4/cohJw0RzYMGghoMWaBvjB91Ezw= Received: by 10.216.231.97 with SMTP id k75mr16764077weq.4.1281535647934; Wed, 11 Aug 2010 07:07:27 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.183.148 with HTTP; Wed, 11 Aug 2010 07:07:06 -0700 (PDT) In-Reply-To: References: From: Jochen Kempf Date: Wed, 11 Aug 2010 10:07:06 -0400 Message-ID: Subject: Re: Replication error using basic authentication on nginx To: user@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 Hi Daniel, I also tried replication disabling basic auth and setting the authorization header with "proxy_set_header Authorization $http_authorization;" in nginx. Unless I didn't do something wrong here it should work, right? But I get the same error during replication! I think I'll have to wait the new CouchDB releases as J Chris Anderson recommended here: ------------------------ sorry the list keeps bouncing my reply. so here it is direct: There is a bug in 0.11.1 and 1.0.0 (fixed in trunk and 0.11.2, and will be in the 1.0.1 release which is due this week). The 0.11.2 release has been approved, currently we're just waiting for it to be uploaded to the mirrors and the website. Watch this space for details: http://couchdb.apache.org/downloads.html The bug is that the replicator "forgets" basic-auth credentials when there is a redirect (as there is for design documents.) The redirect for design documents is because the URL /db/_design%2Ffoo/_view/foo is considered too ugly, so we make that resource available at /db/_design/foo/_view/foo. To avoid having the document in 2 places, we do a redirect, which in this case, the replicator has to follow. The solution is to upgrade to 0.11.2, the 1.0.x svn branch, or wait for the 1.0.1 release. (Or turn off basic auth.) I'm not aware of another workaround. Chris ------------------------------------ Thanks for your reply Daniel! 2010/8/11 Daniel Truemper : > Hi, > > From the gist I see that you have enabled basic authentication inside nginx. Why so? Try do disable it and only use the CouchDB authentication. > > In the "http response of replication" the 401 is from nginx not CouchDB. So maybe it gets mixed up somewhere... > > Daniel > >> Hi, >> >> I have been trying to figure out quite for a while why I cannot do >> "pull replication using nginx basic authentication on the source >> system. >> I simply do not know what I am doing wrong nor why couchdb fails >> replicating giving a not authorized error considering I can >> successfully do a put request to a design doc. >> I tried replication both in futon as on console but no chance to get it work :-( >> >> I have put a public gist at: http://gist.github.com/518113 >> which shows a couchdb log for the corresponding "pull replication, a >> couchdb log for a put request to a design doc, the replication http >> response, my complete nginx.conf file and my iptables. Both systems >> use Ubuntu 10.04 and Couchdb 0.11.1. >> >> As I use the same credentials for both the basic authentication in >> nginx and couchdb the put request to a design doc succeeds - why >> doesn't the replication? >> >> Can anyone explain the logic of the couchdb replication log? >> Why is there a 404 response? >> Why are there a 301 response? >> >> I really got stuck with that and need to find any suitable solution to >> use couchdb without admin party mode. >> >> Any hint is highly appreciated! > >