trying to get started testing kubernetes with inspec using: https://github.com/bgeesaman/inspec-k8s
Im running it from the make and docker image found here: https://github.com/bgeesaman/inspec-k8s-sample
I have multiple eks clusters and a local docker-desktop cluster. When i try and connect to any of them via: inspec exec . -t k8s://docker-desktop (Matching the kubeconfig -name: xxx to the value put after k8s://) I always get the same error:
# inspec exec -t k8s://docker-desktop
Traceback (most recent call last):
20: from /usr/local/bundle/bin/inspec:23:in `<main>'
19: from /usr/local/bundle/bin/inspec:23:in `load'
18: from /usr/local/bundle/gems/inspec-bin-4.18.51/bin/inspec:11:in `<top (required)>'
17: from /usr/local/bundle/gems/inspec-4.18.51/lib/inspec/base_cli.rb:35:in `start'
16: from /usr/local/bundle/gems/thor-0.20.3/lib/thor/base.rb:466:in `start'
15: from /usr/local/bundle/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
14: from /usr/local/bundle/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
13: from /usr/local/bundle/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
12: from /usr/local/bundle/gems/inspec-4.18.51/lib/inspec/cli.rb:284:in `exec'
11: from /usr/local/bundle/gems/inspec-4.18.51/lib/inspec/cli.rb:284:in `new'
10: from /usr/local/bundle/gems/inspec-4.18.51/lib/inspec/runner.rb:78:in `initialize'
9: from /usr/local/bundle/gems/inspec-4.18.51/lib/inspec/runner.rb:86:in `configure_transport'
8: from /usr/local/bundle/gems/inspec-4.18.51/lib/inspec/backend.rb:53:in `create'
7: from /usr/local/bundle/gems/train-kubernetes-0.1.6/lib/train-kubernetes/transport.rb:9:in `connection'
6: from /usr/local/bundle/gems/train-kubernetes-0.1.6/lib/train-kubernetes/transport.rb:9:in `new'
5: from /usr/local/bundle/gems/train-kubernetes-0.1.6/lib/train-kubernetes/connection.rb:13:in `initialize'
4: from /usr/local/bundle/gems/train-kubernetes-0.1.6/lib/train-kubernetes/connection.rb:36:in `parse_kubeconfig'
3: from /usr/local/bundle/gems/k8s-ruby-0.10.5/lib/k8s/client.rb:40:in `config'
2: from /usr/local/bundle/gems/k8s-ruby-0.10.5/lib/k8s/transport.rb:81:in `config'
1: from /usr/local/bundle/gems/k8s-ruby-0.10.5/lib/k8s/transport.rb:117:in `token_from_exec'
/usr/local/bundle/gems/k8s-ruby-0.10.5/lib/k8s/transport.rb:117:in ``': No such file or directory - aws (Errno::ENOENT)
I thought it was because of eks kubeconfigs being linked to the aws profile. But i get the same error for docker-desktop as well.
I tried updating the Makefile COMMAND with: COMMAND=docker run --rm -it -v pwd:$(WORKDIR) -v $(HOME)/.kube:/root/.kube:ro -v $(HOME)/.aws:/root/.aws:ro
After the error ends with No such file or directory - aws but no joy.
Any ideas how to resolve or progress?
Thanks
Small update, It did start running after making sure names where correct. But then stopped again..
I had connected to docker-desktop (It wasnt running when i orginally ran it)
I had connected to an eks cluster
I did a vi controls/basic.rb to start looking playing with my tests and it started erroring again.
I thought it might error due to a syntax problem with my changes so did a new make build but still no joy now :(
I have also tried updating the chef/inspec image to the latest 4.26 but this breaks the dockerfile as it doesnt have apk anymore.
Ok, i dont get it but i can get it to run:
It looks to be linked to im using kubectx. If i set kubectx to docker-desktop and then run the docker image it works. If im set to anything else it doesnt.
Related
I just installed chef-workstation on mac, I also have rvm installed on my machine. The chef-workstation is successfully installed but when I try to run chef exec command it fails with below error -
Traceback (most recent call last):
20: from /Users/tusharhawaldar/.rvm/gems/ruby-2.6.0#base/bin/ruby_executable_hooks:22:in `<main>'
19: from /Users/tusharhawaldar/.rvm/gems/ruby-2.6.0#base/bin/ruby_executable_hooks:22:in `eval'
18: from /Users/tusharhawaldar/.rvm/gems/ruby-2.6.0#base/bin/chef:23:in `<main>'
17: from /Users/tusharhawaldar/.rvm/gems/ruby-2.6.0#base/bin/chef:23:in `load'
16: from /Users/tusharhawaldar/.rvm/gems/ruby-2.6.0#base/gems/chef-dk-3.11.3/bin/chef:25:in `<top (required)>'
15: from /Users/tusharhawaldar/.rvm/gems/ruby-2.6.0#base/gems/chef-dk-3.11.3/lib/chef-dk/cli.rb:73:in `run'
14: from /Users/tusharhawaldar/.rvm/gems/ruby-2.6.0#base/gems/chef-dk-3.11.3/lib/chef-dk/command/base.rb:58:in `run_with_default_options'
13: from /Users/tusharhawaldar/.rvm/gems/ruby-2.6.0#base/gems/chef-dk-3.11.3/lib/chef-dk/command/env.rb:39:in `run'
12: from /Users/tusharhawaldar/.rvm/gems/ruby-2.6.0#base/gems/chef-dk-3.11.3/lib/chef-dk/command/env.rb:39:in `tap'
11: from /Users/tusharhawaldar/.rvm/gems/ruby-2.6.0#base/gems/chef-dk-3.11.3/lib/chef-dk/command/env.rb:41:in `block in run'
10: from /Users/tusharhawaldar/.rvm/gems/ruby-2.6.0#base/gems/chef-dk-3.11.3/lib/chef-dk/command/env.rb:57:in `ruby_info'
9: from /Users/tusharhawaldar/.rvm/gems/ruby-2.6.0#base/gems/chef-dk-3.11.3/lib/chef-dk/command/env.rb:57:in `tap'
8: from /Users/tusharhawaldar/.rvm/gems/ruby-2.6.0#base/gems/chef-dk-3.11.3/lib/chef-dk/command/env.rb:60:in `block in ruby_info'
7: from /Users/tusharhawaldar/.rvm/gems/ruby-2.6.0#base/gems/chef-dk-3.11.3/lib/chef-dk/command/env.rb:60:in `tap'
6: from /Users/tusharhawaldar/.rvm/gems/ruby-2.6.0#base/gems/chef-dk-3.11.3/lib/chef-dk/command/env.rb:63:in `block (2 levels) in ruby_info'
5: from /Users/tusharhawaldar/.rvm/gems/ruby-2.6.0#base/gems/chef-dk-3.11.3/lib/chef-dk/command/env.rb:69:in `gem_environment'
4: from /Users/tusharhawaldar/.rvm/gems/ruby-2.6.0#base/gems/chef-dk-3.11.3/lib/chef-dk/command/env.rb:69:in `tap'
3: from /Users/tusharhawaldar/.rvm/gems/ruby-2.6.0#base/gems/chef-dk-3.11.3/lib/chef-dk/command/env.rb:70:in `block in gem_environment'
2: from /Users/tusharhawaldar/.rvm/gems/ruby-2.6.0#base/gems/chef-dk-3.11.3/lib/chef-dk/helpers.rb:124:in `omnibus_env'
1: from /Users/tusharhawaldar/.rvm/gems/ruby-2.6.0#base/gems/chef-dk-3.11.3/lib/chef-dk/helpers.rb:72:in `omnibus_embedded_bin_dir'
/Users/tusharhawaldar/.rvm/gems/ruby-2.6.0#base/gems/chef-dk-3.11.3/lib/chef-dk/helpers.rb:142:in `omnibus_expand_path': Can not find omnibus installation directory for Chef. (ChefDK::OmnibusInstallNotFound)
When I checked for omnibus_root path it is giving -
/Users/tusharhawaldar/.rvm/rubies
And it is trying to find bin & /embedded/bin directories at omnibus_root_path, which are not present there, so it is raising this error.
I manually created these directories at omnibus_root_path, and I can now run the chef exec command, but when it run the chefspec it is now giving below error -
An error occurred while loading ./spec/unit/recipes/initial_packages_spec.rb.
Failure/Error: require 'chefspec'
LoadError:
cannot load such file -- chefspec
./spec/spec_helper.rb:1:in `<top (required)>'
./spec/unit/recipes/initial_packages_spec.rb:1:in `<top (required)>'
No examples found.
require 'chefspec' is failing means something missing in setup, which I doubt is related to chef omnibus.
What should be the correct way to resolve error related to ChefDK::OmnibusInstallNotFound?
Okay, so after trying various things, I finally found a solution for error -
Can not find omnibus installation directory for Chef. (ChefDK::OmnibusInstallNotFound)
And it is running below command for path update -
echo 'export PATH="/opt/chef-workstation/embedded/bin:$PATH"' >> ~/.bash_profile && source ~/.bash_profile
From - https://www.tutorialspoint.com/chef/chef_workstation_setup.htm
The Omnibus Chef will install Ruby and all the required Ruby gems into /opt/chef/embedded by adding /opt/chef/embedded/bin directory to the .bash_profile file.
I am having issues running fastlane and cocoapods for a month now. Any idea what is the issue? Tried RVM, changing the version and so on but nothing works.
I reinstalled fastlane then cocopoda started working again. Now fastlane does not work, error below.
It seems like you wanted to load some plugins, however they couldn't be loaded
[22:05:14]: Please follow the troubleshooting guide: https://docs.fastlane.tools/plugins/plugins-troubleshooting/
Traceback (most recent call last):
8: from /usr/local/bin/fastlane:23:in `<main>'
7: from /usr/local/bin/fastlane:23:in `load'
6: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.170.0/bin/fastlane:23:in `<top (required)>'
5: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.170.0/fastlane/lib/fastlane/cli_tools_distributor.rb:119:in `take_off'
4: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.170.0/fastlane/lib/fastlane/commands_generator.rb:41:in `start'
3: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.170.0/fastlane/lib/fastlane/commands_generator.rb:352:in `run'
2: from /Library/Ruby/Gems/2.6.0/gems/commander-fastlane-4.4.6/lib/commander/delegates.rb:15:in `run!'
1: from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.170.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:50:in `run!'
/Library/Ruby/Gems/2.6.0/gems/commander-fastlane-4.4.6/lib/commander/runner.rb:411:in `parse_global_options': ambiguous option: --v (OptionParser::AmbiguousOption)
You didn't include a minimal reproducible example in your post so I can't say for sure if this is the issue because I can't see how you're invoking fastlane. I recommend that you add a complete MRE to questions so people can see exactly how you got to where you are.
That said, it's probably that you are running fastlane --v and not fastlane -v:
$ fastlane --help
...
-v, --version Display version information
I am doing pod init for a new Xcode project of mine but it fails outputting:
Traceback (most recent call last):
5: from /usr/local/bin/pod:23:in `<main>'
4: from /usr/local/bin/pod:23:in `load'
3: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/bin/pod:55:in `<top (required)>'
2: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/command.rb:49:in `run'
1: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/command.rb:130:in `verify_minimum_git_version!'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/command.rb:118:in `git_version': Failed to extract git version from `git --version` ("xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun\n") (RuntimeError)
I have always done this before and never had problems with the terminal since recently updating my mac too latest version.
I know that Calabash is not officially supported by MS but stil developed by community. After configuration I always get the same error:
C:\Users\XXX YYY\CalabashCucumberTest>bundle exec calabash-android run io.apk
No test server found for this combination of app and calabash version. Recreating test server.
WARNING: skipped META-INF/CERT.RSA as unsafe
Traceback (most recent call last):
10: from C:/Ruby25-x64/bin/calabash-android:23:in `<main>'
9: from C:/Ruby25-x64/bin/calabash-android:23:in `load'
8: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/calabash-android-0.9.8/bin/calabash-android:86:in `<top (required)>'
7: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/calabash-android-0.9.8/bin/calabash-android-run.rb:16:in `calabash_run'
6: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/calabash-android-0.9.8/lib/calabash-android/helpers.rb:107:in `build_test_server_if_needed'
5: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/calabash-android-0.9.8/bin/calabash-android-build.rb:2:in `calabash_build'
4: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/calabash-android-0.9.8/lib/calabash-android/helpers.rb:169:in `fingerprint_from_apk'
3: from C:/Ruby25-x64/lib/ruby/2.5.0/tmpdir.rb:89:in `mktmpdir'
2: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/calabash-android-0.9.8/lib/calabash-android/helpers.rb:170:in `block in fingerprint_from_apk'
1: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/calabash-android-0.9.8/lib/calabash-android/helpers.rb:170:in `chdir'
C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/calabash-android-0.9.8/lib/calabash-android/helpers.rb:188:in `block (2 levels) in fingerprint_from_apk': No signature files found in META-INF. Cannot proceed. (RuntimeError)
I followed official Github tutorial. I tried different apps, real and emulated devices - result is the same. Can anyone help me with configuration? Maybe I have to use other versions than latest Ruby and selected gems?
I am trying to install laravel/homestead however, during the installation I encountered an error with my VBoxManage when I ran the command vagrant up, what can I do to fix this?
Distro: openSUSE Leap 42.1
Vagrant version: 1.8.6
VirtualBox version: 5.0.26_SUSE r108824
The Error:
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.
Command: ["hostonlyif", "create"]
Stderr: 0%...
Progress state: NS_ERROR_FAILURE
VBoxManage: error: Failed to create the host-only adapter
VBoxManage: error: VBoxNetAdpCtl: Error while adding new interface: failed to open /dev/vboxnetctl: Operation not permitted
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component HostNetworkInterfaceWrap, interface IHostNetworkInterface
VBoxManage: error: Context: "RTEXITCODE handleCreate(HandlerArg*)" at line 71 of file VBoxManageHostonly.cpp
Does this have anything to do with permissions? because of Operation not permitted?
I checked the file with ls -l /dev/vboxnetctl and this is what it returned:
crw------- 1 root root 10, 55 Oct 3 07:24 /dev/vboxnetctl
Should I be changing the permission of this file? If so, I want to let you know that I did it before and it still shows an error, but this error is different:
/home/troopy712139/Homestead/scripts/homestead.rb:4:in `configure': undefined method `[]' for nil:NilClass (NoMethodError)
from /home/troopy712139/Homestead/Vagrantfile:30:in `block in <top (required)>'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/config/v2/loader.rb:37:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/config/v2/loader.rb:37:in `load'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/config/loader.rb:113:in `block (2 levels) in load'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/config/loader.rb:107:in `each'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/config/loader.rb:107:in `block in load'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/config/loader.rb:104:in `each'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/config/loader.rb:104:in `load'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/vagrantfile.rb:28:in `initialize'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/environment.rb:746:in `new'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/environment.rb:746:in `vagrantfile'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/environment.rb:492:in `host'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/environment.rb:214:in `block in action_runner'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/action/runner.rb:33:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/action/runner.rb:33:in `run'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/environment.rb:479:in `hook'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/environment.rb:728:in `unload'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/bin/vagrant:177:in `ensure in <main>'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/bin/vagrant:177:in `<main>'
The VBoxManage hostonlyif create command worked once when I ran it in root.
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Interface 'vboxnet1' was successfully created
Can you try running sudo vagrant up --provision.
You may also want to check to make sure your paths match up in the Homestead.yaml file
So it seems all I needed to do was make vboxnetctl be owned by me, and restart my computer. I also added vboxdrv to run on startup by running this code:
service vboxdrv start
The error around: /dev/vboxnetctl tells you that your user doesn't have access there.
Try something line:
sudo usermod -a -G vboxusers
Alvaro