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

Message of "Waiting for localhost 22" does not stop. #24

Closed
inokappa opened this Issue Nov 23, 2013 · 27 comments

Comments

Projects
None yet
6 participants
@inokappa

inokappa commented Nov 23, 2013

When I execute the "kitchen create": message of "Waiting for localhost 22" does not stop.I discovered that the port number of the container is not known to test-kitchen-1.0.0.beta.4/lib/kitchen/ssh.rb.

I wonder if it happens around only me.
Please confirm following.

My Environment

  • Ubuntu 13.10
  • lxc-docker-0.6.7
  • kitchen-docker 0.10.0
  • test-kitchen 1.0.0.beta.4

My .kitchen.yml


---
driver_plugin: docker
driver_config:
  require_chef_omnibus: true

platforms:
- name: ubuntu-12.04
  driver_config:
    username: kitchen
    password: kitchen

suites:
- name: default
  run_list: ["recipe[cookbook]"]
  attributes: {}

Step

following execute steps

sudo bundle exec kitchen create

Waiting for localhost:22... does not stop

       }]
       [kitchen::driver::docker command] END (0m0.02s)
       Waiting for localhost:22...
       Waiting for localhost:22...

To Press Ctrl + C stop.

container status

CONTAINER ID        IMAGE               COMMAND                CREATED              STATUS              PORTS                   NAMES
348afb81f484        8648dff97a96        /usr/sbin/sshd -D -o   About a minute ago   Up About a minute   0.0.0.0:49190->22/tcp   slate_fish
@portertech

This comment has been minimized.

Show comment
Hide comment
@portertech

portertech Nov 23, 2013

Contributor

I'll test w/ Docker 0.6.7, since it is new.

Contributor

portertech commented Nov 23, 2013

I'll test w/ Docker 0.6.7, since it is new.

@inokappa

This comment has been minimized.

Show comment
Hide comment
@inokappa

inokappa Nov 23, 2013

Thank you for reply;-)

inokappa commented Nov 23, 2013

Thank you for reply;-)

@inokappa

This comment has been minimized.

Show comment
Hide comment
@inokappa

inokappa Nov 23, 2013

After you modify the following files:
I was confirmed that "kitche destroy" and "kitchen create" was successful.

kitchen-docker-0.10.0/lib/kitchen/driver/docker.rb
https://gist.github.com/inokappa/7610363

test-kitchen-1.0.0.beta.4/lib/kitchen/ssh.rb
https://gist.github.com/inokappa/7610347

test-kitchen-1.0.0.beta.4/lib/kitchen/driver/ssh_base.rb
https://gist.github.com/inokappa/7610359

but "kitchen verify" does not work.

inokappa commented Nov 23, 2013

After you modify the following files:
I was confirmed that "kitche destroy" and "kitchen create" was successful.

kitchen-docker-0.10.0/lib/kitchen/driver/docker.rb
https://gist.github.com/inokappa/7610363

test-kitchen-1.0.0.beta.4/lib/kitchen/ssh.rb
https://gist.github.com/inokappa/7610347

test-kitchen-1.0.0.beta.4/lib/kitchen/driver/ssh_base.rb
https://gist.github.com/inokappa/7610359

but "kitchen verify" does not work.

@inokappa

This comment has been minimized.

Show comment
Hide comment
@inokappa

inokappa Nov 23, 2013

I was confirmed for the following.

  • wait_for_sshd in test-kitchen-1.0.0.beta.4/lib/kitchen/driver/ssh_base.rb does not identify "port" argument.
  • I think it will be required modify also "test-kitchen".
  • It works(ex : kitchen create , kitchen verify , kitchen converge ...) only when do not call the "wait_for_sshd" in "docker.rb".

Please confirm pull request, I tried to disable the "wait_for_sshd" for the time being.

inokappa commented Nov 23, 2013

I was confirmed for the following.

  • wait_for_sshd in test-kitchen-1.0.0.beta.4/lib/kitchen/driver/ssh_base.rb does not identify "port" argument.
  • I think it will be required modify also "test-kitchen".
  • It works(ex : kitchen create , kitchen verify , kitchen converge ...) only when do not call the "wait_for_sshd" in "docker.rb".

Please confirm pull request, I tried to disable the "wait_for_sshd" for the time being.

@portertech

This comment has been minimized.

Show comment
Hide comment
@portertech

portertech Nov 24, 2013

