dotcloud push on cygwin fails with "rsync error: unexplained error (code 255)" (similar with git and hg)

Andy picture Andy · Jun 6, 2013 · Viewed 9.3k times · Source

Though I have followed the usual steps for using the dotCloud CLI under Cygwin, dotcloud push fails in all cases: --rsync, --hg, and --git.

I am on Windows 8 and Cygwin.

How can I push successfully?

Sample output:

me@host /cygdrive/d/project 
$ dotcloud push --rsync 
==> Pushing code with rsync from "./" to application myapp 
rsync: connection unexpectedly closed (0 bytes received so far) [sender] 
rsync error: unexplained error (code 255) at /home/lapo/package/rsync-3.0.9-1/src/rsync-3.0.9/io.c(605) [sender=3.0.9]

me@host /cygdrive/d/project 
$ dotcloud push --git 
Permission denied (publickey,password).r from "./" to application myapp 
fatal: The remote end hung up unexpectedly

me@host /cygdrive/d/project 
$ dotcloud push --hg 
==> Pushing code with mercurial from "./" to application myapp 
abort: no suitable response from remote hg! 
Error: Mercurial returned a fatal error

Answer

Andy picture Andy · Jun 6, 2013

You may be running into a bug in Cygwin's group permissions. Vineet Gupta gives a workaround in his blog. The problem comes from the very strict permissions expected by ssh around the keys, and the solution is to set the permission on the ssh key properly (to 600, rw by owner only). Cygwin seems to need the group to be added manually.

Updating the steps to get the dotCloud CLI installed, including setting the permissions, leads to:

  1. Start the Cygwin Setup.
  2. Select default choices until you reach the package selection dialog.
  3. Enable the following packages:

    • net/openssh
    • net/rsync
    • devel/git
    • devel/mercurial
    • python/python (make sure it’s at least 2.6!)
    • web/wget
  4. After the installation, you should have a Cygwin icon on your desktop. Start it: you will get a command-line shell.

  5. Download easy_install

    wget http://peak.telecommunity.com/dist/ez_setup.py
    
  6. Install easy_install

    python ez_setup.py
    
  7. You now have easy_install; let’s use it to install pip:

    easy_install pip
    
  8. Now install dotcloud (the CLI)

    pip install dotcloud
    
  9. Set up the CLI with your credentials. This will also download the ssh key.

    dotcloud setup
    
  10. New Step Update the permissions on your dotCloud key:

    chgrp Users ~/.dotcloud_cli/dotcloud.key
    chmod 600 ~/.dotcloud_cli/dotcloud.key
    

Now you should be able to dotcloud push If you have multiple dotCloud accounts, then you will need to repeat this process for each account, since each account has its own key. Also note that you shouldn't have to set these permissions manually, but it seems like the group ownership is sometimes the wrong default in Cygwin. Linux and OSX don't seem to show this problem, though the permissions must be 600 for all OSes, so it is worth checking.