UnixAgent icon indicating copy to clipboard operation
UnixAgent copied to clipboard

MacOS Bareword HTTP::Status::RC_PERMANENT_REDIRECT not allowed

Open Christian1und0 opened this issue 2 years ago • 3 comments

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 avatar Apr 04 '22 14:04 Christian1und0

After upgrading perl to 5.34.0 the problem still persists

Christian1und0 avatar Apr 20 '22 11:04 Christian1und0

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 avatar Apr 20 '22 13:04 Christian1und0

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

Christian1und0 avatar Apr 27 '22 12:04 Christian1und0