Signature version 4 authentication failed while uploading bundle - amazon-web-services

I receive an error when running the following command on AWS CLI
Command
$EC2_AMITOOL_HOME/bin/ec2-upload-bundle -b my-s3-bucket/bundle_folder/bundle_name -m /tmp/image.manifest.xml -a AKIAJKHXU4GRYW7KPDBQ -s IGaclJWIIjT7ixyb2gXPfJ8Z00U469Urt5DzGhaJ
Error
Signature version 4 authentication failed, trying different signature
version ERROR: Error talking to S3: Server.NotImplemented(501): A
header you provided implies functionality that is not implemented
I have allowed the full permission to the user but still getting this error
I have ran this command before the above command
Command:
$EC2_AMITOOL_HOME/bin/ec2-bundle-vol -k /tmp/ce rt/Cpanel.pem -c /tmp/cert/certificate.pem -u 589680520298 -r x86_64 -e /tmp/cer t --partition gpt
It ran successfully and I have successfully generated image.manifest.xml
Manual Reference: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/create-instance-store-ami.html#amazon_linux_instructions

Please Provide Correct region of your bucket to authentication array this problem will be resolved.

Related

Unable to Create Pod in Minikube Error: unknown shorthand flag

$ minikube kubectl create -f hello-app-deployment.yaml
Error: unknown shorthand flag: 'f' in -f
See 'minikube kubectl --help' for usage.
enter image description here
where hello-app-deployment.yaml is the deployment manifest file being saved in a working directory.
I tried saving the same manifest file in my home directory, but encountering the same ERROR.
Is there any minikube or kubectl libaries missing ?
I would say, try installing the kubectl CLI and try with this command
kubectl apply -f ~/<filepath>
You can download the tool from the official website:
https://kubernetes.io/docs/tasks/tools/

AWS CDK installation issue

I have tried to install AWS CDK in my local system, using this command "npm install -g aws-cdk" getting installed successfully, but when I am checking version with cdk --version i am getting Microsoft JScript compilation error
Script : C:\Users\170905\AppData\Roaming\npm\node_modules\aws-cdk\bin\cdk.js
Line: 1
Char: 1
Error: Invalid Character
Code: 800A03F6
Source: Microsoft Jscript compilation error
set the path using below command and try.
**setx PATH "C:\Users\<username>\AppData\Roaming\npm"**
or directly navigate to this path and open cmd. It will work.

Jenkins - bash: aws: command not found but runs fine from terminal

In Build Step, I've added Send files or execute command over SSh -> SSH Publishers -> Exec command, I'm trying to run aws command to copy file from ec2 to s3. The same command runs fine when I execute it over the terminal, but via jenkins it simply returns:
bash: aws: command not found
The command is
cd ~/.local/bin/ && aws s3 cp /home/ec2-user/lambda_test/lambda_function.zip s3://temp-airflow-us/lambda_function.zip
Based on the comments.
The solution was to use the following command:
cd ~/.local/bin/ && ./aws s3 cp /home/ec2-user/lambda_test/lambda_function.zip s3://temp-airflow-us/lambda_function.zip
since aws is not available in PATH env variable.
command not found indicates that the aws utility is not on $PATH for the jenkins user.
To confirm, sudo su -l jenkins and then issue the command which aws - this will most likely return no results.
You have two options:
use the full path (likely /usr/local/bin/aws)
add /usr/local/bin to the jenkins user's $PATH
I need my Makefile to work in both Linux and Windows so the accepted answer is not an option for me.
I diagnosed the problem by adding the following to the top of my build script:
whoami
which aws
env|grep PATH
This returned:
root
which: no aws in (/sbin:/bin:/usr/sbin:/usr/bin)
PATH=/sbin:/bin:/usr/sbin:/usr/bin
Bizarrely, the path does not include /usr/local/bin, even though the interactive shell on the Jenkins host includes it. The fix is simple enough, create a symlink on the Jenkins host:
ln -s /usr/local/bin/aws /bin/aws
Now the aws command can be found by scripts running in Jenkins (in /bin).

Hyperledger Fabric My first network

