Topic: Unable to start FusionInventory on a new install

Hi,

I successfully installed GLPI + FusionInventory on a Debian 9 VM Today.

Then, I installed FusionInventory Agent 2.4.1 using the VBS script modified as follows :

SetupOptions = "/acceptlicense /runnow /execmode=Service /installtasks=Full /server='htt ps:// glpi.my in.stall/plugins/fusioninventory/' /S"


The service does launch and stop just after.

Launching fusioninventory-agent.bat gets the following error :

C:\Program Files\FusionInventory-Agent>fusioninventory-agent.bat --debug
Execution failure:.
Can't locate object method "size" via package "1" (perhaps you forgot to load "1"?) at C:\Program Files\FusionInventory-Agent/perl/agent/FusionInventory/Agent/Logger/File.pm line 34.

But, launching the agent with the following options work :

C:\Program Files\FusionInventory-Agent>fusioninventory-agent.bat --config=none --server=htt ps://gl pi.myi n.stall/plugins/fusioninventory/
[info] sending prolog request to server server0
Use of uninitialized value in alarm at C:\Program Files\FusionInventory-Agent/perl/agent/FusionInventory/Agent/HTTP/Client.pm line 91.
[info] running task Deploy
Use of uninitialized value in alarm at C:\Program Files\FusionInventory-Agent/perl/agent/FusionInventory/Agent/HTTP/Client.pm line 91.
[info] No Deploy job enabled or Deploy support disabled server side.
[info] running task Collect
Use of uninitialized value in alarm at C:\Program Files\FusionInventory-Agent/perl/agent/FusionInventory/Agent/HTTP/Client.pm line 91.
[info] No Collect job enabled or Collect support disabled server side.
[info] running task Inventory
Use of uninitialized value in alarm at C:\Program Files\FusionInventory-Agent/perl/agent/FusionInventory/Agent/HTTP/Client.pm line 91.
[info] running task ESX
Use of uninitialized value in alarm at C:\Program Files\FusionInventory-Agent/perl/agent/FusionInventory/Agent/HTTP/Client.pm line 91.
[info] No ESX job enabled or ESX support disabled server side.
[info] running task Maintenance


I most certainly did something wrong, but cannot figure what,

Thanks in advance,

Re: Unable to start FusionInventory on a new install

Hi Nrvnqsr,

I guess you should have agent installed before on this computer and the previous configuration should trigger something around logfile & logfile-maxsize parameters.

Can you check your registry under HKLM\SOFTWARE\FusionInventory-Agent for the values of the following keys ?
logger
logfile
logfile-maxsize

I guess you have "File" in "logger". Can you check the status of the "logfile" file ?

Re: Unable to start FusionInventory on a new install

Hello, same problem here.
From a complete uninstall (deleting program folder and check non registry key remain) and reinstall the FusionInventory client by the vbs script I have same issue

Install Command:

"\\glpi.mynet.lan\fi\fusioninventory-agent_windows-x64_2.4.2.exe"  /acceptlicense  /runnow  /server='htt ps://glpi.mynet.lan/plugins/fusioninventory/'  /S  /installtasks=Inventory,NetDiscovery,NetInventory,Deploy  /no-start-menu  /execmode=service  /tag=SI 

My registry is:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\FusionInventory-Agent]
"backend-collect-timeout"="180"
"ca-cert-dir"=""
"ca-cert-file"=""
"conf-reload-interval"="0"
"debug"="2"
"delaytime"="3600"
"html"="0"
"htt pd-ip"="0.0.0.0"
"htt pd-port"="62354"
"htt pd-trust"="127.0.0.1/32"
"local"=""
"logfile"="C:\\Program Files\\FusionInventory-Agent\\fusioninventory-agent.log"
"logfile-maxsize"="16"
"logger"="File"
"no-category"=""
"no-htt pd"="0"
"no-p2p"="0"
"no-ssl-check"="0"
"no-task"=""
"password"=""
"proxy"=""
"server"="htt ps://glpi.mynet.lan/plugins/fusioninventory/"
"scan-homedirs"="0"
"scan-profiles"="0"
"tag"="SI"
"tasks"=""
"timeout"="180"
"user"=""

and the fusioninventory-agent.log content is:

[Tue Feb  5 10:36:20 2019][debug] FusionInventory Agent (2.4.2)
[Tue Feb  5 10:36:20 2019][debug] Configuration directory: C:\Program Files\FusionInventory-Agent\etc
[Tue Feb  5 10:36:20 2019][debug] Data directory: C:\Program Files\FusionInventory-Agent/share
[Tue Feb  5 10:36:20 2019][debug] Storage directory: C:\Program Files\FusionInventory-Agent/var
[Tue Feb  5 10:36:20 2019][debug] Lib directory: C:\Program Files\FusionInventory-Agent/perl/agent
[Tue Feb  5 10:36:20 2019][debug] [target server0] Next server contact planned for Tue Feb  5 11:03:42 2019
[Tue Feb  5 10:36:20 2019][debug2] getAvailableTasks() : add of task Deploy version 2.7
[Tue Feb  5 10:36:20 2019][debug2] getAvailableTasks() : add of task Inventory version 1.5
[Tue Feb  5 10:36:20 2019][debug2] getAvailableTasks() : add of task Maintenance version 1.1
[Tue Feb  5 10:36:20 2019][debug2] getAvailableTasks() : add of task NetDiscovery version 2.7
[Tue Feb  5 10:36:20 2019][debug2] getAvailableTasks() : add of task NetInventory version 3.1
[Tue Feb  5 10:36:20 2019][debug2] getAvailableTasks() : add of task WMI version 0.3
[Tue Feb  5 10:36:20 2019][debug2] isParamArrayAndFilled('tasks') : false
[Tue Feb  5 10:36:20 2019][debug] Available tasks:
[Tue Feb  5 10:36:20 2019][debug] - Inventory: 1.5
[Tue Feb  5 10:36:20 2019][debug] - NetDiscovery: 2.7
[Tue Feb  5 10:36:20 2019][debug] - NetInventory: 3.1
[Tue Feb  5 10:36:20 2019][debug] - Maintenance: 1.1
[Tue Feb  5 10:36:20 2019][debug] - Deploy: 2.7
[Tue Feb  5 10:36:20 2019][debug] - WMI: 0.3
[Tue Feb  5 10:36:20 2019][debug] server target: htt ps://glpi.mynet.lan/plugins/fusioninventory/
[Tue Feb  5 10:36:20 2019][debug] Planned tasks:
[Tue Feb  5 10:36:20 2019][debug] - Inventory: 1.5
[Tue Feb  5 10:36:20 2019][debug] - NetDiscovery: 2.7
[Tue Feb  5 10:36:20 2019][debug] - NetInventory: 3.1
[Tue Feb  5 10:36:20 2019][debug] - Deploy: 2.7
[Tue Feb  5 10:36:20 2019][debug] - WMI: 0.3
[Tue Feb  5 10:36:20 2019][debug] scheduler target: scheduler0
[Tue Feb  5 10:36:20 2019][debug] Planned tasks:
[Tue Feb  5 10:36:20 2019][debug] - Maintenance: 1.1
[Tue Feb  5 10:36:20 2019][debug] Provided by Fusioninventory
[Tue Feb  5 10:36:20 2019][debug] Installer built with Appveyor on Thu Oct  4 18:24:48 UTC 2018
[Tue Feb  5 10:36:20 2019][info] FusionInventory Agent service starting
[Tue Feb  5 10:36:20 2019][debug] [htt p server] HTT PD service started on port 62354
[Tue Feb  5 10:36:20 2019][debug] FusionInventory Agent (2.4.2)
[Tue Feb  5 10:36:20 2019][debug2] Looking for Win32_Processor class WMI objects
[Tue Feb  5 10:36:22 2019][debug] Agent memory usage before freeing memory: 89645056
[Tue Feb  5 10:36:22 2019][info] FusionInventory Agent memory usage: 3461120
[Tue Feb  5 10:36:22 2019][debug] Running in background mode
[Tue Feb  5 10:37:44 2019][debug] forking process 0 to handle task Maintenance
[Tue Feb  5 10:37:44 2019][info] running task Maintenance
[Tue Feb  5 10:37:44 2019][debug2] Doing Deploy Maintenance
[Tue Feb  5 10:37:46 2019][debug] Agent memory usage before freeing memory: 63918080
[Tue Feb  5 10:37:46 2019][info] FusionInventory Agent memory usage: 2887680
[Tue Feb  5 10:38:38 2019][debug] forking process 0 to handle task Maintenance
[Tue Feb  5 10:38:38 2019][info] running task Maintenance
[Tue Feb  5 10:38:38 2019][debug2] Doing Deploy Maintenance
[Tue Feb  5 10:38:40 2019][debug] Agent memory usage before freeing memory: 64364544
[Tue Feb  5 10:38:40 2019][info] FusionInventory Agent memory usage: 2891776
[Tue Feb  5 10:39:44 2019][debug] forking process 0 to handle task Maintenance
[Tue Feb  5 10:39:44 2019][info] running task Maintenance
[Tue Feb  5 10:39:44 2019][debug2] Doing Deploy Maintenance
[Tue Feb  5 10:39:46 2019][debug] Agent memory usage before freeing memory: 64221184
[Tue Feb  5 10:39:46 2019][info] FusionInventory Agent memory usage: 2879488
[Tue Feb  5 10:41:43 2019][debug] forking process 0 to handle task Maintenance
[Tue Feb  5 10:41:43 2019][info] running task Maintenance
[Tue Feb  5 10:41:43 2019][debug2] Doing Deploy Maintenance
[Tue Feb  5 10:41:45 2019][debug] Agent memory usage before freeing memory: 66646016
[Tue Feb  5 10:41:45 2019][info] FusionInventory Agent memory usage: 2883584
[Tue Feb  5 10:43:05 2019][debug] forking process 0 to handle task Maintenance
[Tue Feb  5 10:43:05 2019][info] running task Maintenance
[Tue Feb  5 10:43:05 2019][debug2] Doing Deploy Maintenance
[Tue Feb  5 10:43:07 2019][debug] Agent memory usage before freeing memory: 67166208
[Tue Feb  5 10:43:07 2019][info] FusionInventory Agent memory usage: 2895872

The errors I obtain are:

C:\Program Files\FusionInventory-Agent>fusioninventory-agent.bat --debug
Execution failure:.
Can't locate object method "size" via package "1" (perhaps you forgot to load "1"?) at C:\Program Files\FusionInventory-Agent/perl/agent/FusionInventory/Agent/Logger/File.pm line 34.

C:\Program Files\FusionInventory-Agent>fusioninventory-agent.bat --config=none --server=htt ps://glpi.mynet.lan/plugins/fusioninventory/ -f
[info] sending prolog request to server server0
Use of uninitialized value in alarm at C:\Program Files\FusionInventory-Agent/perl/agent/FusionInventory/Agent/HTTP/Client.pm line 91.
[info] running task Inventory
Use of uninitialized value in alarm at C:\Program Files\FusionInventory-Agent/perl/agent/FusionInventory/Agent/HTTP/Client.pm line 91.
[info] running task Deploy
Use of uninitialized value in alarm at C:\Program Files\FusionInventory-Agent/perl/agent/FusionInventory/Agent/HTTP/Client.pm line 91.
[info] No Deploy job enabled or Deploy support disabled server side.
[info] running task Maintenance

on the fusioninventory-agent.log I can see:

[Tue Feb  5 10:48:43 2019][debug] forking process 0 to handle task Maintenance
[Tue Feb  5 10:48:43 2019][info] running task Maintenance
[Tue Feb  5 10:48:43 2019][debug2] Doing Deploy Maintenance
[Tue Feb  5 10:48:45 2019][debug] Agent memory usage before freeing memory: 80601088
[Tue Feb  5 10:48:45 2019][info] FusionInventory Agent memory usage: 2891776
[Tue Feb  5 10:50:46 2019][debug] forking process 0 to handle task Maintenance
[Tue Feb  5 10:50:46 2019][info] running task Maintenance
[Tue Feb  5 10:50:46 2019][debug2] Doing Deploy Maintenance
[Tue Feb  5 10:50:48 2019][debug] Agent memory usage before freeing memory: 80248832
[Tue Feb  5 10:50:48 2019][info] FusionInventory Agent memory usage: 2883584
[Tue Feb  5 10:51:52 2019][debug] forking process 0 to handle task Maintenance
[Tue Feb  5 10:51:52 2019][info] running task Maintenance
[Tue Feb  5 10:51:52 2019][debug2] Doing Deploy Maintenance
[Tue Feb  5 10:51:54 2019][debug] Agent memory usage before freeing memory: 80515072
[Tue Feb  5 10:51:54 2019][info] FusionInventory Agent memory usage: 2912256

Any idea?

Thanks a lot

Re: Unable to start FusionInventory on a new install

Hi Dallo71,

do you really have the same issue ? I mean: are you "unable to start FusionInventory on a new install" ? like the thread title says.
I ask you as you are showing log file of a running service.

I see you seem to fail of running the agent manually with the "Can't locate object method "size" via package "1"" error, but at least the service seems to run.

Can you tell us which operating system version you're using ?

The error is strange as I didn't manage to reproduce. So I think something may be broken on your system. Actually, the error can occur if "use File::stat;" is removed from the Logger::File.pm module. This suggests me "File::stat" module may fail to initialize and finally stat call is run as if it was the perl native stat function which return an array in place of a structure.

Btw can you make a try editing the C:\Program Files\FusionInventory-Agent/perl/agent/FusionInventory/Agent/Logger/File.pm file as admin:
At line 34, can you replace this line:

        if ($stat && $stat->size() > $self->{logfile_maxsize}) {

with

        if (-s $self->{logfile} > $self->{logfile_maxsize}) {

?
Then tell us if this fix your case.
Thank you