fusioninventory / fusioninventory-for-glpi

FusionInventory plugin for GLPI
http://www.FusionInventory.org/
GNU Affero General Public License v3.0
362 stars 150 forks source link

Files download: download failed #3371

Open quadronelectron2012 opened 2 years ago

quadronelectron2012 commented 2 years ago

Occuring issue: The Fusioninventory-agent(2.6) runs the deploy job succesfully until it comes to the downloading part: it tries to download the installation file from the server, but for an unknown reason, the fusioninventory client fails to download the file. Also there are no information, in the apache logfile, about the FI-agent triying to download the file from the server.

My configuration: GLPI version: 10.0.1 GLPI FusionInventory plugin version: 10.0.1+1.0 FusionInventory version: 2.6 FusionInventory plattform: windows

The file is on the server, the job is configured correctly, the file can be downloaded, with a link generated on server, in browser.

The GLPI is newly installed with an empty database. There only exists one group, one task and one job on the GLPI Server.

What should happen? The deploy job(s) configured in the glpi should run and install the programm(s).

What is happening? According to the FI-agent-log: the the deploy job is running successfully until to the download part: FI-agent returns ,,Downloading for job xy“ and tries 10 times to download the file then it send a status message to the server that the download has been failed.

Status message tries to download: [Tue Jul 12 14:09:56 2022][debug2] https://glpi.bvd.example.x/glpi/plugins/fusioninventory/b/deploy/?action=setStatus&currentStep=downloading&sha512=fba3d6fccf04368de81dce9a816bf90d425c4c3d9df6dd745480fcc5738c71e7638bcb91df4ff1088275211b75cc990c9cad0866456103531d96da5640895e16&part=file&msg=retrying%207z2200-x64.exe&machineid=TOKYO-2022-07-12-12-59-19&uuid=62cd64874daf2 [Tue Jul 12 14:09:56 2022][debug2] https://glpi.bvd.example.x/glpi/plugins/fusioninventory/b/deploy/?action=setStatus&uuid=62cd64874daf2&msg=fetching%207z2200-x64.exe&machineid=TOKYO-2022-07-12-12-59-19&part=file&sha512=fba3d6fccf04368de81dce9a816bf90d425c4c3d9df6dd745480fcc5738c71e7638bcb91df4ff1088275211b75cc990c9cad0866456103531d96da5640895e16&currentStep=downloading

Status message download has been failed: https://glpi.bvd.example.x/glpi/plugins/fusioninventory/b/deploy/?action=setStatus&currentStep=downloading&sha512=fba3d6fccf04368de81dce9a816bf90d425c4c3d9df6dd745480fcc5738c71e7638bcb91df4ff1088275211b75cc990c9cad0866456103531d96da5640895e16&status=ko&uuid=62cd64874daf2&part=file&msg=7z2200-x64.exe%20download%20failed&machineid=TOKYO-2022-07-12-12-59-19

When did the error occured? After applying the fix from https://github.com/fusioninventory/fusioninventory-for-glpi/pull/3352 on top of GLPI FusionInventory plugin version 10.0.1+1.0.

leszekkazmierczak commented 2 years ago

I fixed this by changing $file to $sha512 at line 72 in inc/deployfilepart.class.php:

if (!preg_match('/^\w{128}$/', $sha512)) {
         header("HTTP/1.1 403");
         exit;
      }

After this quick fix, it started to download files properly but agent stucks on preperation... [info] running task Deploy and nothing happens. Deploy task stucks at this point.

GLPI: 10.0.2 with FusionInventory Plugin 10.0.1+1.0. Anyone know solution for this?

quadronelectron2012 commented 2 years ago

The error occurs after applying the fix https://github.com/fusioninventory/fusioninventory-for-glpi/pull/3352, as I mentioned before. Unfortunately it doesn't help, that's exactly my problem at the moment....

debalance commented 2 years ago

Same here. Makes this Plugin rather useless...

ddurieux commented 2 years ago

I have do some tests and have no problem, can you try with dev version of the branch glpi10.0.2? https://github.com/fusioninventory/fusioninventory-for-glpi/tree/glpi10.0.2

debalance commented 2 years ago

Updated my glpi to 10.0.2 and used the latest https://github.com/fusioninventory/fusioninventory-for-glpi/tree/glpi10.0.2

First observation: the page Setup -> Plugins is broken, error message PHP Fatal error: Cannot redeclare script_endswith() (previously declared in /var/www/html/glpi-10.0.2/plugins/fusioninventory/setup.php:81) in /var/www/html/glpi-10.0.2/plugins/fusioninventory-old/setup.php on line 81, referer: https://glpi.private.domain.redacted/glpi/plugins/fusioninventory/front/task.form.php?id=1

Other than that: same problem as before, client seems to not even attempt the download. See attached logfiles.

apache.log fusioninventory-agent.log

ddurieux commented 2 years ago

Hi, it's a user problem :D The old FusionInventory folder (in you case fusioninventory-old) must be moved outsite the /plugins/ folder.

debalance commented 2 years ago

Hi, it's a user problem :D The old FusionInventory folder (in you case fusioninventory-old) must be moved outsite the /plugins/ folder.

Thanks, that fixes the issue with the plugin-setup page, but changes nothing regarding the not-downloading issue.

ddurieux commented 2 years ago

What error do you have in the agent log?

debalance commented 2 years ago

See fusioninventory-agent.log