From owner-freebsd-questions@FreeBSD.ORG Mon Sep 10 13:43:43 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 528EA106566B for ; Mon, 10 Sep 2012 13:43:43 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx01.qsc.de (mx01.qsc.de [213.148.129.14]) by mx1.freebsd.org (Postfix) with ESMTP id 0E5538FC18 for ; Mon, 10 Sep 2012 13:43:42 +0000 (UTC) Received: from r56.edvax.de (port-92-195-63-5.dynamic.qsc.de [92.195.63.5]) by mx01.qsc.de (Postfix) with ESMTP id 3D1423CD45; Mon, 10 Sep 2012 15:43:36 +0200 (CEST) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id q8ADhZ2g003091; Mon, 10 Sep 2012 15:43:35 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Mon, 10 Sep 2012 15:43:35 +0200 From: Polytropon To: Pierre-Luc Drouin Message-Id: <20120910154335.ebb08b66.freebsd@edvax.de> In-Reply-To: References: Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: FreeBSD Questions Subject: Re: portsnap Generating a "Bad file descriptor" Error Message X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Sep 2012 13:43:43 -0000 On Mon, 10 Sep 2012 08:56:29 -0400, Pierre-Luc Drouin wrote: > On Tue, Sep 4, 2012 at 10:14 AM, Pierre-Luc Drouin wrote: > > > Hi, > > > > so I have been having problems using portsnap lately. I always get a "Bad > > file descriptor" message when trying using it on one of my i386 machine: > > > > Looking up portsnap5.freebsd.org mirrors... none found. > > Fetching snapshot tag from portsnap5.freebsd.org... done. > > Fetching snapshot metadata... done. > > Fetching snapshot generated at Mon Sep 3 20:04:44 EDT 2012: > > 86abb3c6f24b24e7fdadda42805f9ae38f487177dcb949 0% of 67 MB 0 Bps > > fetch: > > http://portsnap5.freebsd.org/s/86abb3c6f24b24e7fdadda42805f9ae38f487177dcb9493f5e0cb4f792490b2f.tgz: > > Bad file descriptor > > fetch: > > 86abb3c6f24b24e7fdadda42805f9ae38f487177dcb9493f5e0cb4f792490b2f.tgz: Bad > > file descriptor > > > > I tried fsck -y the /var, /tmp and /usr partitions and everything seems > > fine. What could the problem be? > > > > Thanks! > > > > Hi, > > Anyone has an idea about what could be causing this problem? I'm not familiar enough with portsnap (I use CVS) so I can just throw some guesses around: The message "Bad file descriptor" is issued by fetch and seems to be for _your_ side of the connection, and I assume it is regarding the place where the requested file will be fetched to. I don't exactly know _where_ that is. It could be in the ports tree or in a temporary location (from where the results are then written to /usr/ports). The manpage mentions a default workdir of /var/db/portsnap which is on the /var partition. You checked that, no errors. Just check what /var/db/portsnap contains. In worst case, remove portsnap/ and recreate that directory. I have no idea what it is supposed to contain, maybe make a copy of it. You could also try to manually create the file, e. g. by issuing # touch /var/db/portsnap/86abb3c6f24b24e7fdadda42805f9ae38f487177dcb9493f5e0cb4f792490b2f.tgz Look if the file is there. Use # stat /var/db/portsnap/86abb3c6f24b24e7fdadda42805f9ae38f487177dcb9493f5e0cb4f792490b2f.tgz to check if everything is okay. You could also try to manually fetch the file using fetch or maybe even wget, just to see if it can be downloaded and written properly, to a different location, e. g. # cd /tmp # fetch http://portsnap5.freebsd.org/s/86abb3c6f24b24e7fdadda42805f9ae38f487177dcb9493f5e0cb4f792490b2f.tgz or # cd /tmp # wget http://portsnap5.freebsd.org/s/86abb3c6f24b24e7fdadda42805f9ae38f487177dcb9493f5e0cb4f792490b2f.tgz That should be _no_ problem (with the correct file name of course). Again, "Bad file descriptor" is often seen in relation to file system trouble. I've seen that in the past myself. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...