nil:NilClass error

22 views
Skip to first unread message

sreenivas narayan

unread,
Oct 9, 2018, 5:35:21 AM10/9/18
to ruby-fog

Hi Guys,

I am getting error while creating snapshots.


===
volumes = conn.volumes.all().to_json

js = JSON.parse( volumes )

js.each { |k,v|
  key = k
  value = v
        volumesid = key['id']
        serverid = key['server_id']

         if serverid == "#{instanceid}"


# getting the instance name

   instance = conn.servers.get("#{instanceid}")



snapshot = conn.snapshots.new

snapshot.description = "Autosnap instance name:  instance id:  #{serverid} of volume id:  #{volumesid}"
snapshot.volume_id = "#{volumesid}"


snapshot.save

conn.tags.create(:resource_id => snapshot.id, :key => "saas", :value => "snapshot", :key => "customername", :value => "#{instancename}" )


===




snapshot.rb:84:in `block (3 levels) in <main>': undefined method `id' for nil:NilClass (NoMethodError)\n\tfrom snapshot.rb:52:in `each'\n\tfrom snapshot.rb:52:in `block (2 levels) in <main>'\n\tfrom /snapshot.rb:34:in `each'\n\tfrom snapshot.rb:34:in `block in <main>'\n\tfrom snapshot.rb:12:in `each'\n\tfrom snapshot.rb:12:in `<main>'",


Paulo Henrique Lopes Ribeiro

unread,
Oct 9, 2018, 6:55:45 AM10/9/18
to ruby...@googlegroups.com
Which provider are you using?
> --
> You received this message because you are subscribed to the Google Groups
> "ruby-fog" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ruby-fog+u...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>


--
-----------------------------------------------------
Paulo Henrique Lopes Ribeiro - Linkedin
<https://www.linkedin.com/in/paulohenriquelopesribeiro/>
Co-Founder & CTO 4Shark <http://www.4shark.com.br/>

sreenivas narayan

unread,
Oct 15, 2018, 9:05:34 AM10/15/18
to ruby-fog
Hi Paulo,

I am using aws

Thanks

Paulo Henrique Lopes Ribeiro

unread,
Oct 15, 2018, 8:10:31 PM10/15/18
to ruby...@googlegroups.com
Could you please open an issue on `fog-aws` then?

I believe they are more active there.

Thanks!

2018-10-15 10:05 GMT-03:00, sreenivas narayan <narayansr...@gmail.com>:
> Hi Paulo,
>
> I am using aws
>
> Thanks
>
>
> On Tuesday, 9 October 2018 16:25:45 UTC+5:30, Paulo Ribeiro wrote:
>>
>> Which provider are you using?
>>
>> 2018-10-09 6:35 GMT-03:00, sreenivas narayan <narayansr...@gmail.com
>> <javascript:>>:
>> > email to ruby-fog+u...@googlegroups.com <javascript:>.

sreenivas narayan

unread,
Oct 16, 2018, 12:16:25 AM10/16/18
to ruby-fog
Hi Paulo,

Can you please share the link for fog-aws forum?

Thanks
Sreenivas

Paulo Henrique Lopes Ribeiro

unread,
Oct 16, 2018, 9:33:57 AM10/16/18
to ruby...@googlegroups.com
Is not a forum but rather its github issues:

https://github.com/fog/fog-aws/issues

2018-10-16 1:16 GMT-03:00, sreenivas narayan <narayansr...@gmail.com>:
> Hi Paulo,
>
> Can you please share the link for fog-aws forum?
>
> Thanks
> Sreenivas
>
> On Tuesday, 16 October 2018 05:40:31 UTC+5:30, Paulo Ribeiro wrote:
>>
>> Could you please open an issue on `fog-aws` then?
>>
>> I believe they are more active there.
>>
>> Thanks!
>>
>> 2018-10-15 10:05 GMT-03:00, sreenivas narayan <narayansr...@gmail.com
>> <javascript:>>:
Reply all
Reply to author
Forward
0 new messages