From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id QP9KJRBYf2BZlQAAgWs5BA (envelope-from ) for ; Wed, 21 Apr 2021 00:39:12 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id qDgmIRBYf2BOfQAA1q6Kng (envelope-from ) for ; Tue, 20 Apr 2021 22:39:12 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id F232C27D69 for ; Wed, 21 Apr 2021 00:39:11 +0200 (CEST) Received: from localhost ([::1]:34572 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lYz1T-0001db-1L for larch@yhetil.org; Tue, 20 Apr 2021 18:39:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34326) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lYz1J-0001dU-NH for guix-devel@gnu.org; Tue, 20 Apr 2021 18:39:01 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:44086) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lYz1I-0004cP-UF; Tue, 20 Apr 2021 18:39:00 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=52838 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lYz1I-0004ed-IG; Tue, 20 Apr 2021 18:39:00 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: "pelzflorian (Florian Pelz)" Subject: Re: bug#47867: [1.2.1 pre-release testing] substitute downloading and TLS errors References: <87lf9hsh9t.fsf@gmail.com> <20210418093856.a6r2zqw2gks56dg5@pelzflorian.localdomain> <87a6pvnbjg.fsf@gnu.org> <20210418113337.z3afnp4lmt55cjvw@pelzflorian.localdomain> <20210418121006.4ihop3umb2oyofum@pelzflorian.localdomain> <20210419080516.piqb52s32h3fe5ag@pelzflorian.localdomain> <20210420012113.jcwuzfx6k3by5nvo@pelzflorian.localdomain> <20210420152754.a3ucylrdugrmxu57@pelzflorian.localdomain> Date: Wed, 21 Apr 2021 00:38:58 +0200 In-Reply-To: <20210420152754.a3ucylrdugrmxu57@pelzflorian.localdomain> (pelzflorian@pelzflorian.de's message of "Tue, 20 Apr 2021 17:27:54 +0200") Message-ID: <8735vk8ttp.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: guix-devel@gnu.org, jcguu95 , 47867@debbugs.gnu.org Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1618958352; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=ESpKVWSdqNx0Ex3e4qHnKHUjD23RTtAtae82F9WKM2E=; b=Czb9MC0vHbMRRPmC6/h4mhsTrWZiELqGretq/lDwbiMqJWHAR8TOZo2Ml4nvFw5wfRYOCP fOhj45EweVtBteDn9nagtTSSSz27iJWqjnUTLCokgclsUnIsPqbppcuvrAKM991aza4b5/ Bk+YXchTPELg+q1nVpHjhQ3/sY3C9TvkzWYe4cCc8E6soG4gzKe3yuv1rlN+CdilWnvkL1 ZfAd8+Iv+BEnt8jwFA0bUpExzpAZqUGkvYMytD6sYIczXQnlsQQVI755AnWrVHzjjz2h/Q 2zsUy8Q7JtmCFDRkehJpGKY1gxiZVeu8M9cFHCWVN8dMWk4I55ADdvKzOYbCbw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1618958352; a=rsa-sha256; cv=none; b=BT+z8Vgo5Lll7oZkgdX9cR+dKGPoS10it5uTO/8aMKC5S8iuy1BbM46KpuvbhuLAYwvZqm 4Y9dMMuNVzP7/610l0qP4XNWmkOvE/g4eUTCTRnaBvhX9EAYHZHTsWYaygbrggCur0PEe4 Q+EGY9v4LomBHtcchaq0fnfvlrbHdEyHBkJlUYqNSYj2yZnDNYgMbEKLTsfdbwWqxeWdwH xx169vdwOu/KWlemOr1srQUonWd4Mq+wuMXRP21RSCvJ6/o+6RmuiiA1hyPU09pbZAHHJp PXVuMZAggMPo4lEffLgfcu+IzIC4C8/HB6XDDccG/U4QJYokWY8XGRgwCxUUow== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Spam-Score: -2.94 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Queue-Id: F232C27D69 X-Spam-Score: -2.94 X-Migadu-Scanner: scn0.migadu.com X-TUID: GHNyafKBh3O8 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Florian, "pelzflorian (Florian Pelz)" skribis: > On Tue, Apr 20, 2021 at 03:21:13AM +0200, pelzflorian (Florian Pelz) wrot= e: >> > git revert be5a75ebb5988b87b2392e2113f6590f353dd6cd > > It seems this is the bad commit. Downloading the enlightenment > substitute got stuck and after a few minutes displayed the usual TLS > error. Note that on master there have been changes in this area since this commit, in particular 20c08a8a45d0f137ead7c05e720456b2aea44402. I assume the error we=E2=80=99re after is still this one: >> | substitute: updating substitutes from 'https://ci.guix.gnu.org'.= .. 0.0%guix substitute: error: TSL error in procedure 'write_to_session_por= t': Resource temporarily unavailable, try again. I believe the attached patch =E2=80=9Caddresses=E2=80=9D this problem. Now, I=E2=80=99m a bit skeptical: the error above is GNUTLS_E_AGAIN, which happens if sendmsg(2) returns EAGAIN, which supposedly only happens on datagram (UDP) sockets or on non-blocking sockets, neither of which applies here. This change should be safe, though since I=E2=80=99m not sure why we=E2=80= =99re getting EAGAIN in the first place, I wonder what could happen (infinite loop?). Could you give it a try? Can you reproduce the substitute issue in a simpler environment? For instance, by running: rm -rf ~/.cache/guix/substitute/ ./pre-inst-env guix weather $(guix package -A |head -2000 |cut -f1)=20 This makes 2000 pipelined GETs to https://ci.guix.gnu.org, which is probably similar to what you observe during system installation. Thanks for the thorough debugging and bisecting, as always! Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/guix/http-client.scm b/guix/http-client.scm index a2e11a1b73..51bba250d5 100644 --- a/guix/http-client.scm +++ b/guix/http-client.scm @@ -38,7 +38,7 @@ #:use-module (guix utils) #:use-module (guix base64) #:autoload (gcrypt hash) (sha256) - #:autoload (gnutls) (error/invalid-session) + #:autoload (gnutls) (error/invalid-session error/again) #:use-module ((guix build utils) #:select (mkdir-p dump-port)) #:use-module ((guix build download) @@ -163,7 +163,8 @@ reusing stale cached connections." (if (or (and (eq? key 'system-error) (= EPIPE (system-error-errno `(,key ,@args)))) (and (eq? key 'gnutls-error) - (eq? (first args) error/invalid-session)) + (memq (first args) + (list error/again error/invalid-session))) (memq key '(bad-response bad-header bad-header-component))) #f diff --git a/guix/scripts/substitute.scm b/guix/scripts/substitute.scm index 48309f9b3a..65940591a9 100755 --- a/guix/scripts/substitute.scm +++ b/guix/scripts/substitute.scm @@ -45,7 +45,7 @@ #:select (uri-abbreviation nar-uri-abbreviation (open-connection-for-uri . guix:open-connection-for-uri))) - #:autoload (gnutls) (error/invalid-session) + #:autoload (gnutls) (error/invalid-session error/again) #:use-module (guix progress) #:use-module ((guix build syscalls) #:select (set-thread-name)) @@ -417,7 +417,8 @@ server certificates." (if (or (and (eq? key 'system-error) (= EPIPE (system-error-errno `(,key ,@args)))) (and (eq? key 'gnutls-error) - (eq? (first args) error/invalid-session)) + (memq (first args) + (list error/again error/invalid-session))) (memq key '(bad-response bad-header bad-header-component))) (proc (open-connection-for-uri/cached uri #:verify-certificate? #f --=-=-=--