【发布时间】:2020-04-08 09:40:59
【问题描述】:
在我的 NiFi 工作流程中,我需要从 SOAP 网络服务器下载 .zip 文件,将其保存在机器上(可选)并将内容解压缩到子文件夹。一切都在我的本地 Win 10 机器上运行,但是当我尝试移动到远程 Linux 服务器时出现问题。这是发生错误时我的流程的一部分:
所以我们输入了一个 FlowFile UpdateAttribute,其中文件名属性设置为所需的名称和 .zip 扩展名。启动处理器后,在队列中可以看到文件是正确的。
当我将 FlowFile 传递给 PutFile 处理器时,问题开始发生。我根据所选目录尝试了不同的场景:
相对于NiFi主文件夹./out:
12:30:01 MSK ERROR
PutFile[id=05788ae5-64e5-32af-bb40-88d50d4c886c] Penalizing StandardFlowFileRecord[uuid=3e0c5e38-76f8-4ce3-b911-90f6901c35a4,claim=StandardContentClaim [resourceClaim=StandardResourceClaim[id=1586337594333-49, container=default, section=49], offset=2335, length=375628606],offset=0,name=,size=375628606] and transferring to failure due to /opt/nifi/nifi-1.11.4/./out: java.nio.file.DirectoryNotEmptyException: /opt/nifi/nifi-1.11.4/./out
12:30:01 MSK ERROR
PutFile[id=05788ae5-64e5-32af-bb40-88d50d4c886c] Unable to remove temporary file /opt/nifi/nifi-1.11.4/./out/. due to /opt/nifi/nifi-1.11.4/./out/.: Invalid argument: java.nio.file.FileSystemException: /opt/nifi/nifi-1.11.4/./out/.: Invalid argument
完整路径/opt/nifi/nifi-1.11.4/out/file/:
12:32:45 MSK ERROR
PutFile[id=0171102b-c82d-149d-c9ae-ea4da99b1750] Penalizing StandardFlowFileRecord[uuid=0573803f-8407-46e4-93f0-e52a5fc35a07,claim=StandardContentClaim [resourceClaim=StandardResourceClaim[id=1586337594333-49, container=default, section=49], offset=2335, length=375628606],offset=0,name=,size=375628606] and transferring to failure due to Failed to export StandardFlowFileRecord[uuid=0573803f-8407-46e4-93f0-e52a5fc35a07,claim=StandardContentClaim [resourceClaim=StandardResourceClaim[id=1586337594333-49, container=default, section=49], offset=2335, length=375628606],offset=0,name=,size=375628606] to /opt/nifi/nifi-1.11.4/out/file/. due to java.io.FileNotFoundException: /opt/nifi/nifi-1.11.4/out/file/. (No such file or directory): org.apache.nifi.processor.exception.FlowFileAccessException: Failed to export StandardFlowFileRecord[uuid=0573803f-8407-46e4-93f0-e52a5fc35a07,claim=StandardContentClaim [resourceClaim=StandardResourceClaim[id=1586337594333-49, container=default, section=49], offset=2335, length=375628606],offset=0,name=,size=375628606] to /opt/nifi/nifi-1.11.4/out/file/. due to java.io.FileNotFoundException: /opt/nifi/nifi-1.11.4/out/file/. (No such file or directory)
所以它在路径中添加点('.')会导致异常。创建所有文件夹并授予权限。我尝试使用 42B 文件和相同路径(GenerateFlowFile -> PutFile)运行简单的测试流程,一切正常。
我做错了什么?
【问题讨论】:
-
您可以尝试将文件名添加到您的路径吗? /opt/nifi/nifi-1.11.4/out/file/${fileName}
-
不幸的是它没有帮助:
/opt/nifi/nifi-1.11.4/out/file/. due to java.io.FileNotFoundException: /opt/nifi/nifi-1.11.4/out/file/. (No such file or directory) -
你的 ${fileName} 是 "." ?当您的流文件在队列中时,您可以查看属性吗
-
我检查过:文件名是“fias_delta_dbf.zip”。如果我尝试下载内容,则会使用此名称下载内容。尽管如此,PutFile 进程仍会添加“.”。在文件名的开头
-
我尝试简单地将“upd.zip”分配给文件名,但没有帮助。我也删除了“文件名”属性,但是“。”仍然出现。
标签: apache-nifi