【问题标题】:FTP Upload in Release Pipeline fails with FTPError: 500 Syntax error, command unrecognized发布管道中的 FTP 上传失败并出现 FTPError: 500 Syntax error, command unrecognized
【发布时间】:2020-02-17 14:53:32
【问题描述】:

我在 Azure Devops 中创建了一个发布管道,它首先归档两个文件,然后尝试将这些 zip 文件上传到 FTP 服务器。

存档工作正常,但上传任务总是失败。我收到以下控制台输出:

2020-02-13T10:28:03.9716469Z ##[section]Starting: FTP Upload: $(Build.ArtifactStagingDirectory)
2020-02-13T10:28:03.9792841Z ==============================================================================
2020-02-13T10:28:03.9792892Z Task         : FTP upload
2020-02-13T10:28:03.9792921Z Description  : Upload files using FTP
2020-02-13T10:28:03.9792964Z Version      : 2.157.0
2020-02-13T10:28:03.9792992Z Author       : Microsoft Corporation
2020-02-13T10:28:03.9793020Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/ftp-upload
2020-02-13T10:28:03.9793049Z ==============================================================================
2020-02-13T10:28:04.9536900Z connecting to: mydomain.com:21
2020-02-13T10:28:05.1325089Z ##[error]FTPError: 500 Syntax error, command unrecognized.
2020-02-13T10:28:05.1333616Z ##[error]Ftp Upload failed
2020-02-13T10:28:31.5036758Z ##[error]The operation was canceled.
2020-02-13T10:28:31.5040435Z ##[section]Finishing: FTP Upload: $(Build.ArtifactStagingDirectory)

这是我的 YAML:

steps:
- task: FtpUpload@2
  displayName: 'FTP Upload: $(Build.ArtifactStagingDirectory)'
  inputs:
    credentialsOption: inputs
    serverUrl: 'ftp://mydomain.com'
    username: usr
    password: pwd
    rootDirectory: '$(Build.ArtifactStagingDirectory)'
    remoteDirectory: '/files/upload-Test/'
    trustSSL: true

我也尝试连接到不同的 SFTP 服务器,但收到了类似的结果:FTPError: 550 SSL/TLS required on the control channel

您有什么建议我可以尝试以完成这项工作吗?

编辑:现在带有调试输出:

expanding braces
pattern: 'D:/a/r1/a/$(Build.ArtifactStagingDirectory)/**'
applying include pattern against original list
1 matches
1 final results
Found total matches: 1
adding file:   D:\a\r1\a\$(Build.ArtifactStagingDirectory)\FILENAME.zip
connecting to: domain.com:21
Connected to MY-IP
< 220 Speak friend, and enter
Login security: No encryption
> USER usr
< 331 FTP login okay, send password.
> PASS ###
< 230 User logged in, proceed.
> TYPE I
< 200 Using BINARY mode to transfer data.
> STRU F
< 500 Syntax error, command unrecognized.
FTPError: 500 Syntax error, command unrecognized.
Processed: ##vso[task.issue type=error;]FTPError: 500 Syntax error, command unrecognized.
task result: Failed
Ftp Upload failed
Processed: ##vso[task.issue type=error;]Ftp Upload failed
Processed: ##vso[task.complete result=Failed;]Ftp Upload failed

【问题讨论】:

    标签: azure azure-devops ftp


    【解决方案1】:

    对于这个问题,最近发生了 Azure DevOps 可用性下降的事件,这可能是导致此错误的原因。

    AT 的短缺导致 AT 上的 CPU 过高,从而导致跨板、回购、管道和测试计划的命令缓慢和失败。

    如果您想了解更多详细信息,请参阅此report。该问题现已完全缓解。

    【讨论】:

    • 我猜你建议 FTP 上传现在应该可以工作了?我刚刚重新部署了管道并收到了相同的结果。是否有可能打开更多诊断、详细输出或类似功能?
    • 可以设置system.debug= true获取更详细的日志
    • 你有什么其他想法我可以尝试吗?
    • 您可以尝试用私人代理运行,看看是否同样的结果。
    猜你喜欢
    • 2021-11-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-07-30
    • 2013-04-09
    • 1970-01-01
    相关资源
    最近更新 更多