Contributor

Your container status shows that host port 49190 is being forwarded to container port 22. wait_for_sshd should be hitting localhost 49190, but Docker isn't returning info the driver expects, so the method is returning nil, causing test-kitchen to use the default 22. I'll install Docker 0.6.7 and hit the API to inspect the result.

Contributor

portertech commented Nov 24, 2013

Your container status shows that host port 49190 is being forwarded to container port 22. wait_for_sshd should be hitting localhost 49190, but Docker isn't returning info the driver expects, so the method is returning nil, causing test-kitchen to use the default 22. I'll install Docker 0.6.7 and hit the API to inspect the result.

@inokappa

This comment has been minimized.

Show comment
Hide comment
@inokappa

inokappa Nov 24, 2013

Thank you for your reply.

I can understand your explanation.

Please confirm following.

The Result of my "docker inspect" ; https://gist.github.com/inokappa/7625180

I modified it as the following method, and then it is woking now.
inokappa@003e80f

I'm looking for your reply.
Thank you.

inokappa commented Nov 24, 2013

Thank you for your reply.

I can understand your explanation.

Please confirm following.

The Result of my "docker inspect" ; https://gist.github.com/inokappa/7625180

I modified it as the following method, and then it is woking now.
inokappa@003e80f

I'm looking for your reply.
Thank you.

@portertech

This comment has been minimized.

Show comment
Hide comment
@portertech

portertech Nov 25, 2013

Contributor

Using the gateway would cause the docker driver to SSH into the host machine, running the tests there. I am unable to reproduce your issue w/ the driver and Docker 0.6.7, all actions are working on a fresh VM. Perhaps run kitchen destroy and then rm -rf .kitchen to ensure there isn't some saved state causing problems.

Contributor

portertech commented Nov 25, 2013

Using the gateway would cause the docker driver to SSH into the host machine, running the tests there. I am unable to reproduce your issue w/ the driver and Docker 0.6.7, all actions are working on a fresh VM. Perhaps run kitchen destroy and then rm -rf .kitchen to ensure there isn't some saved state causing problems.

@portertech portertech closed this Nov 25, 2013

@portertech portertech reopened this Nov 25, 2013

@inokappa

This comment has been minimized.

Show comment
Hide comment
@inokappa

inokappa Nov 25, 2013

Thank you for your reply.
I can understand your explanation.
I will try later for your advice.
Thank you.

inokappa commented Nov 25, 2013

Thank you for your reply.
I can understand your explanation.
I will try later for your advice.
Thank you.

@inokappa

This comment has been minimized.

Show comment
Hide comment
@inokappa

inokappa Nov 25, 2013

I have tried in your advice.

It has continued in my environment unfortunately.
However, "kitchen create" was successful when ssh-service of host machine had started.

check environment

  • Ubuntu 13.10
  • lxc-docker-0.6.7
  • kitchen-docker 0.10.0
  • test-kitchen 1.0.0.beta.4

result

Will my procedure have a problem?
I'd like to want your advice.

Thank you.

inokappa commented Nov 25, 2013

I have tried in your advice.

It has continued in my environment unfortunately.
However, "kitchen create" was successful when ssh-service of host machine had started.

check environment

  • Ubuntu 13.10
  • lxc-docker-0.6.7
  • kitchen-docker 0.10.0
  • test-kitchen 1.0.0.beta.4

result

Will my procedure have a problem?
I'd like to want your advice.

Thank you.

@damm

This comment has been minimized.

Show comment
Hide comment
@damm

damm Nov 25, 2013

@inokappa I had similar problems; but I was able to resolve them by updating and removing then offending stale .kitchen.yml files. In your example you should be getting a pristine cookbook so you should not be getting stale files.

However what would be helpful here is upping your loglevel to debug. Can you do it with debug set?

kitchen create -l debug

My working setup with Ubuntu 12.04 with the same versions just using remote docker instances. Working with debug is here https://gist.github.com/damm/ec9c9ccd9487b573c35b

damm commented Nov 25, 2013

@inokappa I had similar problems; but I was able to resolve them by updating and removing then offending stale .kitchen.yml files. In your example you should be getting a pristine cookbook so you should not be getting stale files.

However what would be helpful here is upping your loglevel to debug. Can you do it with debug set?

kitchen create -l debug

My working setup with Ubuntu 12.04 with the same versions just using remote docker instances. Working with debug is here https://gist.github.com/damm/ec9c9ccd9487b573c35b

