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

Connection refused errors sometimes #9

Closed
eugenekainara opened this issue Jun 11, 2019 · 8 comments
Closed

Connection refused errors sometimes #9

eugenekainara opened this issue Jun 11, 2019 · 8 comments

Comments

@eugenekainara
Copy link

eugenekainara commented Jun 11, 2019

Hello!

I'm using your plugin and expect to see "connection refused" or "unexpected EOF" sometimes. It means that it can be 5 successful executions and then 1 or two failed, or it can fails for 5 times and than 1 have passed.

It also reproduced for both local and CI server.
How should I debug following behaviour to provide you with needed info?
I'm using terraform 0.11.14 & provider ssh 0.0.3(but it also related to 0.0.2)
I'm using ssh provider to get my EKS-cluster through bastion instance.

Log from CI - ci-log.txt

@stefansundin
Copy link
Owner

stefansundin commented Jun 12, 2019

Hello!

Thanks for the log file, it is very useful to understand what is happening.

Perhaps we shouldn't panic when connections are having problems.. perhaps it makes more sense to just log and ignore it..

Do you want me to help you try out different builds? If you are able to compile it yourself, then I would try commenting out the panic() calls here:

// Send traffic from the SSH server -> local program
go func() {
_, err = io.Copy(sshConn, localConn)
if err != nil {
panic(err)
}
}()
// Send traffic from the local program -> SSH server
go func() {
_, err = io.Copy(localConn, sshConn)
if err != nil {
panic(err)
}
}()

If you want me to compile for you, please let me know what OS you are running.

If that makes everything more stable, then I will make a new release where I just log warnings instead of panic. Similar to this: https://gist.github.com/codref/473351a24a3ef90162cf10857fac0ff3#file-go-ssh-reverse-tunnel-go-L48-L63

Thanks for the report!

@eugenekainara
Copy link
Author

Oh, thanks! I'm able to compile binary for both Linux and Mac OS to check is proposed solution is helpful and stable.

@eugenekainara
Copy link
Author

Seems that proposed solution helps. I've run 5 time locally and on CI server - and no errors occurred.
I've think we should wait few days so check for stability of solution. I'll come back on next week with updates.

Thanks a lot!

@stefansundin
Copy link
Owner

Perfect! Glad to hear it seems promising.

@stefansundin
Copy link
Owner

I added this commit: 9dfc266

It would be great if you could pull my code and make sure it works well. Thanks!

@eugenekainara
Copy link
Author

I've built today new binary and use it on my CI server few times - it also works w/o any issues as for now.

@eugenekainara
Copy link
Author

It fails one time at CI server with following - terraform-provider-ssh.log

@stefansundin
Copy link
Owner

Interesting.. doesn't seem like the same problem though..

In any case, I just released v0.0.4.

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

2 participants