【发布时间】: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