我正在创建一个 Azure 逻辑应用程序,它将在 FTP 服务器上创建一个新文件(来自大约 5KB 的 HTTP 正文内容)。
以下是 FTP 创建文件代码片段:
{
"inputs": {
"host": {
"connection": {
"name": "@parameters('$connections')['ftp']['connectionId']"
}
},
"method": "post",
"body": "@body('Provider_Post')",
"path": "/datasets/default/files",
"queries": {
"folderPath": "/",
"name": "filename_@{utcNow()}.xml",
"queryParametersSingleEncoded": true
},
"authentication": "@parameters('$authentication')"
},
"runtimeConfiguration": {
"contentTransfer": {
"transferMode": "Chunked"
}
}
}
此步骤需要很长时间(32 分钟),然后失败并出现以下错误:
MaxRequestCountReached. The maximum number of requests allowed '1000' was not sufficient to upload the entire content. Uploaded content length: '2378'. Total content length: '4877'.
该文件出现在 FTP 服务器上,但距文件末尾仅 2380 字节。
此错误意味着什么以及如何修复它? 5KB 不应该是太多的数据。这是关于 FTP 服务器的事情吗?我可以毫无问题地使用 FileZilla 发送文件。
我什至对此进行了测试,以便我创建了另一个步骤(在失败的步骤之前),该步骤将 HTTP 内容状态代码(因此,只是“200”)发送到一个新文件,并在一秒钟内成功写入它。
最佳答案
出现这种错误的原因是我在 ftp API 连接设置中禁用了二进制传输。
当我启用“二进制传输”复选框时,它会在几秒钟内写入文件。
关于Azure 逻辑应用 FTP 创建文件失败并出现 MaxRequestCountReached,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56520731/