The original use-case for put in Capistrano was for writing generated
templates to the remote servers. Thus, the put method takes a string
and writes it. I'd not be opposed to extending cap's put method to
handle file-to-file transfers, though.
- Jamis
On 7/7/07, Joshua S <[EMAIL PROTECTED]> wrote:
>
> I am running capistrano on my local box to do the check and trying to
> copy the file directly the box I want it without the use of a gateway.
>
> I've gotten Net::SFTP to work just fine using put_file, is there any
> special reason cap is read the file in and then using put instead of
> using put_file?
>
> On Jul 7, 4:43 pm, "Jamis Buck" <[EMAIL PROTECTED]> wrote:
> > Well, I've spent a couple hours this afternoon trying to duplicate
> > this. I can't duplicate the "hang" effect, but I have been able to
> > consistently trigger another failure: "Corrupted MAC on input".
> >
> > I've only been able to trigger that when uploading a larger file over
> > at least two connections, via a gateway. This script does it for me,
> > very consistently (though not 100% every time):
> >
> > require 'capistrano/gateway'
> > require 'capistrano/logger'
> > require 'capistrano/upload'
> >
> > def srv(host)
> > Capistrano::ServerDefinition.new(host)
> > end
> >
> > logger = Capistrano::Logger.new(:output => STDOUT)
> > logger.level = 3
> >
> > gateway = Capistrano::Gateway.new(srv("..."), :logger => logger)
> >
> > s1 = gateway.connect_to(srv("..."))
> > s2 = gateway.connect_to(srv("..."))
> >
> > Capistrano::Upload.process([s1,s2], "/tmp/dummy.txt",
> > :data => "123456789" * 100000, :logger => logger)
> >
> > puts "done"
> >
> > So, I suppose my question is: for those of you having problems, what
> > is your connection configuration like? Are you using a gateway? Are
> > you connecting to multiple hosts?
> >
> > I'm beginning to think that, sadly, Net::SFTP is not ready for this
> > use-case. I may need to pull the :copy strategy from cap2 until I have
> > a chance to completely scrap and rewrite both Net::SSH and Net::SFTP.
> >
> > - Jamis
> >
> > On 7/7/07, Holger Kohnen <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> > > On Monday 02 July 2007 23:20:34 [EMAIL PROTECTED] wrote:
> > > > I am having a similiar problem using cap deploy with copy_strategy =
> > > > export and deploy_via = copy, I did the above and the log file ends
> > > > with
> >
> > > > [DEBUG] Fri Jun 15 22:31:58 -0500 2007 -- transport.session: sending
> > > > message >>"<some_random_stuff_here>"<<
> > > > [DEBUG] Fri Jun 15 22:31:58 -0500 2007 -- sftp.operations.write:
> > > > received request id 1
> >
> > > > and then it just stops and never does anything else. the file is
> > > > created on the server with size 0.
> >
> > > Same issue here. I have tried any sftp version but no success.
> > > About one month ago everything worked fine. Something must
> > > have changed, but don't know what.
> > > I have monkey patched the Upload class in my Capfile to use scp,
> > > surely it is not really elegant, but it is a solution ;-)
> >
> > > <snip>
> > > $configuration = self
> > > module ::Capistrano
> > > class Upload
> > > def self.process(sessions, filename, options)
> > > options[:logger].info 'Monkey patched Upload.process - Uses scp now'
> > > # don't know how to access configuration here without a global
> > > user = $configuration.fetch(:user)
> > > sessions.each do |session|
> > > server = session.xserver.host
> > > command = "scp #{filename} [EMAIL PROTECTED]:#{filename}"
> > > options[:logger].info command
> > > options[:logger].info `#{command}`
> > > end
> > > end
> > > end
> > > end
> > > </snap>
> >
> > > kind of regards, holger
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/capistrano
-~----------~----~----~----~------~----~------~--~---