I have two systems, one running Ubuntu 11.04 and one running 10.04 LTS. The same configuration on both machine yields different results. The 10.04LTS machine is unable to find my AWS credential files.
On 11.04
export | grep EC2
declare -x EC2_CERT="/home/jdw/.ec2/cert-PJU5MW2PCN24SKPOIVFTWCMBUXWWZO7U.pem"
declare -x EC2_HOME="/opt/ec2-ami-tools-1.3-66634"
declare -x EC2_PRIVATE_KEY="/home/jdw/.ec2/pk-PJU5MW2PCN24SKPOIVFTWCMBUXWWZO7U.pem"
ls -al /home/jdw/.ec2/
total 16
drwxr-xr-x 2 jdw jdw 4096 2011-08-18 13:31 .
drwxr-xr-x 58 jdw jdw 4096 2011-09-23 10:24 ..
-rw-r--r-- 1 jdw jdw 916 2011-08-18 13:30 cert-PJU5MW2PCN24SKPOIVFTWCMBUXWWZO7U.pem
-rw-r--r-- 1 jdw jdw 928 2011-08-18 13:30 pk-PJU5MW2PCN24SKPOIVFTWCMBUXWWZO7U.pem
/usr/bin/ec2-consistent-snapshot --description "Autosnapshot root" vol-283d5246 --region us-west-1 snap-0c679a62
On 10.04 LTS
export | grep EC2
declare -x EC2_CERT="/root/.ec2/cert-PJU5MW2PCN24SKPOIVFTWCMBUXWWZO7U.pem"
declare -x EC2_HOME="/mnt/ec2-api-tools-1.4.4.2"
declare -x EC2_PRIVATE_KEY="/root/.ec2/pk-PJU5MW2PCN24SKPOIVFTWCMBUXWWZO7U.pem"
ls -al /root/.ec2
total 16
drwxr-xr-x 2 root root 4096 2011-09-23 10:50 .
drwx------ 8 root root 4096 2011-09-23 10:50 ..
-rw-r--r-- 1 root root 916 2011-09-23 10:11 cert-PJU5MW2PCN24SKPOIVFTWCMBUXWWZO7U.pem
-rw-r--r-- 1 root root 928 2011-09-23 10:47 pk-PJU5MW2PCN24SKPOIVFTWCMBUXWWZO7U.pem
/usr/bin/ec2-consistent-snapshot --description "Autosnapshot root" vol-283d5246 --region us-west-1 ec2-consistent-snapshot: ERROR: Can't find AWS access key or secret access key at /usr/bin/ec2-consistent-snapshot line 97.
I assume I am missing some dependency on the 10.04 box but have not had any luck finding what it might me. The only dependency I have run across is the PERL_MM_USE_DEFAULT=1 cpan Net::Amazon::EC2 which is present on both machines.
Further information.
It seems that despite having my environment variables set correctly, ec2-consistent-snapshot is looking for my key in a file named .awssecret
open("/root/.awssecret", O_RDONLY) = -1 ENOENT (No such file or directory) write(2, "ec2-consistent-snapshot: ERROR: "..., 124) = 124 exit_group(2) = ? ~
And it appears that providing the credentials from the command line truncates the credential names:
execve("/usr/bin/ec2-consistent-snapshot", ["/usr/bin/ec2-consistent-snapshot", "--aws-access-key-id-file", "/root/.ec2/cert-PJU5MW2PCN44GRAV"..., "--aws-secret-access-key-file", "/root/.ec2/pk-PJU5MW2PCN44GRAVIV"..., "--description", "Autosnapshot SMC root ", "vol-283d5446", "--region", "us-west-1"], [/* 21 vars */]) = 0
I have attempted using shorter names and the name .awssecret for the pem files and this removes the 'cannot find' condition, but it results in a 'cannot validate the credentials' error. I therefore feel that resolving the main error will quite likely resolve the secondary one.
I'm positive this is some missing library or something on my 10.04 system.