centreon / centreon-vmware

Centreon VMWare connector to check ESX server, VCenter and VMWare guest resources
Apache License 2.0
28 stars 16 forks source link

possibly a protocol issue: Status read failed: at /usr/local/share/perl5/Net/HTTP/Methods.pm line 282 #104

Open joschi99 opened 2 years ago

joschi99 commented 2 years ago

After updating to connector version 3.2.3 we have randomly this error launching the discovery command - Details: UNKNOWN: VMWare error (verbose mode for more details)

VMware connector log shows in this case this error

2022-04-20 09:06:07 - vpshere 'XXX' handler asking: {"vsphere_username":null,"case_insensitive":null,"prettify":1,"timeout":null,"vsphere_password":null,"warning_connector_status":null,"resource_type":"esx","command":"discovery","connector_port":"5700","sampling_period":null,"container":"XXX","unknown_connector_status":null,"vsphere_address":null,"time_shift":0,"identity":"client-e7066f08e5614e979fec8a6e8c5d23c0","connector_hostname":"127.0.0.1","critical_connector_status":null}
2022-04-20 09:06:09 - vpshere 'XXX' handler asking: {"vsphere_username":null,"case_insensitive":null,"prettify":1,"timeout":null,"vsphere_password":null,"warning_connector_status":null,"resource_type":"vm","command":"discovery","connector_port":"5700","sampling_period":null,"container":"XXX","unknown_connector_status":null,"vsphere_address":null,"time_shift":0,"identity":"client-e72b500aca0e4f5bbb4dba0bd000ba35","connector_hostname":"127.0.0.1","critical_connector_status":null}
2022-04-20 09:06:09 - 'XXX' SOAP request error - possibly a protocol issue: Status read failed:  at /usr/local/share/perl5/Net/HTTP/Methods.pm line 282.
garnier-quentin commented 2 years ago

You don't have that error with connector 3.2.2 ? It's the host discovery ?

joschi99 commented 2 years ago

With version 3.2.2 there is no error. Problem occurs launching the discovery mode, but occasionaly. On a internal ESXi standalone host we have found another issue on version 3.2.3 (with 3.2.2 works without any problem):

perl centreon_plugins.pl --plugin=apps::vmware::connector::plugin --mode=discovery --connector-hostname=127.0.0.1 --container='esxi_2_central' --resource-type=esx --prettify
2022-04-20 09:10:14 - vpshere 'esxi_2_central' handler asking: {"vsphere_username":null,"case_insensitive":null,"prettify":1,"timeout":null,"vsphere_password":null,"warning_connector_status":null,"resource_type":"esx","command":"discovery","connector_port":"5700","sampling_period":null,"container":"esxi_2_central","unknown_connector_status":null,"vsphere_address":null,"time_shift":0,"identity":"client-c4d9ee4a25a14c4fbd32a21c86bc369d","connector_hostname":"127.0.0.1","critical_connector_status":null}
2022-04-20 09:10:14 - 'esxi_2_central' Can't call method "type" on an undefined value at /usr/local/share/perl5/VMware/VICommon.pm line 1694.
garnier-quentin commented 2 years ago

I have added custom attributes. Maybe it's not available on a ESXI:

my $customFields = {};
    my $entries = centreon::vmware::common::get_view($self->{connector}, $self->{connector}->{session1}->get_service_content()->customFieldsManager);
    if (defined($entries->{field})) {
        foreach (@{$entries->{field}}) {
            $customFields->{ $_->{key} } = $_->{name};
        }
    }
joschi99 commented 2 years ago

Yes, could be that a standalone ESXi has no custom attributes. The first error occurs on a cluster (tested on different clusters), but randomly.

garnier-quentin commented 2 years ago

Could you patch your version 3.2.3 and test again ? https://github.com/centreon/centreon-vmware/pull/105/files

joschi99 commented 2 years ago

The fix seems solving the problem on standalone hosts. The sporadic problem remains

garnier-quentin commented 2 years ago

The problem should be on previous version also ? If you have that error, do you have a real issue ? or only a log.

joschi99 commented 2 years ago

I have found a way to reproduce the problem:

UNKNOWN: VMWare error (verbose mode for more details)
{"identity":"client-c23731f71a184a7096a112ffd0d9fa15","data":{"end_time":1650523785,"start_time":1650523785,"duration":0,"discovered_items":66,
....
},"short_message":"VMWare error (verbose mode for more details)","extra_message":"SOAP request error - possibly a protocol issue: Status read failed:  at /usr/local/share/perl5/Net/HTTP/Methods.pm line 282.\n\n","vmware_connector_version":"3.2.2","code":-1}
SOAP request error - possibly a protocol issue: Status read failed:  at /usr/local/share/perl5/Net/HTTP/Methods.pm line 282.
joschi99 commented 2 years ago

But its not related to version 3.2.3, same problem also on 3.2.2

garnier-quentin commented 2 years ago

The error comes from the sdk or the lwp library (too old maybe). Maybe you should try to update the perl sdk vmware.

joschi99 commented 2 years ago

At the moment we have installed: perl-VMware-vSphere.x86_64 6.5.0-4566394.1.el7.centos @centreon-stable

Are the any newer version available?

garnier-quentin commented 2 years ago

You should try the sdk 6.7 or 7.0.