Cimpress-MCP / vagrant-orchestrate

Cross platform deployment orchestration to existing managed servers using vagrant provisioners
Other
19 stars 13 forks source link

Unable to retrieve deployment status of Windows (with cygwin) #29

Closed rnowosielski closed 9 years ago

rnowosielski commented 9 years ago

When trying to use the plugin on Windows 7 with cygwin the command

vagrant orchestrate status returns error.

==> : Error downloading status for devwtrmibivb001.vistaprint.svc. ==> : SCP did not finish successfully (1)

vagrant orchestrate push works correctly though. Both machines have scp available in the path.

Below is the log from running the command with --debug

D, [2015-05-22T19:59:34.386793 #7888] DEBUG -- net.ssh.transport.algorithms[1468f08]: exchanging keys
D, [2015-05-22T19:59:34.386793 #7888] DEBUG -- tcpsocket[1430c34]: queueing packet nr 1 type 34 len 20
D, [2015-05-22T19:59:34.386793 #7888] DEBUG -- tcpsocket[1430c34]: sent 24 bytes
D, [2015-05-22T19:59:34.396795 #7888] DEBUG -- tcpsocket[1430c34]: read 152 bytes
D, [2015-05-22T19:59:34.396795 #7888] DEBUG -- tcpsocket[1430c34]: received packet nr 1 type 31 len 148
D, [2015-05-22T19:59:34.399296 #7888] DEBUG -- tcpsocket[1430c34]: queueing packet nr 2 type 32 len 140
D, [2015-05-22T19:59:34.399296 #7888] DEBUG -- tcpsocket[1430c34]: sent 144 bytes
D, [2015-05-22T19:59:34.409298 #7888] DEBUG -- tcpsocket[1430c34]: read 720 bytes
D, [2015-05-22T19:59:34.409298 #7888] DEBUG -- tcpsocket[1430c34]: received packet nr 2 type 33 len 700
D, [2015-05-22T19:59:34.411798 #7888] DEBUG -- tcpsocket[1430c34]: queueing packet nr 3 type 21 len 20
D, [2015-05-22T19:59:34.411798 #7888] DEBUG -- tcpsocket[1430c34]: sent 24 bytes
D, [2015-05-22T19:59:34.411798 #7888] DEBUG -- tcpsocket[1430c34]: received packet nr 3 type 21 len 12
D, [2015-05-22T19:59:34.412298 #7888] DEBUG -- net.ssh.authentication.session[1b754d4]: beginning authentication of `vagrant'
D, [2015-05-22T19:59:34.412298 #7888] DEBUG -- tcpsocket[1430c34]: queueing packet nr 4 type 5 len 28
D, [2015-05-22T19:59:34.412298 #7888] DEBUG -- tcpsocket[1430c34]: sent 52 bytes
D, [2015-05-22T19:59:34.462308 #7888] DEBUG -- tcpsocket[1430c34]: read 52 bytes
D, [2015-05-22T19:59:34.462308 #7888] DEBUG -- tcpsocket[1430c34]: received packet nr 4 type 6 len 28
D, [2015-05-22T19:59:34.462808 #7888] DEBUG -- net.ssh.authentication.session[1b754d4]: trying none
D, [2015-05-22T19:59:34.463309 #7888] DEBUG -- tcpsocket[1430c34]: queueing packet nr 5 type 50 len 44
D, [2015-05-22T19:59:34.463309 #7888] DEBUG -- tcpsocket[1430c34]: sent 68 bytes
D, [2015-05-22T19:59:34.473311 #7888] DEBUG -- tcpsocket[1430c34]: read 116 bytes
D, [2015-05-22T19:59:34.473311 #7888] DEBUG -- tcpsocket[1430c34]: received packet nr 5 type 51 len 92
D, [2015-05-22T19:59:34.473811 #7888] DEBUG -- net.ssh.authentication.session[1b754d4]: allowed methods: publickey,gssapi-keyex,gssapi-with-mic,password,keyboard-interactive
D, [2015-05-22T19:59:34.473811 #7888] DEBUG -- net.ssh.authentication.methods.none[1bc1488]: none failed
D, [2015-05-22T19:59:34.473811 #7888] DEBUG -- net.ssh.authentication.session[1b754d4]: trying publickey
D, [2015-05-22T19:59:34.475311 #7888] DEBUG -- net.ssh.authentication.agent[1d1b898]: connecting to ssh-agent
E, [2015-05-22T19:59:34.475811 #7888] ERROR -- net.ssh.authentication.agent[1d1b898]: could not connect to ssh-agent
D, [2015-05-22T19:59:34.475811 #7888] DEBUG -- net.ssh.authentication.methods.publickey[1d1bd60]: trying publickey (0b:46:22:...:e5:97:3d:ca)
D, [2015-05-22T19:59:34.476311 #7888] DEBUG -- tcpsocket[1430c34]: queueing packet nr 6 type 50 len 348
D, [2015-05-22T19:59:34.476311 #7888] DEBUG -- tcpsocket[1430c34]: sent 372 bytes
D, [2015-05-22T19:59:34.496815 #7888] DEBUG -- tcpsocket[1430c34]: read 324 bytes
D, [2015-05-22T19:59:34.496815 #7888] DEBUG -- tcpsocket[1430c34]: received packet nr 6 type 60 len 300
D, [2015-05-22T19:59:34.513819 #7888] DEBUG -- tcpsocket[1430c34]: queueing packet nr 7 type 50 len 620
D, [2015-05-22T19:59:34.514319 #7888] DEBUG -- tcpsocket[1430c34]: sent 644 bytes
D, [2015-05-22T19:59:34.534323 #7888] DEBUG -- tcpsocket[1430c34]: read 36 bytes
D, [2015-05-22T19:59:34.535323 #7888] DEBUG -- tcpsocket[1430c34]: received packet nr 7 type 52 len 12
D, [2015-05-22T19:59:34.535323 #7888] DEBUG -- net.ssh.authentication.methods.publickey[1d1bd60]: publickey succeeded (0b:46:22:1f:8c...:e5:97:3d:ca)

DEBUG ssh: == Net-SSH connection debug-level log END ==
DEBUG ssh: Checking whether SSH is ready...
DEBUG ssh: Re-using SSH connection.
 INFO ssh: SSH is ready!
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute:  (sudo=false)
DEBUG ssh: Exit status: 0
DEBUG print_status: Downloading orchestrate status for <HOSTNAME>
DEBUG print_status:   remote file: /var/state/vagrant_orchestrate/
DEBUG print_status:   local file: C:/Users/rnowosielski/.vagrant.d/tmp/<HOSTNAME>_status
DEBUG ssh: Downloading: /var/state/vagrant_orchestrate/ to C:/Users/rnowosielski/.vagrant.d/tmp/<HOSTNAME>_status
DEBUG ssh: Re-using SSH connection.
 INFO interface: warn: Error downloading status for <HOSTNAME>.
 INFO interface: warn: ==> <HOSTNAME>: Error downloading status for <HOSTNAME>.
==> <HOSTNAME>: Error downloading status for <HOSTNAME>.
 INFO interface: warn: SCP did not finish successfully (1)
 INFO interface: warn: ==> <HOSTNAME>: SCP did not finish successfully (1)
==> <HOSTNAME>: SCP did not finish successfully (1)
 INFO warden: Calling OUT action: #<VagrantPlugins::ManagedServers::Action::DownloadStatus:0x3781e00>
 INFO warden: Calling OUT action: #<Vagrant::Action::Builtin::ConfigValidate:0x3781e90>
 INFO environment: Released process lock: machine-action-8bde540641ed8443265b4d0ac572b28f
DEBUG environment: Attempting to acquire process-lock: dotlock
 INFO environment: Acquired process lock: dotlock
 INFO environment: Released process lock: dotlock
 INFO interface: info: Current managed server states:
Current managed server states:
 INFO interface: info:

 INFO interface: info: <HOSTNAME>   Status unavailable.
<HOSTNAME>   Status unavailable.
 INFO environment: Running hook: environment_unload
 INFO runner: Preparing hooks for middleware sequence...
 INFO runner: 2 hooks defined.
chrisbaldauf commented 9 years ago

Thanks for the bug report @rnowosielski!

I think a bit more information about your environment would be helpful in reproducing / diagnosing.

Host

vagrant version
vagrant plugin list

Guest

  1. What OS / version are you running on the remote machine?
  2. Is there a directory at /var/state/vagrant_orchestrate/? Does it contain any files?
  3. If yes, to 2, what are the file permissions?

I'd be interested to see if you could list the file from the host machine with vagrant ssh <HOSTNAME> -c "ls /var/state/vagrant_orchestrate/"

Are you running from a git repository? Are you running from the root of the repo? See https://github.com/Cimpress-MCP/vagrant-orchestrate/blob/master/lib/vagrant-orchestrate/repo_status.rb#L24 for a bit more searching you might be able to do.

Thanks!

rnowosielski commented 9 years ago

Host: $ vagrant version Installed Version: 1.7.2 Latest Version: 1.7.2

$ vagrant plugin list vagrant-hostmanager (1.5.0) vagrant-hostsupdater (0.0.11) vagrant-librarian-puppet (0.9.0) vagrant-managed-servers (0.6.2) vagrant-orchestrate (0.6.0) vagrant-share (1.1.3, system) vagrant-winrm-s (0.0.2)

Guest: $ uname -a Linux 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

$ ls -ls /var/state/vagrant_orchestrate/ total 4 4 -rwxrwxrwx 1 vagrant vagrant 236 May 22 14:28 ivbcore

I'm running from the root of my repo, that has been checked out from git repository.

chrisbaldauf commented 9 years ago

It looks like it is trying to download a directory, and not the file specific to the ivbcore repository

DEBUG print_status:   remote file: /var/state/vagrant_orchestrate/
DEBUG print_status:   local file: C:/Users/rnowosielski/.vagrant.d/tmp/<HOSTNAME>_status
DEBUG ssh: Downloading: /var/state/vagrant_orchestrate/ to C:/Users/rnowosielski/.vagrant.d/tmp/<HOSTNAME>_status

Can you run this command from the root of your repo, please?

git config --get remote.origin.url

I'm trying to find out whether it doesn't know about your git repo or if there is something cross-wired.

https://github.com/Cimpress-MCP/vagrant-orchestrate/blob/master/lib/vagrant-orchestrate/repo_status.rb#L63

rnowosielski commented 9 years ago

I get no output:

E:\workspace\ivbcore>git config --get remote.origin.url

E:\workspace\ivbcore>

... and that made me realise, that I don't have a remote called origin I am working on a repository that has 2 different remotes, and none of them is called origin

chrisbaldauf commented 9 years ago

That'll do it, the software currently naively assumes that there is an origin remote and that parsing the URL of that will produce the repository name. I don't think that is a good requirement. Would you be willing to run the following from the root of your git repo to ensure that it prints the repository name correctly?

> irb

irb(main):001:0> File.basename(`git rev-parse --show-toplevel`)

I would expect something like `=> "ivbcore\n""

Thanks!

On Sun, May 24, 2015 at 9:50 AM, Rafal Nowosielski <notifications@github.com

wrote:

I get no output:

E:\workspace\ivbcore>git config --get remote.origin.url

E:\workspace\ivbcore>

... and that made me realise, that I don't have a remote called origin I am working on a repository that has 2 different remotes, and none of them is called origin

— Reply to this email directly or view it on GitHub https://github.com/Cimpress-MCP/vagrant-orchestrate/issues/29#issuecomment-105019196 .

rnowosielski commented 9 years ago
E:\workspace\ivbcore>irb
irb(main):001:0> File.basename(`git rev-parse --show-toplevel`)
=> "ivbcore\n"
irb(main):002:0>
chrisbaldauf commented 9 years ago

Released version 0.6.2 to correct this issue. Please let me know if it doesn't work.