@inokappa

This comment has been minimized.

Show comment
Hide comment
@inokappa

inokappa Nov 26, 2013

@damm Thank you for your reply.
I will try later for your advice.

Thank you.

inokappa commented Nov 26, 2013

@damm Thank you for your reply.
I will try later for your advice.

Thank you.

@inokappa

This comment has been minimized.

Show comment
Hide comment
@inokappa

inokappa Nov 27, 2013

@damm

I tried kitchen create -l debug.

please confirm following.
https://gist.github.com/inokappa/7683769
but I confirmed,"docker create" success when using remote docker instance.

I'd like to want your advice.

Thank you.

inokappa commented Nov 27, 2013

@damm

I tried kitchen create -l debug.

please confirm following.
https://gist.github.com/inokappa/7683769
but I confirmed,"docker create" success when using remote docker instance.

I'd like to want your advice.

Thank you.

@portertech

This comment has been minimized.

Show comment
Hide comment
@portertech

portertech Nov 27, 2013

Contributor

It shouldn't be "Waiting for localhost:22" it should be using the forwarded port "49153", please gist your kitchen state files after the create action.

Contributor

portertech commented Nov 27, 2013

It shouldn't be "Waiting for localhost:22" it should be using the forwarded port "49153", please gist your kitchen state files after the create action.

@inokappa

This comment has been minimized.

Show comment
Hide comment
@inokappa

inokappa Nov 28, 2013

@portertech

I'm sorry for the late reply.
following is an execution result and status of "kitchen create".

https://gist.github.com/inokappa/7692711

Please confirm.
Thank you.

inokappa commented Nov 28, 2013

@portertech

I'm sorry for the late reply.
following is an execution result and status of "kitchen create".

https://gist.github.com/inokappa/7692711

Please confirm.
Thank you.

@portertech

This comment has been minimized.

Show comment
Hide comment
@portertech

portertech Nov 28, 2013

Contributor

The state file contains the correct port, I'll have a look at test-kitchen and ping @fnichol.

Contributor

portertech commented Nov 28, 2013

The state file contains the correct port, I'll have a look at test-kitchen and ping @fnichol.

@portertech

This comment has been minimized.

Show comment
Hide comment
@portertech

portertech Nov 28, 2013

Contributor

@inokappa you are no longer running a patched version of kitchen-docker or test-kitchen, correct?

Contributor

portertech commented Nov 28, 2013

@inokappa you are no longer running a patched version of kitchen-docker or test-kitchen, correct?

@fnichol

This comment has been minimized.

Show comment
Hide comment
@fnichol

fnichol Nov 28, 2013

Member

@inokappa If you're using the (very) recent 1.0.0.rc.1 release of Test Kitchen, could you run kitchen list --debug and paste us the output? It'll show what the docker driver was given as its computed configuration. Warning, you may to scrub out a detail or 2 in that output, could be credentials in there depending on your setup. Thanks!

Member

fnichol commented Nov 28, 2013

@inokappa If you're using the (very) recent 1.0.0.rc.1 release of Test Kitchen, could you run kitchen list --debug and paste us the output? It'll show what the docker driver was given as its computed configuration. Warning, you may to scrub out a detail or 2 in that output, could be credentials in there depending on your setup. Thanks!

@inokappa

This comment has been minimized.

Show comment
Hide comment
@inokappa

inokappa Nov 29, 2013

@portertech @fnichol
Thank you for your reply.
I'm sorry to cause you trouble.

@portertech
I using test-kitchen 1.0.0.beta.4 with kitchen-docker 0.10.0.

@fnichol
I'll try test-kitchen 1.0.0.rc.1 with kitchen-docker 0.10.0

Thank you.

inokappa commented Nov 29, 2013

@portertech @fnichol
Thank you for your reply.
I'm sorry to cause you trouble.

@portertech
I using test-kitchen 1.0.0.beta.4 with kitchen-docker 0.10.0.

@fnichol
I'll try test-kitchen 1.0.0.rc.1 with kitchen-docker 0.10.0

Thank you.

@fnichol

This comment has been minimized.

Show comment
Hide comment
@fnichol

fnichol Nov 29, 2013

Member

Super, thank you, @inokappa! 🍰

Member

fnichol commented Nov 29, 2013

Super, thank you, @inokappa! 🍰

@nathwill

