Code Monkey home page Code Monkey logo

Comments (39)

neillturner avatar neillturner commented on August 23, 2024 1

that's good reproduced problem. check the ownerid is correct by listing the snapshots in the console or ec2dream

from puppet-aws_helper.

neillturner avatar neillturner commented on August 23, 2024

you will need to do some debugging.
in awshelper/cli.rb
code is:

def snap_email(to, from, email_server, subject='EBS Backups')
rows = 20
rows = options[:rows] if options[:rows]
owner = {}
owner = {:aws_owner => options[:owner]} if options[:owner]

add an extra line
puts "*** owner #{owner}"
to see what owner is set to.
i expect owner has been set somehow and you probably need to remove
owner = {:aws_owner => options[:owner]} if options[:owner
the code was taken from somewhere else so has extra code in it.

from puppet-aws_helper.

Dharmender-Singh avatar Dharmender-Singh commented on August 23, 2024

Thanks Neill.

I have added "puts "*** owner #{owner}" but nothing is printing. Also, if I removed the line which you have mentioned than a list of all snapshots (Public,private) is coming in the mail.

Any suggestion ?

from puppet-aws_helper.

neillturner avatar neillturner commented on August 23, 2024

well owner must be set you just need to get the info.
look at the bash script calling aws_helper snap_email [email protected] [email protected] emailserver.com 'My EBS Backups' --rows=20 -owner=999887777
do you have -owner specified.

from puppet-aws_helper.

Dharmender-Singh avatar Dharmender-Singh commented on August 23, 2024

Yes, I am specifying the owner. If I exclude the owner option its working fine but include all snapshots (public, private) in the mail.

from puppet-aws_helper.

neillturner avatar neillturner commented on August 23, 2024

trying changing
owner = {:aws_owner => options[:owner]}
to
owner = {:aws_owner => [options[:owner]]}

cheers
neill

and can you check that the owner you specify exists. -)

from puppet-aws_helper.

Dharmender-Singh avatar Dharmender-Singh commented on August 23, 2024

It's throwing same error after changing this.

from puppet-aws_helper.

neillturner avatar neillturner commented on August 23, 2024

i would change it back. i would check the owner that you are passing in. What changed that caused this problem to start happening. Did anyone change permissions of the keys, or owners or anything like that.

from puppet-aws_helper.

Dharmender-Singh avatar Dharmender-Singh commented on August 23, 2024

I am using Centos 7.2 now. I think that's the only change.

from puppet-aws_helper.

neillturner avatar neillturner commented on August 23, 2024

well i don't have enough info to see what's wrong, i assume you are using the standard centos 7.2 image. As i don't have info i would need to reproduce and test, need to find time to do that.

from puppet-aws_helper.

Dharmender-Singh avatar Dharmender-Singh commented on August 23, 2024

Thanks Neil. But we are not using standard Image. Let me know your result once you are done.

from puppet-aws_helper.

neillturner avatar neillturner commented on August 23, 2024

i would go to your test environment and just create a server with the aws_helper support on say centos 7 and then test it. try and reproduce problem in test.

from puppet-aws_helper.

Dharmender-Singh avatar Dharmender-Singh commented on August 23, 2024

Hi,

How you can create a server on our test environment? . If I am not wrong,
you can't access anything.

-Dharmender

On Thu, May 19, 2016 at 10:05 AM, Neill Turner [email protected]
wrote:

i would go to your test environment and just create a server with the
aws_helper support on centos 7 and then test it.


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#1 (comment)

from puppet-aws_helper.

neillturner avatar neillturner commented on August 23, 2024

i mean you reproduce problem in your test environment -)

from puppet-aws_helper.

Dharmender-Singh avatar Dharmender-Singh commented on August 23, 2024

Hi Neil,

I am getting the same error on the test environment.
"/usr/local/share/gems/gems/right_aws-3.1.0/lib/awsbase/right_awsbase.rb:568:in `request_info_impl': UnknownParameter: The parameter AwsOwner is not recognized (RightAws::AwsError)"

Could you please look into this.

from puppet-aws_helper.

neillturner avatar neillturner commented on August 23, 2024

Well that just says in right_aws we got an error. need do add some debug messages top see what AWS API command is wrong

from puppet-aws_helper.

Dharmender-Singh avatar Dharmender-Singh commented on August 23, 2024

If you can point the file name and line number, I can do that.

-Dharmender

from puppet-aws_helper.

neillturner avatar neillturner commented on August 23, 2024

Write a little test program and get it to work

test.rb

  require 'right_aws'
  owner = {:aws_owner => '99999999'}   # where 99999999 is owner id 
  aws_access_key= xxxxxxxxx
  aws_secret_access_key = yyyyyyyyyyy
  ec2 = RightAws::Ec2.new(aws_access_key,aws_secret_access_key, {:region => 'eu-west-1'})  
  ec2.describe_snapshots(owner).sort { |a,b| b[:aws_started_at] <=> a[:aws_started_at] }.each do |snapshot|
    puts "#{snapshot[:aws_id]} #{snapshot[:aws_volume_id]} #{snapshot[:aws_started_at]} #{snapshot[:aws_description]} #{snapshot[:aws_status]}\n"
  end

from puppet-aws_helper.

Dharmender-Singh avatar Dharmender-Singh commented on August 23, 2024

[root@praewbappp004v tmp]# ruby test.rb
I, [2016-08-15T09:41:50.557319 #8644] INFO -- : New RightAws::Ec2 using shared connections mode
I, [2016-08-15T09:41:50.557792 #8644] INFO -- : Opening new HTTPS connection to eu-west-1.ec2.amazonaws.com:443
W, [2016-08-15T09:41:55.567141 #8644] WARN -- : Rightscale::HttpConnection : request failure count: 1, exception: #<Net::OpenTimeout: execution expired>
I, [2016-08-15T09:41:55.567248 #8644] INFO -- : Opening new HTTPS connection to eu-west-1.ec2.amazonaws.com:443
W, [2016-08-15T09:42:00.568014 #8644] WARN -- : Rightscale::HttpConnection : request failure count: 2, exception: #<Net::OpenTimeout: execution expired>
I, [2016-08-15T09:42:00.580320 #8644] INFO -- : Opening new HTTPS connection to eu-west-1.ec2.amazonaws.com:443
W, [2016-08-15T09:42:05.581083 #8644] WARN -- : Rightscale::HttpConnection : request failure count: 3, exception: #<Net::OpenTimeout: execution expired>
I, [2016-08-15T09:42:05.581204 #8644] INFO -- : Opening new HTTPS connection to eu-west-1.ec2.amazonaws.com:443
W, [2016-08-15T09:42:10.581973 #8644] WARN -- : Rightscale::HttpConnection : request failure count: 4, exception: #<Net::OpenTimeout: execution expired>
W, [2016-08-15T09:42:10.582083 #8644] WARN -- : Rightscale::HttpConnection : re-raising same error: https://eu-west-1.ec2.amazonaws.com:443 temporarily unavailable: (Net::OpenTimeout: execution expired) -- error count: 4, error age: 0
/usr/local/share/gems/gems/right_http_connection-1.5.0/lib/right_http_connection.rb:448:in block in request': https://eu-west-1.ec2.amazonaws.com:443 temporarily unavailable: (Net::OpenTimeout: execution expired) (RightAws::AwsError) from /usr/local/share/gems/gems/right_http_connection-1.5.0/lib/right_http_connection.rb:428:inloop'
from /usr/local/share/gems/gems/right_http_connection-1.5.0/lib/right_http_connection.rb:428:in request' from /usr/local/share/gems/gems/right_aws-3.1.0/lib/awsbase/right_awsbase.rb:548:inblock in request_info_impl'
from /usr/share/ruby/benchmark.rb:281:in measure' from /usr/local/share/gems/gems/right_aws-3.1.0/lib/awsbase/benchmark_fix.rb:30:inadd!'
from /usr/local/share/gems/gems/right_aws-3.1.0/lib/awsbase/right_awsbase.rb:546:in request_info_impl' from /usr/local/share/gems/gems/right_aws-3.1.0/lib/ec2/right_ec2.rb:157:inrequest_info'
from /usr/local/share/gems/gems/right_aws-3.1.0/lib/awsbase/right_awsbase.rb:582:in request_cache_or_info' from /usr/local/share/gems/gems/right_aws-3.1.0/lib/ec2/right_ec2.rb:181:indescribe_resources_with_list_and_options'
from /usr/local/share/gems/gems/right_aws-3.1.0/lib/ec2/right_ec2_ebs.rb:216:in describe_snapshots' from test.rb:6:in

'

from puppet-aws_helper.

neillturner avatar neillturner commented on August 23, 2024

looks like you are blocked by a firewall or security group.
try curl 'https://eu-west-1.ec2.amazonaws.com:443'
otherwise might be a timeout value that needs increasing

from puppet-aws_helper.

Dharmender-Singh avatar Dharmender-Singh commented on August 23, 2024

[root@ip-10-53-191-16 tmp]# curl 'https://eu-west-1.ec2.amazonaws.com:443'
[root@ip-10-53-191-16 tmp]#

from puppet-aws_helper.

neillturner avatar neillturner commented on August 23, 2024

you should get a response like
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0

i think you are being blocked somehow.

from puppet-aws_helper.

neillturner avatar neillturner commented on August 23, 2024

try setting the HTTP_PROXY and HTTPS_PROXY environment variables, i remember in your environment you have to use the proxy.

from puppet-aws_helper.

Dharmender-Singh avatar Dharmender-Singh commented on August 23, 2024

I have set these environment variables and getting following output from test file:

[root@ip-10-53-191-16 tmp]# ruby test.rb
I, [2016-08-16T08:44:04.191146 #26490] INFO -- : New RightAws::Ec2 using shared connections mode
I, [2016-08-16T08:44:04.191841 #26490] INFO -- : Opening new HTTPS connection to eu-west-1.ec2.amazonaws.com:443
I, [2016-08-16T08:44:04.191875 #26490] INFO -- : Connecting to proxy xx.xx.xxx.xxx:3128 with username nil
W, [2016-08-16T08:44:04.222950 #26490] WARN -- : ##### RightAws::Ec2 returned an error: 400 Bad Request

UnknownParameterThe parameter AwsOwner is not recognizedf06496d9-806d-44e2-b8a8-2b4cd2738eba #####
W, [2016-08-16T08:44:04.222996 #26490] WARN -- : ##### RightAws::Ec2 request: https://eu-west-1.ec2.amazonaws.com:443/?AWSAccessKeyId=xxxxxxxxxxxxxx&Action=DescribeSnapshots&AwsOwner.1=09xxxxxxxx&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2016-08-16T08%3A44%3A04.000Z&Version=2011-02-28&Signature=xxxxxxxxxxxxxxxxxxx ####
/usr/local/share/gems/gems/right_aws-3.1.0/lib/awsbase/right_awsbase.rb:568:in request_info_impl': UnknownParameter: The parameter AwsOwner is not recognized (RightAws::AwsError) from /usr/local/share/gems/gems/right_aws-3.1.0/lib/ec2/right_ec2.rb:157:inrequest_info'
from /usr/local/share/gems/gems/right_aws-3.1.0/lib/awsbase/right_awsbase.rb:582:in request_cache_or_info' from /usr/local/share/gems/gems/right_aws-3.1.0/lib/ec2/right_ec2.rb:181:indescribe_resources_with_list_and_options'
from /usr/local/share/gems/gems/right_aws-3.1.0/lib/ec2/right_ec2_ebs.rb:216:in describe_snapshots' from test.rb:6:in

'
[root@ip-10-53-191-16 tmp]#

from puppet-aws_helper.

neillturner avatar neillturner commented on August 23, 2024

if owernid is correct try without quotes owner = {:aws_owner => 99999999}
I wish test on my system tomorrow.

from puppet-aws_helper.

Dharmender-Singh avatar Dharmender-Singh commented on August 23, 2024

[root@ip-10-53-191-16 tmp]# ruby test.rb
test.rb:2: Invalid octal digit
owner = {:aws_owner => 0XXXXXXXX} # where 99999999 is owner id

from puppet-aws_helper.

neillturner avatar neillturner commented on August 23, 2024

ok i have a workaround try test.rb like this.

require 'right_aws'
aws_access_key= xxxxxxxxx
aws_secret_access_key = yyyyyyyyyyy
ec2 = RightAws::Ec2.new(aws_access_key,aws_secret_access_key, {:region => 'eu-west-1'})
ec2.describe_snapshots().sort { |a,b| b[:aws_started_at] <=> a[:aws_started_at] }.each do |snapshot|
if snapshot[:owner_id] = '9999999' then
puts "#{snapshot[:aws_id]} #{snapshot[:aws_volume_id]} #{snapshot[:aws_started_at]} #{snapshot[:aws_description]} #{snapshot[:aws_status]}\n"
end
end
i will update the aws_helper and release tomorrow. it is some bug somewhere in AWS so better to just workaround

from puppet-aws_helper.

Dharmender-Singh avatar Dharmender-Singh commented on August 23, 2024

@neillturner It's giving the list of all the snapshots. The filter of Owner ID didn't work.

from puppet-aws_helper.

neillturner avatar neillturner commented on August 23, 2024

Yes don't use the filter. Does the if statement work? Just doing an if statement to get the ones for the owner. I will code this tomorrow in aws_helper and release

from puppet-aws_helper.

Dharmender-Singh avatar Dharmender-Singh commented on August 23, 2024

Yes, The Statement works

from puppet-aws_helper.

neillturner avatar neillturner commented on August 23, 2024

ok i have push a new aws_helper version 0.0.9
do a
gem uninstall aws_helper
and then
gem install aws_helper
and see if it now works.
also run the puppet-aws_helper will install the latest version.
Let me know if that fixes problem

from puppet-aws_helper.

Dharmender-Singh avatar Dharmender-Singh commented on August 23, 2024

Its working But I didn't get any Data on Email But if remove the Owner filter from the shell script then getting full snapshot list in the mail.

from puppet-aws_helper.

neillturner avatar neillturner commented on August 23, 2024

I pushed another version of the gem version 0.0.10
try that one if still a problem

  1. do a gem list to check you have version 0.0.10 of aws_helper
  2. search for the file /awshelper/cli.rb
    and add the line
    puts "owner_id #{snapshot[:owner_id]} owner #{options[:owner]}"
    before the line
    if options[:owner].to_s == '' || snapshot[:owner_id].to_s == options[:owner].to_s
    and see what the puts prints

from puppet-aws_helper.

neillturner avatar neillturner commented on August 23, 2024

should be fixed not just install latest aws_helper gem version 0.0.11
closed

from puppet-aws_helper.

Dharmender-Singh avatar Dharmender-Singh commented on August 23, 2024

Hi Neil,

I have installed the AWS Helper 0.0.11 version, but now I am getting a new
error if I use owner option:

NOTE : I have given the owner as 09********** but Error is displaying from
9.

/usr/local/share/gems/gems/right_aws-3.1.0/lib/awsbase/right_awsbase.rb:568:in
request_info_impl': InvalidUserID.Malformed: Invalid user id: "9*********" (RightAws::AwsError) from /usr/local/share/gems/gems/right_aws-3.1.0/lib/ec2/right_ec2.rb:157:in request_info'
from
/usr/local/share/gems/gems/right_aws-3.1.0/lib/awsbase/right_awsbase.rb:582:in
request_cache_or_info' from /usr/local/share/gems/gems/right_aws-3.1.0/lib/ec2/right_ec2.rb:181:in describe_resources_with_list_and_options'
from
/usr/local/share/gems/gems/right_aws-3.1.0/lib/ec2/right_ec2_ebs.rb:216:in
describe_snapshots' from /usr/local/share/gems/gems/aws_helper-0.0.11/lib/awshelper/cli.rb:159:in snap_email'
from
/usr/local/share/gems/gems/thor-0.19.1/lib/thor/command.rb:27:in run' from /usr/local/share/gems/gems/thor-0.19.1/lib/thor/invocation.rb:126:in invoke_command'
from /usr/local/share/gems/gems/thor-0.19.1/lib/thor.rb:359:in
dispatch' from /usr/local/share/gems/gems/thor-0.19.1/lib/thor/base.rb:440:in start'
from
/usr/local/share/gems/gems/aws_helper-0.0.11/bin/aws_helper:5:in <top (required)>' from /usr/local/bin/aws_helper:23:inload'
from /usr/local/bin/aws_helper:23:in `

'

Could you please check this.

-Dharmender

On Wed, Aug 17, 2016 at 2:38 PM, Neill Turner [email protected]
wrote:

should be fixed not just install latest aws_helper gem version 0.0.11
closed


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#1 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AL0MJ9z_eLPhWo6cd1y85cpkJIXDyQjoks5qgw65gaJpZM4IbRQ1
.

from puppet-aws_helper.

Dharmender-Singh avatar Dharmender-Singh commented on August 23, 2024

I have checked on the test environment and its working fine. I think, some,
how the AWS helper is not picking Zero (0) as first digit of Owner id .

Could you please check this.

-Dharmender

On Wed, Aug 17, 2016 at 6:08 PM, Dharmender Singh [email protected]
wrote:

Hi Neil,

I have installed the AWS Helper 0.0.11 version, but now I am getting a new
error if I use owner option:

NOTE : I have given the owner as 09********** but Error is displaying from
9.

/usr/local/share/gems/gems/right_aws-3.1.0/lib/awsbase/right_awsbase.rb:568:in
request_info_impl': InvalidUserID.Malformed: Invalid user id: "9*********" (RightAws::AwsError) from /usr/local/share/gems/gems/right_aws-3.1.0/lib/ec2/right_ec2.rb:157:in request_info'
from /usr/local/share/gems/gems/right_aws-3.1.0/lib/awsbase/right_awsbase.rb:582:in
request_cache_or_info' from /usr/local/share/gems/gems/right_aws-3.1.0/lib/ec2/right_ec2.rb:181:in describe_resources_with_list_and_options'
from /usr/local/share/gems/gems/right_aws-3.1.0/lib/ec2/right_ec2_ebs.rb:216:in
describe_snapshots' from /usr/local/share/gems/gems/aws_helper-0.0.11/lib/awshelper/cli.rb:159:in snap_email'
from /usr/local/share/gems/gems/thor-0.19.1/lib/thor/command.rb:27:in
run' from /usr/local/share/gems/gems/thor-0.19.1/lib/thor/invocation.rb:126:in invoke_command'
from /usr/local/share/gems/gems/thor-0.19.1/lib/thor.rb:359:in
dispatch' from /usr/local/share/gems/gems/thor-0.19.1/lib/thor/base.rb:440:in start'
from /usr/local/share/gems/gems/aws_helper-0.0.11/bin/aws_helper:5:in
<top (required)>' from /usr/local/bin/aws_helper:23:inload'
from /usr/local/bin/aws_helper:23:in `

'

Could you please check this.

-Dharmender

On Wed, Aug 17, 2016 at 2:38 PM, Neill Turner [email protected]
wrote:

should be fixed not just install latest aws_helper gem version 0.0.11
closed


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#1 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AL0MJ9z_eLPhWo6cd1y85cpkJIXDyQjoks5qgw65gaJpZM4IbRQ1
.

from puppet-aws_helper.

neillturner avatar neillturner commented on August 23, 2024

i push a new version AWS Helper 0.0.12 where i define the owner as a string instead of numeric so i'm hoping wont strip leading zero.

from puppet-aws_helper.

Dharmender-Singh avatar Dharmender-Singh commented on August 23, 2024

Hi Neil,

It's working now. Thanks for your help.

Regards
Dharmender

On Wed, Aug 17, 2016 at 6:59 PM, Neill Turner [email protected]
wrote:

Reopened #1 #1.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#1 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AL0MJ2osE4t6SFRcCgoTyXZcrqrjY5upks5qg0v7gaJpZM4IbRQ1
.

from puppet-aws_helper.

neillturner avatar neillturner commented on August 23, 2024

closing. see https://github.com/neillturner/aws_helper for fix.

from puppet-aws_helper.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.