Deployer: [5.x] Deploy doesn't continue the first time

Created on 1 May 2017  Â·  26Comments  Â·  Source: deployphp/deployer

| Q | A
| ----------------- | ---
| Issue Type | Bug
| Deployer Version | 5.0-beta2
| Local Machine OS | CentOS
| Remote Machine OS | Ubuntu

Description

When starting deployment, it asks for my passprase but does not seem to continue. When doing -vvv it continues to deploy:lock within 1 second.

Not sure how to debug this properly, because -vvv does work..

bug

All 26 comments

I think it asking you password, but without prompt. Can you try to type your password?

It seemed to take a long time and then ask for a password again and again
screen shot 2017-05-02 at 09 43 40

For some reason, after a few tries it DID started working, so not sure what is actually causing it. But I've had if for a few times, where running -vvv fixed it immediatly

Really strange. I can't reproduce it.

I think this might be related to issues with https://github.com/deployphp/deployer/issues/1187 only being swallowed.

Still having a hard time debugging this, it seems to stall on the first try, but killing it and restarting, seems to do the trick. I don't have ssh-agent running so perhaps it doesn't work when asking the passphrase?

It should work with passphrase as well. Tested by myself many times. Please, debug with this:

host(...)
    ->addSshFlag('-vvvv')

It seems to hang for a while and then ask for a passphrase in the background. After that it fails. (Running again doesn't ask for passphrase and runs correctly)

Log from -vvvv (note that running the second time with this flag also doesn't seem to work):
https://gist.github.com/barryvdh/3276182067403275cfc33ee70a342be5

This is without that flag, but with -vvv;

First time, hangs here

Executing task deploy:prepare
[95.85.xx.xx] > echo $0
[95.85.xx.xx] < ssh multiplexing initialization
Enter passphrase for key '/home/projects/.ssh/id_rsa':
[95.85.xx.xx] < bash
(doesn't continue)

Right after again:

➤ Executing task deploy:prepare
[95.85.xx.xx] > echo $0
[95.85.xx.xx] < bash
[95.85.xx.xx] > if [ ! -d /home/forge/default ]; then mkdir -p /home/forge/default; fi
(continues like expected)

So it looks the 2nd attempt uses the multiplex from the first attempt correctly. Only the first attempt itself can't.

This works correctly? Enter passphrase for key '/home/projects/.ssh/id_rsa':

Also check it with ssh agent is running.

Entering the key works indeed. When I disable multiplexing, it asks the passphrase for each command though (so like 8 times for prepare).

➤ Executing task deploy:prepare
Enter passphrase for key '/home/projects/.ssh/id_rsa': 
Enter passphrase for key '/home/projects/.ssh/id_rsa': 
Enter passphrase for key '/home/projects/.ssh/id_rsa': 
Enter passphrase for key '/home/projects/.ssh/id_rsa': 
Enter passphrase for key '/home/projects/.ssh/id_rsa': 
✔nter passphrase for key '/home/projects/.ssh/id_rsa': 
➤ Executing task deploy:release
Enter passphrase for key '/home/projects/.ssh/id_rsa': 

Will try with ssh-agent in a few minutes (can't try now because it works soon after)

With ssh-agent, same issue only it doesn't ask for passphrase.

It should not ask passphrase with ssh agent. That's agent for. =)

Please, check master branch. I think i fixed it 😄 7c312bfe82e11745e1be082f586b92927f88dedc

Do you happen to have a .phar? (Might be cool to have automatic/nightly phars?)

Same issue when running from source :(

FYI, same behavior with the final 5.0.0

Can't reproduce. Can you give me remote access to your machine to debug?

Not easily. I'll see if I can reproduce on different systems. Currently using Centos 6.6

I'm having the same issue.
I thought that it was freezing, but it actually seems to just be taking a long time to run.
I left the process running in the background, and about 10 minutes later deploy:prepare completed.

When using -vv or -vvv flags, tasks run at a reasonable pace.

Have tried this with both the latest phar as well as composer.
Running on MacOSX with PHP 7.0.18

@harisenbon can i try to debug it through teamviewerr?

@antonmedv how about a zoom call? I can give you access with that and we can walk through it.
What's the best way to send you an invite?

I increased the sleep(1) to sleep(10), which gives me the time to enter the passphrase.

What is happening is this:

  • Starting process ssh -M $sshArguments $host without waiting for response
  • sleep is called, waiting
  • continue with program

When the popup comes for the passphrase, this takes more then 1 second, so the order becomes this:

  • Starting process
  • Passphrase is asked
  • sleep starts
  • sleep ends
  • continue with program
  • passphrase is entered, multiplex is initialized (too late)

Next time, it still used the multiplex from the first try.

Okay, what do you think of https://github.com/deployphp/deployer/pull/1220

I used the first check after the multiplexing command. If it's still not running, keep trying for 60 secs, the throw an exception. This seems to work for me. When you don't pay attention, it will show a more clear error after 60 secs, but otherwise it will continue after max 1 sec after the password

Merged. Thanks for solution.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

antonmedv picture antonmedv  Â·  5Comments

dima-stefantsov picture dima-stefantsov  Â·  5Comments

lsv picture lsv  Â·  4Comments

dima-stefantsov picture dima-stefantsov  Â·  4Comments

brunodevel picture brunodevel  Â·  3Comments