[darcs-users] darcs failed: (sftp) failed to fetch files.

David Roundy droundy at darcs.net
Sat Sep 3 15:09:12 UTC 2005


On Fri, Sep 02, 2005 at 05:03:20PM -0500, Michael Shuler wrote:
> Hello all,

Hello,

> When using darcs get to a remote host, I get the following:
> 
> michael at ares: ~/tmp $ darcs get 
> mshuler at darcs.dfw1.foobarra.com:/var/lib/darcs/rs-rhn-api
> Password:
> Password:
> 
> darcs failed:  (sftp) failed to fetch files.
> source directory: /var/lib/darcs/rs-rhn-api/_darcs/patches
> source files:
> 20050824212913-0090d-f8af9b6acc8d3da0868bc2b391284072d53dcfee.gz
> 
> However, ssh, scp, and sftp all work properly when run alone.
> 
> I have posted a terminal log, as well as a strace log of the failure at:
> 
> http://pbandjelly.org/darcs_failed.log.txt
> http://pbandjelly.org/darcs_failed_strace.txt

>From the strace:

ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, 0xffffb7f8) = -1 ENOTTY (Inappropriate ioctl for device)

I wonder if the problem might be that the ssh in sid somehow is failing to
ask for the password because its standard input isn't a TTY.  Can you try
setting up password-less ssh with public key authorization, and see if the
darcs get works then? Or are you already doing this, and I'm completely on
the wrong track?

I could imagine that a new version of ssh might try to be extra-tricky to
make sure that your passphrase can't be sniffed by darcs, which might cause
trouble.

> This failure occurs on clean Debian Sid 32-bit and 64-bit installs with 
> the current 1.0.3 .deb's installed, as well as with the static 1.0.4rc 
> download from http://www.carpetcode.org/get-carpet-darcs.html.  This 
> same error occurs on two different workstations - work and home.

Presumably sftp is failing because for some reason it doesn't like how
darcs is calling it.  Could you try compiling darcs with the attached patch
applied? This will cause darcs to output the error message that sftp
outputs, which may give a hint as to what is going wrong.

Let me know if you have trouble compiling darcs or applying this patch
(which should apply cleanly to either the darcs-stable or darcs-unstable
branch).
-- 
David Roundy
http://www.darcs.net
-------------- next part --------------

New patches:

[give better output on sftp errors.
David Roundy <droundy at darcs.net>**20050903144454] 
<
> {
hunk ./External.hs 257
                          cd = "cd "++path++"\n"
                          input = cd++(unlines $ map ("get "++) ns)
                      withCurrentDirectory d $ withOpenTemp $ \(th,tn) ->
+                         withTemp $ \sftpoutput ->
                          do hPutStr th input
                             hClose th
                             r <- exec sftp (sftp_args++["-b",tn,host])
hunk ./External.hs 261
-                                 "/dev/null" "/dev/null"
+                                 "/dev/null" sftpoutput
+                            output <- readFile sftpoutput
                             let files = if length ns > 5
                                           then (take 5 ns) ++ ["and "
                                                ++ (show (length ns - 5)) ++ " more"]
hunk ./External.hs 274
                                  fail $ unlines $
                                           ["(sftp) failed to fetch files.",
                                            "source directory: " ++ path,
-                                           "source files:"] ++ files ++ hint
+                                           "source files:"] ++ files ++
+                                          ["sftp output:",output] ++ hint
+                            putStrLn "sftp output:"
+                            putStrLn output
 
 
 copyRemoteCmd :: String -> FilePath -> IO ()
}

Context:

[TAG 1.0.4pre4
David Roundy <droundy at darcs.net>**20050901110418] 
Patch bundle hash:
3c607a7b8ba43b51f82f163e3f1b8e630157ca80


More information about the darcs-users mailing list