Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First deploy to a server fails if repo is not included to the list of known hosts #90

Closed
killthekitten opened this issue Jan 30, 2013 · 16 comments

Comments

@killthekitten
Copy link

That happens pretty often, so I want to know, can we automate this.

  1. I get access to a server with ruby and a ~/projects/project_name folder.
  2. I try to deploy with an already tuned mina config.
me@my_mac ~/dev/project_name[master*]$ mina deploy
-----> Creating a temporary build path
-----> Cloning the Git repository
       Cloning into bare repository /home/hosting/projects/project_name/scm...
       Host key verification failed.
       fatal: The remote end hung up unexpectedly
 !     ERROR: Deploy failed.
-----> Cleaning up build
       Unlinking current
       OK

 !     Command failed.
       Failed with status 19

As you can see, deploy fails with Host key verification failed.
3. My fast workaround is ssh to a server, and git clone to get a prompt and add repo to the known hosts list.

hosting@fluorine:~/projects/project_name/current$ git clone [email protected]:killthekitten/project_name.git
Cloning into project_name...
The authenticity of host 'github.com (207.97.227.239)' can't be established.
RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'github.com,207.97.227.239' (RSA) to the list of known hosts.
remote: Counting objects: 1945, done.
remote: Compressing objects: 100% (941/941), done.
remote: Total 1945 (delta 1040), reused 1862 (delta 958)
Receiving objects: 100% (1945/1945), 5.47 MiB | 977 KiB/s, done.
Resolving deltas: 100% (1040/1040), done.

Can we delegate this Are you sure you want to continue connecting (yes/no)? yes prompt to a second described step instead of third?

@rstacruz
Copy link
Member

Can you try using a latest version of mina in Git? (gem 'mina', github: 'nadarei/mina' in your Gemfile, then bundle update, then bundle exec mina ...) I kind of recall making code to ensure that prompts such as this get passed thru to your terminal, allow you to enter text (like 'yes').

@killthekitten
Copy link
Author

@rstacruz thank you, when I use master, it is working like a charm 👍

@killthekitten
Copy link
Author

@rstacruz btw, why did you stop publish gem releases? I see loads of new features in issue tracker every week.

@beirigo
Copy link
Contributor

beirigo commented Jan 30, 2013

Hello @rstacruz,
Just out of curiosity, do you plan to bundle a new version of the gem anytime soon?

@dariocravero
Copy link
Contributor

👍 on a new release :)

@Gurpartap
Copy link

New release++

@killthekitten
Copy link
Author

👍

@mikong
Copy link
Member

mikong commented Jul 10, 2013

New release coming soon (#122).

@mikong mikong closed this as completed Jul 10, 2013
@phuongnd08
Copy link

Still ran into this today. mina 0.3.0:

   Host key verification failed.
       fatal: The remote end hung up unexpectedly
 !     ERROR: Deploy failed.

I then need to go to the server and do: git clone ssh://git@...
and answer Are you sure you want to continue connecting (yes/no)? with a yes.

@jerefrer
Copy link

+1. Still stuck at:

jeremy@jeremy-VirtualBox ~/RailsProjects/garden $ mina setup
The authenticity of host 'XXXXXX (XXX.XXX.XXX.XXX)' can't be established.
RSA key fingerprint is something.
Are you sure you want to continue connecting (yes/no)? yes

Even when using nadarei/mina latest @ github.

@rahul-meher
Copy link

Hi Stuck at this.

mina deploy --trace
    ** Invoke deploy (first_time)
    ** Invoke environment (first_time)
** Execute environment
** Execute deploy
** Invoke git:clone (first_time)
** Execute git:clone
** Invoke deploy:link_shared_paths (first_time)
** Execute deploy:link_shared_paths
** Invoke bundle:install (first_time)
** Execute bundle:install
** Invoke rails:db_migrate (first_time)
** Execute rails:db_migrate
** Invoke rails:assets_precompile (first_time)
** Execute rails:assets_precompile

-----> Creating a temporary build path
       $ touch "d       bash: line 53: git: command not founde
       $ touch "deploy.lock"
       $ mkdir -p "$build_path"
       $ cd "$build_path"

-----> Cloning the Git repository
       $ git clone "[email protected]:rahul-meher/demo.git" "/home/adsudxuy/apps/scm" --bare
 !     ERROR: Deploy failed.

-----> Cleaning up build
       $ rm -rf "$build_path"
       Unlinking current
       $ rm -f "deploy.lock"
       OK

 !     Command failed.
       Failed with status 19

@phuongnd08
Copy link

@rahul-meher You need to install git to your server first. The error is obvious: git: command not found

@tony612
Copy link

tony612 commented Jul 18, 2014

Is there any solution to solve this now?

@phuongnd08
Copy link

I haven't tried other solution but executing this on your server before invoking mina: ssh-keyscan -H github.com >> ~/.ssh/known_hosts will eliminate the problem. If you use a provision tool you can have the tool execute it for you.

@tony612
Copy link

tony612 commented Jul 18, 2014

@phuongnd08 It works, thanks very much 👍

@Zhomart
Copy link
Contributor

Zhomart commented Sep 27, 2014

These also work $ ssh [email protected] or $ ssh [email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests