Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"NoMethodError: undefined method `body' for #<Fog::DNS::AWS::Error:0x007f6c673e1720>" #112

Closed
tysonmote opened this issue May 14, 2015 · 11 comments

Comments

@tysonmote
Copy link

The following line of code is not expecting a Fog::DNS::AWS::Error to be returned, so it's blindly calling .body on the result of service.change_resource_record_sets:

data = service.change_resource_record_sets(zone.id, [options]).body

data = service.change_resource_record_sets(zone.id, [options]).body

My code is doing the following:

record = Fog::DNS['AWS'].zones.get( "......" ).records.new({
  name: "foo.foobar.com",
  value: "ec2-123-123-123-123.compute-1.amazonaws.com",
  ttl: 600,
  type: 'CNAME'
})
record.save # this line raises the error
@geemus
Copy link
Member

geemus commented May 14, 2015

Hmm. I wouldn't expect that to return an error though (it should raise it, in which case it should stop execution, rather than calling body). Could you share the rest of the stack trace? I think that might help narrow it down a bit easier. Thanks!

@tysonmote
Copy link
Author

The rest of the stack trace is purely my own application code, actually.

screen shot 2015-05-14 at 11 37 28 am

(Clipped, of course, but that's the top two lines of the stack.)

@geemus
Copy link
Member

geemus commented May 14, 2015

That looks like a pretty old version of fog-aws actually, could you bump it and see if that helps?

@tysonmote
Copy link
Author

Ah! I didn't even notice that. I'll close and re-open if it occurs again with the latest release.

@geemus
Copy link
Member

geemus commented May 20, 2015

No worries, sounds good, thanks!

@eherot
Copy link
Contributor

eherot commented May 22, 2015

I think this is actually still an issue. Here's what happened when I used a version of fog-aws built from master:

[6] pry(main)> zone.records.create(record_attributes)                                                           NoMethodError: undefined method `body' for #<Fog::DNS::AWS::Error:0x007fe72abf6d50>
from /Users/eherot/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/fog-aws-0.3.0/lib/fog/aws/models/dns/record.rb:44:in `save'
[7] pry(main)> wtf?
Exception: NoMethodError: undefined method `body' for #<Fog::DNS::AWS::Error:0x007fe72abf6d50>
--
0: /Users/eherot/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/fog-aws-0.3.0/lib/fog/aws/models/dns/record.rb:44:in `save'
1: /Users/eherot/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/fog-core-1.30.0/lib/fog/core/collection.rb:51:in `create'
2: (pry):6:in `__pry__'

@eherot
Copy link
Contributor

eherot commented May 26, 2015

@tysontate @geemus I think you guys might want to re-open this...

@tysonmote
Copy link
Author

Re-opened!

@tysonmote tysonmote reopened this May 26, 2015
@pollosp
Copy link

pollosp commented May 28, 2015

Same problem with fog-aws (0.4.0):

had an error: NoMethodError: undefined method `body' for #<Fog::DNS::AWS::Error:0x007fca91a909d0>

@geemus geemus closed this as completed in e324c6a May 30, 2015
@geemus
Copy link
Member

geemus commented May 30, 2015

Looks like we were missing a raise, think the commit above should fix it, sorry for the confusion.

@josacar
Copy link
Contributor

josacar commented Jun 1, 2015

Thanks @geemus , it works flawlessly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants