OCSInventory-NG / UnixAgent

This is the OCS unified agent for Unix operating systems
http://www.ocsinventory-ng.org/en/
GNU General Public License v2.0
89 stars 83 forks source link

MacOS Bareword HTTP::Status::RC_PERMANENT_REDIRECT not allowed #404

Closed Christian1und0 closed 1 year ago

Christian1und0 commented 2 years ago

General informations

Operating system : MacOS 10.15.6 Perl version : 5.18.4

OCS Inventory informations

MacOS agent version : 2.9.1

Problem's description

When running ocsinventory-agent we get this error message in the terminal:

Last login: Mon Apr 4 13:46:14 on ttys000
/Applications/OCSNG.app/Contents/Resources/ocsinventory-agent ; exit;
************@*******-MacBook-Air ~ % /Applications/OCSNG.app/Contents/Resources/ocsinventory-agent ; exit;
Failed to load Ocsinventory::Agent, Bareword "HTTP::Status::RC_PERMANENT_REDIRECT" not allowed while "strict subs" in use at /Applications/OCSNG.app/Contents/Resources//lib/LWP/UserAgent.pm line 319.
Compilation failed in require at /Applications/OCSNG.app/Contents/Resources//lib/Ocsinventory/Agent/Network.pm line 8.
BEGIN failed--compilation aborted at /Applications/OCSNG.app/Contents/Resources//lib/Ocsinventory/Agent/Network.pm line 8.
Compilation failed in require at /Applications/OCSNG.app/Contents/Resources//lib/Ocsinventory/Agent.pm line 33.
BEGIN failed--compilation aborted at /Applications/OCSNG.app/Contents/Resources//lib/Ocsinventory/Agent.pm line 33.
Compilation failed in require at (eval 1) line 1.
BEGIN failed--compilation aborted at (eval 1) line 1.

you can run the agent directly for its source directory with --devlib

[Prozess beendet]
Christian1und0 commented 2 years ago

After upgrading perl to 5.34.0 the problem still persists

Christian1und0 commented 2 years ago

Upgrading to MacOS 11.6.2 solved the problem, so it looks like the problem was in MacOS 10.15.6 and earlier.

{edit} So it turned out the problem was in LWP::UserAgent https://github.com/libwww-perl/libwww-perl/pull/378

Christian1und0 commented 2 years ago

I could not find any way to update LWP::UserAgent on older Mac OS like Catalina. Therefore it looks like the MacOS agent only runs on MacOS 11.6.2 (Big Sur) or higher

Lea9250 commented 1 year ago

Hi @Christian1und0,

Agent version 2.8.0 is the last release compatible with Catalina and lower. Version 2.9+ supports both Big Sur and Monterey. These compatibilities can be found on the release notes for each version of the agent.

Regards, Léa