Message: Failed to complete converge action - amazon-ec2

PS C:\App\cookbooks\windows_settings> kitchen verify
---> Starting Kitchen (v1.4.2)
C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/httpclient-2.6.0.1/lib/httpclient/webagent-cookie.rb:458: warning: a
lready initialized constant HTTPClient::CookieManager
C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/httpclient-2.6.0.1/lib/httpclient/cookie.rb:8: warning: previous def
inition of CookieManager was here
---> Converging <default-windows-2012r2>...
Preparing files for transfer
Preparing dna.json
Resolving cookbook dependencies with Berkshelf 4.0.1...
Removing non-cookbook files before transfer
Preparing validation.pem
Preparing client.rb
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: Failed to complete #converge action: [A connection attempt failed because the connected party did not pr
operly respond after a period of time, or established connection failed because connected host has failed to respond. -
connect(2) for "ec2-54-213-41-35.us-west-2.compute.amazonaws.com" port 5985 (http://ec2-54-213-41-35.us-west-2.compute.a
mazonaws.com:5985)]
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration
I am not able to do kitchen converge action, everytime I am facing the specified above issue.

Looks like, the port 5985 is not opened on the test server. Can you please check the security group of the server, if the rule 'WinRM-HTTP' to connect 5985 is opened in inbound rules.
If the port is opened, you may tell the test kitchen to wait until the WinRM is ready, using the below parameters in kitchen.yml:
max_wait_until_ready: true
connection_timeout : 900
see here https://docs.chef.io/config_yml_kitchen.html#transport-settings

Related

vagrant plugin not running on vagrant up

I installed a vagrant plugin "vagrant-certificates" and added the following config to my ~/.vagrant.d/Vagrantfile
if !['plugin', 'box'].include? ARGV[0]
unless Vagrant.has_plugin?("vagrant-ca-certificates")
raise "Missing required plugin 'vagrant-certificates', run `vagrant plugin install vagrant-certificates`\n"
end
end
config.certificates.enabled = true
config.certificates.certs = Dir.glob('/home/myhomedirectory/.vagrant.d/*.crt')
and the plugin won't run. Other people that I know who are using that plugin get the following output when they run vagrant up:
==> machine: Uploading root certificates to guest instance...
==> machine: -- /var/folders/mb/1pt7p7zd4q736lq4vdq_309w0000gn/T/vagrant-certificates20200122-60457-
wop57o => /usr/share/ca-certificates/private/BA%20ROOT.crt
==> machine: -- /var/folders/mb/1pt7p7zd4q736lq4vdq_309w0000gn/T/vagrant-certificates20200122-60457-
3v8nhs => /usr/share/ca-certificates/private/BA%20NPE%20CA-3%281%29.crt
Updating certificates in /etc/ssl/certs...
0 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d...
done.
but I see no output related to certs:
and I'm getting an ssl error which indicates that the certs that I need have not been installed.
Can anybody help me debug this?
EDIT: Other ways I've tried to specify the certs:
config.certificates.certs = [
"./certROOT.crt",
"./certNPE_CA_3.crt"
]
config.certificates.certs = [
"http://pki.mycorp.org/certs/certROOT.crt",
"http://pki.mycorp.org/certs/certNPE_CA_3.crt"
]
EDIT 2: Output of vagrant up --debug 2>&1 >/dev/null | grep -i certificate
INFO manager: - vagrant-certificates = [installed: 2.0.0 constraint: > 0]
DEBUG bundler: Current generated plugin dependency list: [<Gem::Dependency type=:runtime name="vagrant-certificates" requirements="= 2.0.0">]
DEBUG bundler: Activating solution set: ["vagrant-certificates-2.0.0"]
DEBUG bundler: Activating gem vagrant-certificates-2.0.0
INFO manager: Loading plugin `vagrant-certificates` with default require: `vagrant-certificates`
INFO manager: Registered plugin: vagrant-certificates
DEBUG manager: Successfully loaded plugin `vagrant-certificates`.
INFO manager: - vagrant-certificates = [installed: 2.0.0 constraint: > 0]
DEBUG bundler: Current generated plugin dependency list: [<Gem::Dependency type=:runtime name="vagrant-certificates" requirements="= 2.0.0">]
DEBUG bundler: Activating solution set: ["vagrant-certificates-2.0.0"]
DEBUG bundler: Activating gem vagrant-certificates-2.0.0
INFO manager: Loading plugin `vagrant-certificates` with default require: `vagrant-certificates`
DEBUG manager: Successfully loaded plugin `vagrant-certificates`.
INFO warden: Calling IN action: #<VagrantPlugins::Certificates::Action::InstallCertificates:0x0000000002eea438>
INFO warden: Calling OUT action: #<VagrantPlugins::Certificates::Action::InstallCertificates:0x0000000002eea438>
DEBUG subprocess: stdout: fatal: [k8s-master]: FAILED! => {"changed": false, "msg": "Failed to validate the SSL certificate for packages.cloud.google.com:443. Make sure your managed systems have a valid CA certificate installed. You can use validate_certs=False if you do not need to confirm the servers identity but this is unsafe and not recommended. Paths checked for this platform: /etc/ssl/certs, /etc/pki/ca-trust/extracted/pem, /etc/pki/tls/certs, /usr/share/ca-certificat
s/cacert.org, /etc/ansible. The exception msg was: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)."}
INFO interface: detail: fatal: [k8s-master]: FAILED! => {"changed": false, "msg": "Failed to validate the SSL certificate for packages.cloud.google.com:443. Make sure your managed systems have a valid CA certificate installed. You can use validate_certs=False if you do not need to confirm the servers identity but this is unsafe and not recommended. Paths checked for this platform: /etc/ssl/certs, /etc/pki/ca-trust/extracted/pem, /etc/pki/tls/certs, /usr/share/ca-certificates/cacert.org, /etc/ansible. The exception msg was: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)."}

