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

Fixed wrong agent forwarding implementation (fixes #393) #428

Merged
merged 1 commit into from
Aug 14, 2015

Conversation

dbalabka
Copy link
Contributor

No description provided.

oanhnn pushed a commit that referenced this pull request Aug 14, 2015
Fixed wrong agent forwarding implementation (fixes #393)
@oanhnn oanhnn merged commit 50b5070 into deployphp:master Aug 14, 2015
@oanhnn
Copy link
Contributor

oanhnn commented Aug 14, 2015

Thank you! 👍

@vanquang9387
Copy link
Contributor

👍

@AlexStansfield
Copy link
Contributor

The new phpseclib has broken git clones for me. I'm using pemfiles for auth.

Everything was fine with deployer/phpseclib:1.0.0 but now git clone produces empty directory.

I switched to 3.0.7 and downgraded phpseclib back to 1.0.0 and everything works fine again.

@dbalabka
Copy link
Contributor Author

@AlexStansfield I will look at this problem ASAP. I guess problem is in phpseclib because of BC breaks. It's a pity that there are no test for this case in deployer.

@AlexStansfield
Copy link
Contributor

@torinaki thanks. I'm not sure what's going on I even built a version that didn't suppress git messages to see if it was at least giving me some useful output. Absolutely nothing. I'd imagine there are some pretty big changes between phpseclib 1.0.0 and 2.0.0 and something there has really messed things up for me.

@dbalabka
Copy link
Contributor Author

@AlexStansfield I can say, that deployer already have used 2.0.0 version of phpseclib. The the tag v1.0.0 was created in deployphp/phpseclib incorrecly. So my changes was only updated the 2.0 version till lastes minor version
After quick investigation I have found that your issue may be related to timeout. Can you please tell me are you using timeout in your deployment task, and what value of timeout your are using?

@AlexStansfield
Copy link
Contributor

@torinaki actually v1.0.0 fork on deployer is from february 22nd. There have been many changes in phpseclib since then.

https://github.com/deployphp/phpseclib/commits/v1.0.0
https://github.com/phpseclib/phpseclib/commits/master?page=9

@AlexStansfield
Copy link
Contributor

As for timeout. it consistently fails with v2.0.0 from phpspeclib and consistently works with v1.0.0 from deployer. And it only takes about 5 seconds to do the git clone. I'm not setting any timeout myself.

Also it's not the clone that causes the deployer to fail. It's not until it tries to create a symlink to a shared file in a directory that doesn't exist (as it wasn't cloned by git) that an error is triggered.

@dbalabka
Copy link
Contributor Author

@AlexStansfield is this reproduceble with this fix:
176ca98
Please try with a latest deployer.
If it will still exists I will prepare PR to rollback phpseclib

Actual changes here:
phpseclib/phpseclib@b061cba...2.0
Yes, I know there are a lot changes, but in actual for deployer classes(RSA and SSH2) there are not so many.

@AlexStansfield
Copy link
Contributor

Sorry I had left work.

That fix breaks it more. When trying to connect to the server I get:

PHP Notice: Cannot connect to stage.ourserver.com:22. Error 60. Operation timed out in phar:///Users/alex/Dev/Source/deployer/deployer.phar/vendor/phpseclib/phpseclib/phpseclib/Net/SSH2.php on line 1011

But replacing the timeout with with a high enough number (3600) did the trick.

Thanks

@antonmedv
Copy link
Member

@AlexStansfield does it work now with 3.0.8?

@AlexStansfield
Copy link
Contributor

@Elfet no, same error as mentioned above. I have to replace PHP_INT_MAX with something less huge.

I mentioned it on #429

@dbalabka
Copy link
Contributor Author

Really strange, because exactly same error I have notice when timeout was 0. @AlexStansfield how and where did you change that timeout? What PHP version you use?
Anyway 3600=1h timeout should be enough for most tasks, so if this fix your issue we can change it. I guess it may be related to fsockopen somehow.
Sorry, but please twice-check your version of deployer, to be sure that you are using right version.

@AlexStansfield
Copy link
Contributor

I took the 3.0.7 source and added PHP_INT_MAX as you suggested, it gave me that error. I then downloaded the 3.0.8 phar file and tried with no modifications and it gave me that error.

Alexs-MBP:~ alex$ php --version
PHP 5.5.26 (cli) (built: Jun 12 2015 08:17:31) 
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies
    with Xdebug v2.3.3, Copyright (c) 2002-2015, by Derick Rethans

@dbalabka
Copy link
Contributor Author

@AlexStansfield please upgrade till latest version 3.0.9. Fix already in master

@AlexStansfield
Copy link
Contributor

Yep that fixed it, cheers

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

Successfully merging this pull request may close these issues.

5 participants