Comments (10)
I'm guessing the logger
the exception is using doesn't exist which raises an exception inside the handler.
I tested the theory and it worked:
diff --git a/kitchen-docker-2.12.0/lib/docker/version.rb b/kitchen-docker-2.12.0/lib/docker/version.rb
index 70fd25e..ed32290 100644
--- a/kitchen-docker-2.12.0/lib/docker/version.rb
+++ b/kitchen-docker-2.12.0/lib/docker/version.rb
@@ -21,5 +21,5 @@ begin
API_VERSION = '1.24'
end
rescue LoadError => e
- logger.debug("[Docker] docker-api gem not found for InSpec verifier. #{e}")
+ puts("[Docker] docker-api gem not found for InSpec verifier. #{e}")
end
diff --git a/kitchen-docker-2.12.0/lib/kitchen/docker/helpers/inspec_helper.rb b/kitchen-docker-2.12.0/lib/kitchen/docker/helpers/inspec_helper.rb
index 5f0d325..f662543 100644
--- a/kitchen-docker-2.12.0/lib/kitchen/docker/helpers/inspec_helper.rb
+++ b/kitchen-docker-2.12.0/lib/kitchen/docker/helpers/inspec_helper.rb
@@ -36,5 +36,5 @@ begin
end
end
rescue LoadError => e
- logger.debug("[Docker] kitchen-inspec gem not found for InSpec verifier. #{e}")
+ puts("[Docker] kitchen-inspec gem not found for InSpec verifier. #{e}")^M
end
diff --git a/kitchen-docker-2.12.0/lib/kitchen/transport/docker.rb b/kitchen-docker-2.12.0/lib/kitchen/transport/docker.rb
index de31807..e262814 100644
--- a/kitchen-docker-2.12.0/lib/kitchen/transport/docker.rb
+++ b/kitchen-docker-2.12.0/lib/kitchen/transport/docker.rb
@@ -80,7 +80,11 @@ module Kitchen
class Connection < Kitchen::Transport::Docker::Connection
# Include the InSpec patches to be able to execute tests on Windows containers
- include Kitchen::Docker::Helpers::InspecHelper
+ begin
+ include Kitchen::Docker::Helpers::InspecHelper
+ rescue Exception => e
+ puts("Error")
+ end
def execute(command)
return if command.nil?
diff --git a/kitchen-docker-2.12.0/lib/train/docker.rb b/kitchen-docker-2.12.0/lib/train/docker.rb
index 024caae..1fb80b9 100644
--- a/kitchen-docker-2.12.0/lib/train/docker.rb
+++ b/kitchen-docker-2.12.0/lib/train/docker.rb
@@ -121,5 +121,5 @@ begin
end
end
rescue LoadError => e
- logger.debug("[Docker] train gem not found for InSpec verifier. #{e}")
+ puts("[Docker] train gem not found for InSpec verifier. #{e}")
end
from kitchen-docker.
+1
Also tried rolling back kitchen and kitchen-docker from every version to v1 release and same error.
Also input the env_variables at driver and transport layer for logger and same error running docker 19.03.13-ce on arch
from kitchen-docker.
I encountered this issue on test-kitchen 2.5.4 (I need the old version for Chef 12 / Ruby 2.3.6 compatibility) and kitchen-docker 2.10.0, but was able to fix it by backing down to kitchen-docker 2.8.0.
from kitchen-docker.
It doesn't seem to work either:
$ bundle install
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and
installing your bundle as root will break this application for all non-root
users on this machine.
Fetching gem metadata from https://rubygems.org/..........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...
Using bundler 2.2.2
[...]
Fetching test-kitchen 2.11.1
Installing test-kitchen 2.11.1
Fetching kitchen-salt 0.6.3
Fetching kitchen-sync 2.2.1
Fetching kitchen-docker 2.8.0
Installing kitchen-salt 0.6.3
Installing kitchen-sync 2.2.1
Installing kitchen-docker 2.8.0
Bundle complete! 4 Gemfile dependencies, 47 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
$ kitchen test
-----> Starting Test Kitchen (v2.11.1)
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ClientError
>>>>>> Message: Could not load the 'docker' transport from the load path. Did you mean: dummy, exec, runtests, ssh, winrm ? Please ensure that your transport is installed as a gem or included in your Gemfile if using Bundler.
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ClientError
>>>>>> Message: Could not load the 'docker' transport from the load path. Did you mean: dummy, exec, runtests, ssh, winrm ? Please ensure that your transport is installed as a gem or included in your Gemfile if using Bundler.
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration
ERROR: Job failed: exit code 20
from kitchen-docker.
This seems to fail around the require_relative '../docker/helpers/inspec_helper'
line in kitchen-docker-2.12.0/lib/kitchen/transport/docker.rb
. Adding kitchen-inspec
to my Gemfile fixed it.
from kitchen-docker.
@jbussdieker-quiknode Odd... I would have to run this scenario through the debugger (and I will if I ever tackle this issue) but the file you pointed to wraps the require into a begin
block and catches the LoadError. I wouldn't expect it to cause this failure.
Thanks for the lead though. I was unable to reproduce this when I looked at it several months back.
from kitchen-docker.
Oddly enough that line wasn't specifically what caused the error. I was adding instrumentation to the code and would get output from puts
before that line but not after. From there I installed inspec and it worked.
from kitchen-docker.
So is the workaround still to add the kitchen-inspec
gem?
from kitchen-docker.
@olhado I would suggest trying that, yes
from kitchen-docker.
That seemed to work!
from kitchen-docker.
Related Issues (20)
- chef-client cookbook now fails with this driver HOT 1
- Transport does not work in Windows HOT 7
- Gem v2.9.0 doesn't include the docker transport HOT 6
- Unable to fetch packages during kitchen create for ubuntu-14.04 platform HOT 1
- Message: Error getting internal IP of Docker container HOT 4
- Docker images deletions fails when instances share the same image ID
- There does not appear to be a way to clean up volumes created by kitchen-docker HOT 4
- dependency roles in requirements.yml installed successfully, but error role not found when running test playbook. HOT 1
- Create new release of kitchen-docker gem HOT 5
- kitchen-docker 2.10.0 doesn't work, at least not docker-in-docker HOT 16
- This seems to be fixed, does it still need to be here?
- docker build output no longer matches image_helper regex HOT 1
- Unable to map docker.sock in as volume for docker-in-docker HOT 2
- Cannot use docker transport when using docker tmpfs on /tmp
- Docker build on M1 Mac can fail if the buildkit output includes timings/timestamps HOT 8
- Support for Centosstream and PhotonOS missing from kitchen-docker HOT 1
- SSH failed with Ubuntu 22 and Centos 9 HOT 2
- Amazon 2022 images fail to build due to conflict between curl packages HOT 6
- Waiting for SSH service on localhost:49714, retrying in 3 seconds HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kitchen-docker.