: API error (404): network hlfv11_hyperledger not found

✖ Starting business network definition. This may take a minute...
Error: Error trying to start business network. Error: No valid responses from any peers.
Response from attempted peer comms was an error: Error: failed to execute transaction b5c260c02b4792c4ae4b85b3d4ccb4565a495da399d27917dccc1a84244e631f: error starting container: error starting container: API error (404): network hlfv11_hyperledger not found
Response from attempted peer comms was an error: Error: failed to execute transaction b5c260c02b4792c4ae4b85b3d4ccb4565a495da399d27917dccc1a84244e631f: error starting container: error starting container: API error (404): network hlfv11_hyperledger not found
This looks like it is a Docker problem trying to start a new ChainCode container on a Docker Network bridge called "hlfv11_hyperledger" which doesn't exist.
(The word 'network' here is ambiguous in the error message :-( )
This is the same problem and hopefully the same solution as a previous post.

RabbitMQ (OSX) : ERROR: epmd error for host x1-6-20-0c-c8-19-6b-bd: timeout (timed out)

I'm working on OSX 10.10.5 and installed RabbitMQ using the tarball.
Running it via the script :
bash sbin/rabbitmq-server
The first time it ran, but after a restart, it is giving out this error :
ERROR: epmd error for host x1-6-20-0c-c8-19-6b-bd: timeout (timed out)
sbin/rabbitmqctl status returns this :
Status of node 'rabbit#x1-6-20-0c-c8-19-6b-bd' ...
Error: unable to connect to node 'rabbit#x1-6-20-0c-c8-19-6b-bd': nodedown
DIAGNOSTICS
===========
attempted to contact: ['rabbit#x1-6-20-0c-c8-19-6b-bd']
rabbit#x1-6-20-0c-c8-19-6b-bd:
* unable to connect to epmd (port 4369) on x1-6-20-0c-c8-19-6b-bd: timeout (timed out)
current node details:
- node name: 'rabbitmq-cli-25#x1-6-20-0c-c8-19-6b-bd'
- home dir: /Users/mohit
- cookie hash: FOxL2w3eJGpNkenIS5ebSw==
Please help me resolve this, thanks!
Update : Interestingly it works when i switch back to my personal network from the office network. Possibly something to do with port / network firewall?
Add a configuration file:
/etc/rabbitmq/rabbitmq-env.conf
Add a line as below:
NODENAME=rabbit#localhost

Error converging ubuntu1604 on a mac

I am trying to create and after that converge a kitchen-dokken ubuntu-1604 image on a mac but I can't seem to get it working.
I have searched for three hours and that I know now is that it is because of systemd, that is only or mainly available for GNU/Linux.
I am using kitchen-dokken by someara because I couldn't create a test kitchen for ubuntu1604 with docker in the first place.
Here is the stacktrace:
my-mac:kitchen-dokken-master <user>$ kitchen create dokken-test-1251-ubuntu-1604
-----> Starting Kitchen (v1.11.1)
-----> Creating <dokken-test-1251-ubuntu-1604>...
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: 1 actions failed.
>>>>>> Failed to complete #create action: [oci runtime error: exec: "/usr/lib/
systemd/systemd": stat /usr/lib/systemd/systemd: no such file or directory
] on dokken-test-1251-ubuntu-1604
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration
Can anybody tell me how I can do this on a mac or do I need to find another solution, like switching to Linux? Or someone to point me in the right direction.
I am glad for every comment or answer for this is driving me insane.

