jhoblitt / puppet-smartd

Manages the smartmontools package including the smartd daemon
Other
14 stars 24 forks source link

megaraid_virtual_drives: undefined method `map' #10

Closed razorsedge closed 10 years ago

razorsedge commented 11 years ago

I am seeing this output when running puppet agent --test and do not have the megaraid_virtual_drives fact .

Could not retrieve megaraid_virtual_drives: undefined method `map' for "/dev/sda\n/dev/sdb":String

This is on PE 3.0.1 with (I think) ruby 1.9.3.

jhoblitt commented 11 years ago

Are you still seeing this error with PR #11 ? If so, could you provide a list of all facter megaraid_* facts that are present? I may need to get megacli output examples as well to sort this out.

razorsedge commented 11 years ago

I needed PR #11 to get the other megaraid_* facts to show, except for the megaraid_virtual_drives fact as per above. I think that before I added PR #11, I was seeing a similar error like this:

Could not retrieve megaraid_virtual_drives: undefined method `map' for nilClass
jhoblitt commented 11 years ago

I'm asking for facter | grep megaraid.

razorsedge commented 11 years ago

Looks like I'll need another day to rebuild that environment before I can retrieve the output.

razorsedge commented 11 years ago
# facter -p|grep -i megaraid
Could not retrieve megaraid_virtual_drives: undefined method `map' for nil:NilClass
has_megaraid => true
megaraid_adapters => 1
megaraid_physical_drives => 0,1,2,3
jhoblitt commented 11 years ago

I see a bug @ https://github.com/jhoblitt/puppet-smartd/blob/master/lib/facter/megaraid.rb#L54 where megacli_usable? should be lsscsi_usable?.

Do you have lsscsi installed? Could you give me the output of these two commands?

lscsi and lsscsi | awk \'{ if($2 == "disk" && ($3 == "LSI" || $3 == "SMC")) { print $6 } }\'

razorsedge commented 11 years ago
# lsscsi 
[6:2:0:0]    disk    SMC      SMC2208          3.22  /dev/sda 
[6:2:1:0]    disk    SMC      SMC2208          3.22  /dev/sdb 
# lsscsi  | awk '{ if($2 == "disk" && ($3 == "LSI" || $3 == "SMC")) {print $6 } }'
/dev/sda
/dev/sdb
jhoblitt commented 11 years ago

That is frustrating. I don't see how #map could be getting called on nil unless that shell pipeline was returning nothing. I'll put together some proper fact tests and see if I can trigger that exception myself.

As a side note, I decided to go ahead a push a v2.0.0 release to the forge instead of continuing to hold for this issue. I wanted to get the API change out sooner rather than later.

razorsedge commented 11 years ago

It is weird that before OS re-install and after addition of "SMC", I was getting the original error. Now, after OS re-install, I had to push the megaraid.rb to the client and I am seeing the nil:NilClass (https://github.com/jhoblitt/puppet-smartd/issues/10#issuecomment-25740418) output which I originally saw before I added "SMC". I imagine something is weird on the new OS install, but it seems odd that there is an error on map either way.

Of course, there is also the issue of /dev/megaraid_sas_ioctl_node not being created until the first manual run of MegaCli. (Perhaps it is time to refacter smartd and megaraid?)

jhoblitt commented 11 years ago

has_megaraid is also a fact that's not in my tree.

I, as per usual, ran into weird issues trying to write test facts last weekend. Hopefully, I'll find the time this weekend to take another stab at it.

jhoblitt commented 10 years ago

@razorsedge I just pushed up PR #14 which reworks the facts such that the /dev/* devices are no longer checked and usage of lsscsi has removed completely. I've only tested it on VMs, and not a real machine with an LSI controller, so I going to hold off of merged these changes into master until I can do proper testing. Please let me know what you think.

jhoblitt commented 10 years ago

@razorsedge Could you retest with the current master?

jhoblitt commented 10 years ago

I'm going to assume that this issue has been resolved and close it out. Pleaes reopen it if it's still happening after the fact revamp.