I am trying to work on my first network in Hyperledger Fabric. Using the following documentation http://hyperledger-fabric.readthedocs.io/en/latest/build_network.html
I have completed the setup till http://hyperledger-fabric.readthedocs.io/en/latest/build_network.html#create-join-channel but when I run the
peer channel create -o orderer.example.com:7050 -c $CHANNEL_NAME -f ./channel-artifacts/channel.tx --tls $CORE_PEER_TLS_ENABLED --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
I got hte following error:
Error: Got unexpected status: BAD_REQUEST
In attempt to resolve i follow the solution given at First network in hyperledger but faced error on running
/bin/bash -c './scripts/script.sh ${CHANNEL_NAME}; sleep $TIMEOUT'
I brought my network down using
./bfyn.sh -m down
and bring the network up that gave me following error:
ERROR: for orderer.example.com Cannot start service orderer.example.com: oci runtime error: container_linux.go:265: starting container process caused "process_
linux.go:368: container init caused \"rootfs_linux.go:57: mounting \\"/c/Users/lenovo/fabric-samples/first-network/channel-artifacts/genesis.block\\" to rootfs \\"/mnt/sda1/var/lib/docker/aufs/mnt/16c8954b277dec9a00370bdaa4316db282759b3dd6892ffc25f860a4c9e06d58\\" at\"/mnt/sda1/var/lib/docker/aufs/mnt/16c8954b277dec9a00370bdaa4316db282759b3dd6892ffc25f860a4c9e06d58/var/hyperledger/orderer/orderer.genesis.block\\" caused \\"not a directory\\"\"":Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type ERROR: Encountered errors while bringing up the project.
ERROR !!!! Unable to start network
Error response from daemon: No such container: cli
Delete as admin the channel-artifacts folder, down the network and restart it. Your error must be related to an error at channel-artifacts generation.
You need to be in /c/users when you run the curl command, as documented here.
Continue on with other setup instructions
also, please make sure you run your docker command prompt in administrator mode.

chef zero via AWS userdata fails

When running chef zero via AWS userdata, the run always fails. However, if I ssh onto the machine and manually execute the same commands, it works as expected. This is the output that I get:
Chef: 11.12.8
[2014-06-11T12:40:34+00:00] INFO: Auto-discovered chef repository at /opt/chef-zero
[2014-06-11T12:40:34+00:00] INFO: Starting chef-zero on port 8889 with repository at repository at /opt/chef-zero
One version per cookbook
[2014-06-11T12:40:34+00:00] INFO: Forking chef instance to converge...
[2014-06-11T12:40:35+00:00] DEBUG: Fork successful. Waiting for new chef pid: 1530
[2014-06-11T12:40:35+00:00] DEBUG: Forked instance now converging
[2014-06-11T12:40:35+00:00] ERROR: undefined method `[]' for nil:NilClass
[2014-06-11T12:40:35+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
The userdata that I set when launching the EC2 instance in AWS includes the following:
curl -L https://www.opscode.com/chef/install.sh | bash
mkdir /opt/chef-zero
cd /opt/chef-zero
wget http://myserver/chef-repo.tar.gz
tar zxf chef-repo
INSTANCE_ID=`curl http://169.254.169.254/latest/meta-data/instance-id`
cat <<EOF > /opt/chef-zero/solo.rb
ssl_verify_mode :verify_peer
node_name "$INSTANCE_ID"
EOF
/opt/chef/bin/chef-client -v >chef-zero.log 2>&1
/opt/chef/bin/chef-client -z -l debug -c solo.rb -o 'role[someRole]' -E BUILD >> chef-zero.log 2>&1
The AMI that I'm using is a custom one that was initially provisioned using knife + knife-ec2 (that bootstrapped chef 11.6.0 from an ubuntu 13.04 public ami). The omnibus installer from userdata (curl ... | bash) is upgrading chef to 11.12.8. The original knife run included chef-client::service in it's run, and the host is initially configured for use with chef-client + chef-server (i.e. there's a "validation.pem" and "client.rb" in /etc/chef - not sure if that makes a difference).
I am able to log onto the machine and execute chef-client -z -c solo.rb -o 'role[someRole]' -E BUILD as soon as the machine comes up (after waiting for files to be retrieved and the user-data chef-client to fail) and the chef run executes normally.
I have no idea why the userdata chef-client run fails with undefined method, any ideas what's causing it?
After some further investigation, and thanks to bit of chatting with the #chef guys on freenode, the problem was narrowed down to the environment.
When executing the script with userdata, the "HOME" variable is not set. shell.rb from the chef gem is littered with references to ENV["HOME"].
SSH:
# unset HOME
# chef-client -z -o 'role[test]'
ERROR: undefined method `[]' for nil:NilClass
# export HOME=/root
# chef-client -z -o 'role[test]'
Starting Chef Client, version ....
...
Chef Client finished, ...
If you need to execute chef-client via user data, you should manually export HOME before trying to execute chef.
Bug has been reported at https://tickets.opscode.com/browse/CHEF-5365
edit
Submitted a pull request which has since been merged into master. https://github.com/opscode/chef/pull/1494
This likely has nothing to do with chef-zero but indicates a problem in your recipe code (whatever's inside that chef-repo.tar.gz, or is driven by role[someRole]). It indicates an attempt to access a sub-element of a hash like
node['foo']['bar']
but when node['foo'] is nil (undefined)
Check the stacktrace that's generated by the chef client run to narrow it down.