This comment has been minimized.

Show comment
Hide comment
@nathwill

nathwill Nov 29, 2013

same issue here, it looks like test-kitchen is getting the service port and not the forwarded port:

gem versions:
test-kitchen (1.0.0.rc.1)
kitchen-docker (0.10.0)

docker version:
docker-io-0.7-0.20.rc7.fc20.x86_64

kitchen list --debug -> https://gist.github.com/nathwill/7700600
docker inspect -> https://gist.github.com/nathwill/7700626

nathwill commented Nov 29, 2013

same issue here, it looks like test-kitchen is getting the service port and not the forwarded port:

gem versions:
test-kitchen (1.0.0.rc.1)
kitchen-docker (0.10.0)

docker version:
docker-io-0.7-0.20.rc7.fc20.x86_64

kitchen list --debug -> https://gist.github.com/nathwill/7700600
docker inspect -> https://gist.github.com/nathwill/7700626

@nathwill

This comment has been minimized.

Show comment
Hide comment
@nathwill

nathwill commented Nov 29, 2013

this may be when it broke: test-kitchen/test-kitchen@1c95cd0

portertech added a commit that referenced this issue Nov 29, 2013

@portertech

This comment has been minimized.

Show comment
Hide comment
@portertech

portertech Nov 29, 2013

Contributor

@inokappa You can install kitchen-docker 0.11.0, it has a fix, thank you 👍

Contributor

portertech commented Nov 29, 2013

@inokappa You can install kitchen-docker 0.11.0, it has a fix, thank you 👍

@nathwill

This comment has been minimized.

Show comment
Hide comment
@nathwill

nathwill Nov 29, 2013

awesome. thanks for the quick merge and excellent driver!

nathwill commented Nov 29, 2013

awesome. thanks for the quick merge and excellent driver!

@portertech

This comment has been minimized.

Show comment
Hide comment
@portertech

portertech Nov 29, 2013

Contributor

@nathwill Thank you for the fix! And you're welcome :-)

Contributor

portertech commented Nov 29, 2013

@nathwill Thank you for the fix! And you're welcome :-)

@inokappa

This comment has been minimized.

Show comment
Hide comment
@inokappa

inokappa Nov 29, 2013

@portertech @nathwill @fnichol

I tried test-kitchen 1.0.0.rc.1 with kitchen-docker 0.11.0 and docker 0.7.0

kitchen list -l debug #=> https://gist.github.com/inokappa/7702607
kitchen create -l debug #=> https://gist.github.com/inokappa/7702611
default-ubuntu.log #=> https://gist.github.com/inokappa/7702614

gooooood!!!
Thanks you, everyone!!!!!!!!!

inokappa commented Nov 29, 2013

@portertech @nathwill @fnichol

I tried test-kitchen 1.0.0.rc.1 with kitchen-docker 0.11.0 and docker 0.7.0

kitchen list -l debug #=> https://gist.github.com/inokappa/7702607
kitchen create -l debug #=> https://gist.github.com/inokappa/7702611
default-ubuntu.log #=> https://gist.github.com/inokappa/7702614

gooooood!!!
Thanks you, everyone!!!!!!!!!

@petere

This comment has been minimized.

Show comment
Hide comment
@petere

petere Mar 13, 2014

So what was the solution to this? I'm still getting repeated

Waiting for localhost:49153...

which relates to

    "PortBindings": {
        "22/tcp": [
            {
                "HostIp": "0.0.0.0",
                "HostPort": "49153"
            }
        ]
    },

petere commented Mar 13, 2014

So what was the solution to this? I'm still getting repeated

Waiting for localhost:49153...

which relates to

    "PortBindings": {
        "22/tcp": [
            {
                "HostIp": "0.0.0.0",
                "HostPort": "49153"
            }
        ]
    },
@nathwill

This comment has been minimized.

Show comment
Hide comment
@nathwill

nathwill Mar 13, 2014

@petere are you using /sbin/init as the run command? if so, you have to use an image which has patches for udevadm-settle and sshd pam config. there's a few out there, including nathwill/centos{,-small,-medium}.

if not using init, sorry, i dunno.

nathwill commented Mar 13, 2014

@petere are you using /sbin/init as the run command? if so, you have to use an image which has patches for udevadm-settle and sshd pam config. there's a few out there, including nathwill/centos{,-small,-medium}.

if not using init, sorry, i dunno.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment