You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Fusion Inventory部署报Failed to construct the final file错误

Fusion Inventory部署Notepad++提示failed to prepare work dir错误排查

问题描述

使用Fusion Inventory在Windows测试计算机上部署应用时,启动Notepad++部署任务后Fusion Inventory状态显示为错误,部署无法正常执行。
当前环境版本:GLPI 10.0.0,Fusion Inventory 10.0.0+1.1

报错日志

Fusion Inventory服务端日志

failed to prepare work dir

Windows端Agent日志

[Mon Jul 11 14:16:43 2022][info] target server0: server http://X.X.X.X/glpi/plugins/fusioninventory/
[Mon Jul 11 14:16:43 2022][info] sending prolog request to server0
[Mon Jul 11 14:16:44 2022][info] running task Deploy
[Mon Jul 11 14:16:44 2022][info] Failed to construct the final file.: C:\Program Files (x86)\FusionInventory-Agent\var\http..__X.X.X.X_glpi_plugins_fusioninventory_\deploy/workdir/62cc149e32ef8/npp.8.4.2.Installer.x64.exe
[Mon Jul 11 14:16:48 2022][info] running task Inventory
[Mon Jul 11 14:16:48 2022][info] New inventory from DFormation-001.i2cx.formations-2022-07-08-15-32-08 for server0
[Mon Jul 11 14:17:42 2022][info] running task Collect
[Mon Jul 11 14:17:42 2022][info] No Collect job enabled or Collect support disabled server side.

现有配置

部署包执行步骤

- Create a directory
c:/deploiement
- Move
from * to c:\deploiement
- Command
c:\deploiement\npp.8.4.2.Installer.x64.exe
- Command 
del c:\deploiement\npp.8.4.2.Installer.x64.exe
- Delete a directory
c:\deploiement\

作业配置

Method: Package deployment
Target: Package > Notepad
Actors: Computer > My computer's agent

问题原因&修复方案

从日志的路径报错可以直接定位核心问题:FusionInventory Agent临时工作目录创建失败,按以下顺序排查修复即可:

  • 修复Agent服务运行权限
    报错指向的C:\Program Files (x86)\FusionInventory-Agent\var\是Agent默认临时文件存储目录,如果Agent服务不是以本地系统账户运行,默认没有在Program Files目录下创建子文件夹的权限,会直接触发工作目录创建失败。打开Windows服务管理器,找到FusionInventory Agent服务,在「登录」选项卡下选择「本地系统账户」,勾选「允许服务与桌面交互」后重启服务即可。
  • 统一路径斜杠格式
    当前配置里创建目录用的是正斜杠c:/deploiement,后续移动、执行步骤用的是Windows标准反斜杠c:\deploiement,再加上Agent自身拼接临时路径时混用了正斜杠(日志里的deploy/workdir),Windows解析混合斜杠路径时很容易判定为非法路径。把所有部署步骤里的路径统一改成反斜杠格式,创建目录步骤的路径修正为c:\deploiement。
  • 缩短安装包文件名规避路径长度限制
    Windows默认对路径长度有260字符的限制,当前使用的安装包名npp.8.4.2.Installer.x64.exe拼接上Agent多层嵌套的临时目录后,总长度已经逼近阈值,会直接导致文件写入、目录创建失败。上传安装包到GLPI软件仓库时直接把文件名改成短名,比如npp.exe,重新关联部署包即可。
  • 补充静默安装参数避免部署卡住
    工作目录问题修复后,当前的执行命令直接运行安装包会弹出可视化安装窗口,Agent会一直等待进程结束判定任务超时,需要给执行命令加上Notepad++默认的静默安装参数,把命令改为c:\deploiement\npp.exe /S。

内容的提问来源于stack exchange,提问作者Wawa

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.27 04:15:28