It appears I'm unable to use erb in the .kitchen.yml when using the ENV var on Windows platforms.
$ kitchen list
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::UserError
>>>>>> Message: Error parsing C:/Users/anonymous/.kitchen.yml as YAML.
Please run `kitchen diagnose --no-instances --loader' to help debug your issue.
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration
.kitchen.yml
---
driver:
name: vagrant
synced_folders:
- [<%= ENV['PWD'] %>, '/tmp/foo']
provisioner:
name: chef_zero
platforms:
- name: ubuntu-16.04
suites:
- name: default
ENV
$ chef -v
Chef Development Kit Version: 2.4.17
chef-client version: 13.6.4
delivery version: master (73ebb72a6c42b3d2ff5370c476be800fee7e5427)
berks version: 6.3.1
kitchen version: 1.19.2
inspec version: 1.45.13
This works fine on my Ubuntu 16.04 machine, using the same file and software versions.
I believe this is related to a similar issue reported on the cucumber/aruba project ~ https://github.com/cucumber/aruba/issues/291
I tried submitting a new issue to the test-kitchen project but they refer me to their contributing guidelines which just goes over a release process. Since I'm unable to submit a new issue I've come to SO hoping for either some clarity or a work around.
The problem is likely that after the Erb replacement, this would look like - [C:\Users\anonymous, '/tmp/foo']. The : in there is an important YAML syntax character. The simple solution would be - ["<%= ENV['PWD'] %>", '/tmp/foo'] or - [<%= ENV['PWD'].to_json %>, '/tmp/foo'] (JSON is a subset of YAML).
Related
Hi I currently try to deploy my react app to AWS Elastic Bean Stalk through travis CI. But it fail.. what should I change in my travis yml??
Here is my .travis.yml
sudo: required
services:
- docker
before_install:
- docker build -t sample:dev .
script:
- docker run -e CI=true sample:dev npm run test -- --coverage
deploy:
provider: elasticbeanstalk
region: "us-west-1"
app: "my-app"
env: "MyApp-env"
bucket_name: "xxxx"
bucket_path: "xxx"
on:
branch: master
access_key_id: $AWS_ACCESS_KEY
secret_access_key:
secure: "$AWS_SECRET_KEY"
But I failed to deploy it in aws elastic bean stalk. Here is the message from travis ci:
The command "docker run -e CI=true sample:dev npm run test -- --coverage" exited with 0.
dpl_0
1.27s$ rvm $(travis_internal_ruby) --fuzzy do ruby -S gem install dpl
dpl.1
Installing deploy dependencies
Successfully installed jmespath-1.4.0
Successfully installed aws-eventstream-1.0.3
Successfully installed aws-sigv4-1.1.1
NEWER VERSION AVAILABLE: Please upgrade to AWS SDK For Ruby V3
Successfully installed aws-sdk-core-2.11.471
NEWER VERSION AVAILABLE: Please upgrade to AWS SDK For Ruby V3
Successfully installed aws-sdk-resources-2.11.471
NEWER VERSION AVAILABLE: Please upgrade to AWS SDK For Ruby V3
Successfully installed aws-sdk-2.11.471
Successfully installed rubyzip-1.3.0
Successfully installed dpl-elastic_beanstalk-1.10.15
8 gems installed
!!! AWS Elastic Beanstalk support is experimental !!!
dpl.2
Preparing deploy
Cleaning up git repository with git stash --all. If you need build artifacts for deployment, set deploy.skip_cleanup: true. See https://docs.travis-ci.com/user/deployment#Uploading-Files-and-skip_cleanup.
No local changes to save
NEWER VERSION AVAILABLE: Please upgrade to AWS SDK For Ruby V3
dpl.3
Deploying application
No stash entries found.
/home/travis/.rvm/gems/ruby-2.4.5/gems/aws-sdk-core-2.11.471/lib/seahorse/client/plugins/raise_response_errors.rb:15:in call': The request signature we calculated does not match the signature you provided. Check your key and signing method. (Aws::S3::Errors::SignatureDoesNotMatch)
from /home/travis/.rvm/gems/ruby-2.4.5/gems/aws-sdk-core-2.11.471/lib/aws-sdk-core/plugins/s3_sse_cpk.rb:19:incall'
from /home/travis/.rvm/gems/ruby-2.4.5/gems/aws-sdk-core-2.11.471/lib/aws-sdk-core/plugins/s3_dualstack.rb:24:in call'
from /home/travis/.rvm/gems/ruby-2.4.5/gems/aws-sdk-core-2.11.471/lib/aws-sdk-core/plugins/s3_accelerate.rb:34:incall'
from /home/travis/.rvm/gems/ruby-2.4.5/gems/aws-sdk-core-2.11.471/lib/aws-sdk-core/plugins/jsonvalue_converter.rb:20:in call'
from /home/travis/.rvm/gems/ruby-2.4.5/gems/aws-sdk-core-2.11.471/lib/aws-sdk-core/plugins/idempotency_token.rb:18:incall'
from /home/travis/.rvm/gems/ruby-2.4.5/gems/aws-sdk-core-2.11.471/lib/aws-sdk-core/plugins/param_converter.rb:20:in call'
from /home/travis/.rvm/gems/ruby-2.4.5/gems/aws-sdk-core-2.11.471/lib/seahorse/client/plugins/response_target.rb:21:incall'
from /home/travis/.rvm/gems/ruby-2.4.5/gems/aws-sdk-core-2.11.471/lib/seahorse/client/request.rb:70:in send_request'
from /home/travis/.rvm/gems/ruby-2.4.5/gems/aws-sdk-core-2.11.471/lib/seahorse/client/base.rb:207:inblock (2 levels) in define_operation_methods'
from /home/travis/.rvm/gems/ruby-2.4.5/gems/aws-sdk-resources-2.11.471/lib/aws-sdk-resources/request.rb:24:in call'
from /home/travis/.rvm/gems/ruby-2.4.5/gems/aws-sdk-resources-2.11.471/lib/aws-sdk-resources/operations.rb:41:incall'
from /home/travis/.rvm/gems/ruby-2.4.5/gems/aws-sdk-resources-2.11.471/lib/aws-sdk-resources/operation_methods.rb:19:in block in add_operation'
from /home/travis/.rvm/gems/ruby-2.4.5/gems/dpl-elastic_beanstalk-1.10.15/lib/dpl/provider/elastic_beanstalk.rb:131:inupload'
from /home/travis/.rvm/gems/ruby-2.4.5/gems/dpl-elastic_beanstalk-1.10.15/lib/dpl/provider/elastic_beanstalk.rb:49:in push_app'
from /home/travis/.rvm/gems/ruby-2.4.5/gems/dpl-1.10.15/lib/dpl/provider.rb:199:inblock in deploy'
from /home/travis/.rvm/gems/ruby-2.4.5/gems/dpl-1.10.15/lib/dpl/cli.rb:41:in fold'
from /home/travis/.rvm/gems/ruby-2.4.5/gems/dpl-1.10.15/lib/dpl/provider.rb:199:indeploy'
from /home/travis/.rvm/gems/ruby-2.4.5/gems/dpl-1.10.15/lib/dpl/cli.rb:32:in run'
from /home/travis/.rvm/gems/ruby-2.4.5/gems/dpl-1.10.15/lib/dpl/cli.rb:7:inrun'
from /home/travis/.rvm/gems/ruby-2.4.5/gems/dpl-1.10.15/bin/dpl:5:in <top (required)>'
from /home/travis/.rvm/gems/ruby-2.4.5/bin/dpl:23:inload'
from /home/travis/.rvm/gems/ruby-2.4.5/bin/dpl:23:in `'
failed to deploy
Based on the new version of Travis CI, following lines code, you need to update
secret_access_key:
secure: "$AWS_SECRET_KEY"
Change it to :
secret_access_key: "$AWS_SECRET_KEY"
Alse need to add "skip_cleanup: true" under deploy:
Because Travis CI now consider default variable as secure.
Looking at the first error from your output:
call': The request signature we calculated does not match the signature you provided. Check your key and signing method. (Aws::S3::Errors::SignatureDoesNotMatch)
I got the same error and it was caused by a mismatch on the access_key_id and secret_access_key. I resolved it by running:
travis encrypt --add deploy.access_key_id <access_key_id>
travis encrypt --add deploy.secret_access_key <secret_access_key>
I am experiencing issue with Phantomjs headless automation testing on linux. We are using Jenkins as our CI server. However, we are getting the error below:
phantomjs://platform/console++.js:263 in error
[ERROR - 2016-12-09T19:45:12.372Z] WebElementLocator -
_handleLocateCommand - Element(s) NOT Found: GAVE UP.
Search Stop Time: 1481312712354
phantomjs://platform/console++.js:263 in error
How we start phantomjs:
phantomjs --webdriver=8001
Environment:
Phantomjs: 2.1.1
Jenkins: 1.598
Linux: Linux xxx1247 2.6.32-573.12.1.el6.x86_64
Ruby: 1.9.3
Cucumber: 2.1.4
Selenium-webdriver: 2.53
Please share your solution. Thanks!
There can be a few causes for this. One of them can be that the get action to the Web URL failed. That means you are operating on an empty result, which will throw that error.
Since the webpage is not fetched, the element will not be there.
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.
I have a Jekyll blog which I'm trying to push to an AWS S3 bucket. I have followed this tutorial.
The build keeps failing. Wercker gives me the following error message:
Build failed on master
setup environment
GET https://registry.hub.docker.com/v1/repositories/wercker/ruby/images returned 404
It the displays my wercker.yml file:
box: wercker/ruby
no-response-timeout: 10
build:
steps:
- bundle-install
- script:
name: Run Jekyll doctor
code: bundle exec jekyll doctor
- script:
name: Build Jekyll site
code: bundle exec jekyll build --trace
deploy:
steps:
- s3sync:
key_id: $AWS_ACCESS_KEY_ID
key_secret: $AWS_SECRET_ACCESS_KEY
bucket_url: $AWS_BUCKET_URL
source_dir: _site/
opts: --acl-public --add-header=Cache-Control:max-age=3600
I'm out of my depth here. Google is only returning other Wercker pages with the same error message. What is causing the error? What steps do I need to take to fix this?
Here's a link to the error page itself.
Any help would be appreciated! Thanks.
Solved!
It appears that the tutorial is outdated.
I needed to update wercker.yml to work with Wercker v2.
To do this, I changed:
box: wercker/ruby
to
box: ruby.
I am having some problems trying to bootstrap a windows node for Chef. This node was initially able to be partially bootstrapped, it was getting through most of the process but however, failing near the end - on the windows client itself I can see a number of expected files under C:\Chef
However since upgrading my Ruby and Knife-Windows to remedy the original issue - I am now not able to bootstrap at all, I get the error below:
chefadmin#AUK-CHEFMGT1:~$ knife bootstrap windows winrm 10.28.154.61 -x chefadmin -P xxxxxx
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/mixin/path_sanity.rb:25:
warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777
Waiting for remote response before bootstrap.10.28.154.61 .
10.28.154.61 Response received.
Remote node responded after 0.01 minutes.
Bootstrapping Chef on 10.28.154.61
ERROR: RuntimeError: Knife-Windows < 1.0 does not support validatorless bootstraps
I've tried a few different versions of knife-windows, initially 1.1.1, and most recently the pre-release version of 1.0.0 rc1, however, they are all giving me this error.
I am not sure why this is a problem, as the validation.pem does exist on the windows client in C:\Chef\
In case it matters, here is my knife.rb config file:
chefadmin#AUK-CHEFMGT1:~$
GNU nano 2.2.6 File: /home/chefadmin/chef-repo/.chef/knife.rb
current_dir = File.dirname(__FILE__)
log_level :info
log_location STDOUT
node_name "chefadmin"
client_key "#{current_dir}/ChefRSA.pem"
validation_client_name "company"
validation_key "#{current_dir}/companyvalidator"
chef_server_url "https://10.28.253.101/organizations/company"
syntax_check_cache_path "#{ENV['HOME']}/.chef/syntaxcache"
cookbook_path ["#{current_dir}/../cookbooks"]
"#{current_dir}/companyvalidator" Does that file exist? Usually that would be something ending in .pem. If that path isn't a thing, it would fall back to new-style bootstrapping which I don't think works on Windows yet.