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

[5.x] Deploy doesn't continue the first time #1192

Closed
barryvdh opened this issue May 1, 2017 · 26 comments
Closed

[5.x] Deploy doesn't continue the first time #1192

barryvdh opened this issue May 1, 2017 · 26 comments
Labels

Comments

@barryvdh
Copy link
Contributor

barryvdh commented May 1, 2017

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..

@antonmedv
Copy link
Member

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

@antonmedv antonmedv added the bug label May 2, 2017
@barryvdh
Copy link
Contributor Author

barryvdh commented May 2, 2017

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

@antonmedv
Copy link
Member

Really strange. I can't reproduce it.

@barryvdh
Copy link
Contributor Author

barryvdh commented May 3, 2017

I think this might be related to issues with #1187 only being swallowed.

@barryvdh barryvdh closed this as completed May 3, 2017
@barryvdh barryvdh reopened this May 8, 2017
@barryvdh
Copy link
Contributor Author

barryvdh commented May 8, 2017

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?

@antonmedv
Copy link
Member

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

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

@barryvdh
Copy link
Contributor Author

barryvdh commented May 8, 2017

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

@barryvdh
Copy link
Contributor Author

barryvdh commented May 8, 2017

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)

@barryvdh
Copy link
Contributor Author

barryvdh commented May 8, 2017

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

@antonmedv
Copy link
Member

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

Also check it with ssh agent is running.

@barryvdh
Copy link
Contributor Author

barryvdh commented May 8, 2017

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)

@barryvdh
Copy link
Contributor Author

barryvdh commented May 8, 2017

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

@antonmedv
Copy link
Member

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

@barryvdh
Copy link
Contributor Author

barryvdh commented May 9, 2017

With ssh-agent it still stalls; https://gist.github.com/barryvdh/98d18405a19802f50e65921cd83e451f

@antonmedv
Copy link
Member

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

@barryvdh
Copy link
Contributor Author

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

@barryvdh
Copy link
Contributor Author

Same issue when running from source :(

@barryvdh barryvdh changed the title Deploy doesn't continue unless verbose mode [5.x] Deploy doesn't continue the first time May 15, 2017
@barryvdh
Copy link
Contributor Author

FYI, same behavior with the final 5.0.0

@antonmedv
Copy link
Member

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

@barryvdh
Copy link
Contributor Author

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

@harisenbon
Copy link

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

@antonmedv
Copy link
Member

@harisenbon can i try to debug it through teamviewerr?

@harisenbon
Copy link

@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?

@barryvdh
Copy link
Contributor Author

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.

@barryvdh
Copy link
Contributor Author

Okay, what do you think of #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

@antonmedv
Copy link
Member

Merged. Thanks for solution.

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

No branches or pull requests

3 participants