How see what exactly cookbook were uploaded fail?

I try to upload cookbook with dependencies, here is a log:
[root#redhat cookbooks]# knife cookbook upload reference-app --include-dependencies
Uploading my-cookbook [0.1.0]
Uploading maven [1.2.0]
Uploading hipsnip-jetty [0.9.0]
Uploading ark [0.9.0]
Uploading java [1.29.0]
Uploading windows [1.34.8]
Uploading 7-zip [1.0.2]
Uploading chef_handler [1.1.6]
WARNING: Uploaded 8 cookbooks ok but 2 cookbooks upload failed.
It is all log. Is there a way to sse what cookbook were failed exactly?
Using the verbose flag will show you why it didn't upload correctly.
For instance I added some bad code to the apt cookbook...
[scarman#coldlight cookbooks]$ knife cookbook upload apt --include-dependencies -n -V
Uploading apt [2.6.0]
INFO: Validating ruby files
FATAL: Cookbook file recipes/default.rb has a ruby syntax error:
FATAL: /home/scarman/DevOps/cookbooks/apt/recipes/default.rb:29: `##' is not allowed as an instance variable name
FATAL: /home/scarman/DevOps/cookbooks/apt/recipes/default.rb:29: syntax error, unexpected end-of-input, expecting '('
FATAL: uha897*#S::##!!
FATAL: ^
And also turned my internet off for a moment...
[scarman#coldlight cookbooks]$ knife cookbook upload apt --include-dependencies -n -V
ERROR: Error connecting to https://api.opscode.com/organizations/cls-chef/cookbooks?num_versions=all, retry 1/5
ERROR: Error connecting to https://api.opscode.com/organizations/cls-chef/cookbooks?num_versions=all, retry 2/5
ERROR: Error connecting to https://api.opscode.com/organizations/cls-chef/cookbooks?num_versions=all, retry 3/5
ERROR: Error connecting to https://api.opscode.com/organizations/cls-chef/cookbooks?num_versions=all, retry 4/5
ERROR: Error connecting to https://api.opscode.com/organizations/cls-chef/cookbooks?num_versions=all, retry 5/5
ERROR: Network Error: Error connecting to https://api.opscode.com/organizations/cls-chef/cookbooks?num_versions=all - getaddrinfo: Name or service not known
Check your knife configuration and network settings
That should hopefully provide you with more insight as to why it's failing.

Resources