emqx文件上传成功,但服务器找不到附件

emqx 5.1.2
配置如下

node {
  name = "emqx15@10.0.103.15"
  cookie = "emqxsecretcookie"
  data_dir = "/var/lib/emqx"
}

cluster {
  name = emqxcl
  discovery_strategy = static
  static {
    seeds = ["emqx15@10.0.103.15", "emqx16@10.0.103.16", "emqx17@10.0.103.17"]
  }
}

dashboard {
    listeners.http {
        bind = 18083
    }
}

listeners.tcp.default {
  bind = "0.0.0.0:1883"
  max_connections = 1024000
}

# 文件上传配置
file_transfer {
  enable = true
  storage {
    local {
      enable = true
      exporter {
        local {
          enable = true
          root = "/data/upload"
        }
      }
    }
  }
}

参考代码:github.com/emqx/MQTT-Client-Examples/blob/master/mqtt-client-Java/src/main/java/io/emqx/mqtt/MqttFileTransferSample.java

上传日志:

18:21:36.789 [MQTT Call: agent--e4f2169d] INFO  c.t.c.m.c.MqttCallbackConfig - [deliveryComplete,91] - 向主题[$file/773a98d860ee71a1455d3bc71556195a8bfde11f679b5eee5e6e3f4d16cd640f/init]发送数据! userProperties: {}, payload: {"name":"123.txt","size":32,"checksum":"773a98d860ee71a1455d3bc71556195a8bfde11f679b5eee5e6e3f4d16cd640f"}
18:21:36.790 [MQTT Call: agent--e4f2169d] INFO  c.t.c.m.c.MqttCallbackConfig - [deliveryComplete,91] - 向主题[$file/773a98d860ee71a1455d3bc71556195a8bfde11f679b5eee5e6e3f4d16cd640f/0]发送数据! userProperties: {}, payload: 009901FF0018100000010019F0FFFD81
18:21:36.790 [MQTT Call: agent--e4f2169d] INFO  c.t.c.m.c.MqttCallbackConfig - [deliveryComplete,91] - 向主题[$file/773a98d860ee71a1455d3bc71556195a8bfde11f679b5eee5e6e3f4d16cd640f/fin/32]发送数据! userProperties: {}, payload: 

日志显示创建成功,但是服务端/data/upload上面找不到文件 ,不知道是什么原因,求大佬支招

您好。请问您是第一次上传这个文件吗?我看了一下示例代码,fileId的部分有点问题,fileId对于每次上传的文件需要是唯一的,一般使用uuid作为fileId。

import java.util.UUID;

UUID uuid = UUID.randomUUID();
string fileId = uuid.toString();

您还可以在emqx安装目录/log/emqx.log.中执行下面命令,看看有没有报错信息。另外请确保emqx对/data/upload有写的权限。谢谢。
grep emqx_ft emqx安装目录/log/emqx.log.

grep assemble emqx安装目录/log/emqx.log.*

感谢您的支援!! 我是初次使用emqx上传功能

当我上传时,客户端程序日志如下

Init Msg : {"name":"123.txt","size":32,"checksum":"773a98d860ee71a1455d3bc71556195a8bfde11f679b5eee5e6e3f4d16cd640f"}
Published to topic "$file/aafc162e-566e-468a-9dd1-6e4a27bce59d/init" qos 1 size:106
File transfer session initialized.
Send file segment start =>
Published to topic "$file/aafc162e-566e-468a-9dd1-6e4a27bce59d/0" qos 1 size:32
Send file segment end 
Published to topic "$file/aafc162e-566e-468a-9dd1-6e4a27bce59d/fin/32" qos 1 size:0
File transfer finished.
10:59:47.178 [MQTT Call: agent--3047bc68] INFO  c.t.c.m.c.MqttCallbackConfig - [deliveryComplete,91] - 向主题[$file/aafc162e-566e-468a-9dd1-6e4a27bce59d/init]发送数据! userProperties: {}, payload: {"name":"123.txt","size":32,"checksum":"773a98d860ee71a1455d3bc71556195a8bfde11f679b5eee5e6e3f4d16cd640f"}
10:59:47.180 [MQTT Call: agent--3047bc68] INFO  c.t.c.m.c.MqttCallbackConfig - [deliveryComplete,91] - 向主题[$file/aafc162e-566e-468a-9dd1-6e4a27bce59d/0]发送数据! userProperties: {}, payload: 009901FF0018100000010019F0FFFD81
10:59:47.181 [MQTT Call: agent--3047bc68] INFO  c.t.c.m.c.MqttCallbackConfig - [deliveryComplete,91] - 向主题[$file/aafc162e-566e-468a-9dd1-6e4a27bce59d/fin/32]发送数据! userProperties: {}, payload: 

权限的话,这边emqx是root账户安装,emqx start启动的
/data/upload也是root账户 mkdir -p /data/upload创建出来的

日志我只看到
/var/log/emqx/目录下有这些
emqx.log.1
emqx.log.idx
erlang.log.1
run_erl.log
上传时没有产生日志,emqx.log.1里面有一些错误

2023-09-18T17:57:11.057518+08:00 [error] Mnesia('emqx16@10.0.103.16'): ** ERROR ** Mnesia post_commit hook failed: error:badarg, Stacktrace:[{mria_rlog_server,dispatch,3,[{file,"mria_rlog_server.erl"},{line,109}]},{mnesia_hook,do_post_commit,2,[{file,"mnesia_hook.erl"},{line,76}]},{mnesia_tm,do_commit,3,[{file,"mnesia_tm.erl"},{line,1830}]},{mnesia_tm,doit_loop,1,[{file,"mnesia_tm.erl"},{line,309}]},{mnesia_sp,init_proc,4,[{file,"mnesia_sp.erl"},{line,34}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,240}]}]
2023-09-18T17:57:11.859821+08:00 [warning] msg: sync_cluster_conf_retry, mfa: emqx_conf_app:sync_cluster_conf2/1, line: 198, failed: [], nodes: ['emqx17@10.0.103.17','emqx15@10.0.103.15'], not_ready: [{error,#{msg => "init_conf_load_not_done",node => 'emqx17@10.0.103.17'}},{error,#{msg => "init_conf_load_not_done",node => 'emqx15@10.0.103.15'}}], timeout: 10203
2023-09-18T17:57:11.861959+08:00 [warning] msg: ignored_nodes_when_sync_cluster_conf, mfa: emqx_conf_app:sync_cluster_conf2/1, line: 152, failed: [], nodes: ['emqx17@10.0.103.17','emqx15@10.0.103.15'], not_ready: [{error,#{msg => "init_conf_load_not_done",node => 'emqx17@10.0.103.17'}}]
2023-09-18T17:57:11.865254+08:00 [warning] msg: config_key_not_recognized, mfa: emqx_config:warning_deprecated_root_key/1, line: 817, unknown_config_keys: file_transfer

config没有识别吗? unknown_config_keys: file_transfer 我再找找看

很高兴能帮助到您。请问您使用的是EMQX开源版5.1.2吗?开源版是不支持file_transfer的。从报错里也可以看出不支持。您可以考虑换到企业版。谢谢。
如果支持file_transfer,emqx在开启log debug模式时,emqx日志中能看到如下信息:
2023-09-15T01:38:57.744394+00:00 [debug] msg: starting_app, mfa: emqx_machine_boot:start_one_app/1, line: 110, app: emqx_ft