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

No such file error when running "/bin/echo hello world" in docker_test::image_lwrp #98

Closed
carmstrong opened this issue Mar 25, 2014 · 4 comments

Comments

@carmstrong
Copy link
Contributor

I'm unable to complete a test-kitchen run due to the following:

[2014-03-25T21:18:40+00:00] INFO: cookbook_file[/tmp/docker_image_build.dockerfile] created file /tmp/docker_image_build.dockerfile

    - create new file /tmp/docker_image_build.dockerfile[2014-03-25T21:18:40+00:00] INFO: cookbook_file[/tmp/docker_image_build.dockerfile] updated file contents /tmp/docker_image_build.dockerfile

    - update content in file /tmp/docker_image_build.dockerfile from none to 2248db
        --- /tmp/docker_image_build.dockerfile  2014-03-25 21:18:40.993592727 +0000
        +++ /tmp/.docker_image_build.dockerfile20140325-1249-1ghmd1h    2014-03-25 21:18:40.993592727 +0000
        @@ -1 +1,3 @@
        +FROM busybox
        +RUN /bin/echo hello world

  * docker_image[myImage] action build[2014-03-25T21:18:41+00:00] INFO: Processing docker_image[myImage] action build (docker_test::image_lwrp line 19)

================================================================================
Error executing action `build` on resource 'docker_image[myImage]'
================================================================================


Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '1'
---- Begin output of docker build  --no-cache=false --rm=true --tag="myImage:myTag" - < /tmp/docker_image_build.dockerfile ----
STDOUT: Step 0 : FROM busybox
 ---> 769b9341d937
Step 1 : RUN /bin/echo hello world
 ---> Running in 4c0170cf3653
2014/03/25 21:18:41 no such file or directory

       STDERR: Uploading context 2.048 kB
       Uploading context
       2014/03/25 21:18:41 The command [/bin/sh -c /bin/echo hello world] returned a non-zero code: 1
       ---- End output of docker build  --no-cache=false --rm=true --tag="myImage:myTag" - < /tmp/docker_image_build.dockerfile ----
       Ran docker build  --no-cache=false --rm=true --tag="myImage:myTag" - < /tmp/docker_image_build.dockerfile returned 1


       Cookbook Trace:

       ---------------

       /tmp/kitchen/cookbooks/docker/libraries/helpers.rb:141:in `execute_cmd!'

       /tmp/kitchen/cookbooks/docker/libraries/helpers.rb:134:in `docker_cmd!'
       /tmp/kitchen/cookbooks/docker/providers/image.rb:127:in `build'
       /tmp/kitchen/cookbooks/docker/providers/image.rb:27:in `block in class_from_file'


       Resource Declaration:
       ---------------------
       # In /tmp/kitchen/cookbooks/docker_test/recipes/image_lwrp.rb

        19: docker_image "myImage" do
        20:   tag "myTag"
        21:   source fname
        22:   action :build
        23: end
        24:



       Compiled Resource:
       ------------------

       # Declared in /tmp/kitchen/cookbooks/docker_test/recipes/image_lwrp.rb:19:in `from_file'

       docker_image("myImage") do
         action [:build]
         retries 0
         retry_delay 2
         cookbook_name :docker_test
         recipe_name "image_lwrp"
         tag "myTag"
Check Docker version  before using exec_driver (fixes #95)
         source "/tmp/docker_image_build.dockerfile"
         cmd_timeout 300
         image_name "myImage"
         rm true
       end



       [2014-03-25T21:18:41+00:00] INFO: Running queued delayed notifications before re-raising exception


Running handlers:
       [2014-03-25T21:18:41+00:00] ERROR: Running exception handlers

       Running handlers complete

       [2014-03-25T21:18:41+00:00] ERROR: Exception handlers complete

[2014-03-25T21:18:41+00:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out
Chef Client failed. 30 resources updated in 98.915090579 seconds
[2014-03-25T21:18:41+00:00] ERROR: docker_image[myImage] (docker_test::image_lwrp line 19) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of docker build  --no-cache=false --rm=true --tag="myImage:myTag" - < /tmp/docker_image_build.dockerfile ----
STDOUT: Step 0 : FROM busybox
 ---> 769b9341d937
Step 1 : RUN /bin/echo hello world
 ---> Running in 4c0170cf3653
2014/03/25 21:18:41 no such file or directory

        Uploading context 2.048 kB
       ng context
2014/03/25 21:18:41 The command [/bin/sh -c /bin/echo hello world] returned a non-zero code: 1
---- End output of docker build  --no-cache=false --rm=true --tag="myImage:myTag" - < /tmp/docker_image_build.dockerfile ----
Ran docker build  --no-cache=false --rm=true --tag="myImage:myTag" - < /tmp/docker_image_build.dockerfile returned 1
[2014-03-25T21:18:41+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
>>>>>> Converge failed on instance <docker-lwrp-ubuntu-1204>.
>>>>>> Please see .kitchen/logs/docker-lwrp-ubuntu-1204.log for more details
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: SSH exited (1) for command: [sudo -E chef-solo --config /tmp/kitchen/solo.rb --json-attributes /tmp/kitchen/dna.json  --log_level info]
>>>>>> ----------------------
@carmstrong
Copy link
Contributor Author

Fixed in #99

@carmstrong
Copy link
Contributor Author

Closed #99 as I haven't been able to repro this since.

@bflad
Copy link
Contributor

bflad commented Mar 26, 2014

That's definitely bizarre, I have yet to see that in the hundreds of times I've run test kitchen since that test was added. Maybe a network glitch downloading the busybox image or something?

@bflad
Copy link
Contributor

bflad commented Mar 26, 2014

I went ahead and wrapped the echo statement in quotes in the test just in case. I don't think its necessarily important to test the Dockerfile parsing as we're just trying to verify image manipulation in the cookbook. Please let me know if you see this again.

@bflad bflad closed this as completed Mar 26, 2014
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