FTP upload failed (FTPS)

Hi.

 

I'm trying to add Build step to Upload some filed to FTPS server (not SFTP).

I've filled the hostname, port, username, password and all required details - correctly.

I've tested with WinSCP - and the same credentials are working.

 

but the output log is really short and does not contain any real error:

[00:44:47]Step 3/3: FTP Upload
[00:44:48][Step 3/3] Step FTP Upload failed
 
how can I get to the bottom of the issue?
 
thanks in advance!
0
10 comments

Which version of teamcity/plugin are you using? Also, could you share a screenshot of the configuration? Feel free to obscure the urls and private details.

1
Avatar
Permanently deleted user

Version 2017.1.4 (build 47070)

 

i've duplicate the FTP upload step with some minor changes (different user names, different methods - Acitve/Passive), but as you can see from the second screenshot, all fail.

 


Thanks in advance!

0

Hi,

SFTP and FTPS are different protocols. SFTP is included in the SSH Upload (https://confluence.jetbrains.com/display/TCD10/SSH+Upload), as it works over SSH. Could you check whether that's the issue?

1
Avatar
Permanently deleted user

I was wrong, the server is FTPS and not SFTP.

tested again with WinSCP and i'm sure - it's FTPS and working with the same credentials.

 

is there a way to see more detailed log?

 

thanks!

0

Thanks for clarifying. Could you check the (FTP) server logs for any error messages on it? If there is nothing, you could also enable debug on the agent that runs the task (https://confluence.jetbrains.com/display/TCD10/Viewing+Build+Agent+Logs#ViewingBuildAgentLogs-GenericDebugLogging)? It should include some extra information such as the stacktrace, that could help in understanding what is going on.

1
Avatar
Permanently deleted user

Hi.

thank you for your responses. i really appropriate it!

 

so, I saw nothing on the FTPS server logs.

and this is what I found when in Debug mode:

 

[2017-10-01 00:08:06,070]  DEBUG - erStages.start.CallRunnerStage - Start build runner 'ftp-deploy-runner' for Build MyProject :: TestBuild #76 {id=1120, buildTypeId='MyProject_TestBuild'} 
[2017-10-01 00:08:06,070]   INFO - erStages.start.CallRunnerStage - ----------------------------------------- [ Step Step 3/6: 'upload to FTPS (FTP Upload)' (ftp-deploy-runner), Build MyProject :: TestBuild #76 {id=1120, buildTypeId='MyProject_TestBuild'} ] -----------------------------------------
[2017-10-01 00:08:06,318]   WARN - ent.ftp.FtpBuildProcessAdapter - Unrecognized SSL message, plaintext connection?: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
[2017-10-01 00:08:06,318]  DEBUG - ent.ftp.FtpBuildProcessAdapter - Unrecognized SSL message, plaintext connection?
javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
    at sun.security.ssl.InputRecord.handleUnknownRecord(InputRecord.java:710)
    at sun.security.ssl.InputRecord.read(InputRecord.java:527)
    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:973)
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1387)
    at org.apache.commons.net.ftp.FTPSClient.sslNegotiation(FTPSClient.java:289)
    at org.apache.commons.net.ftp.FTPSClient._connectAction_(FTPSClient.java:220)
    at org.apache.commons.net.SocketClient.connect(SocketClient.java:189)
    at org.apache.commons.net.SocketClient.connect(SocketClient.java:209)
    at jetbrains.buildServer.deployer.agent.ftp.FtpBuildProcessAdapter.runProcess(FtpBuildProcessAdapter.java:78)
    at jetbrains.buildServer.deployer.agent.SyncBuildProcessAdapter.start(SyncBuildProcessAdapter.java:54)
    at jetbrains.buildServer.agent.impl.buildStages.runnerStages.start.CallRunnerStage.doBuildStage(CallRunnerStage.java:74)
    at jetbrains.buildServer.agent.impl.buildStages.RunnerStagesExecutor$1.callStage(RunnerStagesExecutor.java:25)
    at jetbrains.buildServer.agent.impl.buildStages.RunnerStagesExecutor$1.callStage(RunnerStagesExecutor.java:18)
    at jetbrains.buildServer.agent.impl.buildStages.StagesExecutor.callRunStage(StagesExecutor.java:78)
    at jetbrains.buildServer.agent.impl.buildStages.StagesExecutor.doStages(StagesExecutor.java:37)
    at jetbrains.buildServer.agent.impl.buildStages.RunnerStagesExecutor.doStages(RunnerStagesExecutor.java:18)
    at jetbrains.buildServer.agent.impl.buildStages.startStages.steps.RunnerContextExecutor.callRunnerStages(RunnerContextExecutor.java:43)
    at jetbrains.buildServer.agent.impl.buildStages.startStages.steps.StepExecutor.processNextStep(StepExecutor.java:25)
    at jetbrains.buildServer.agent.impl.buildStages.startStages.steps.ForEachBuildRunnerStage.executeRunnerStep(ForEachBuildRunnerStage.java:138)
    at jetbrains.buildServer.agent.impl.buildStages.startStages.steps.ForEachBuildRunnerStage.runStep(ForEachBuildRunnerStage.java:123)
    at jetbrains.buildServer.agent.impl.buildStages.startStages.steps.ForEachBuildRunnerStage.executeBuildRunners(ForEachBuildRunnerStage.java:83)
    at jetbrains.buildServer.agent.impl.buildStages.startStages.steps.ForEachBuildRunnerStage.doBuildStage(ForEachBuildRunnerStage.java:44)
    at jetbrains.buildServer.agent.impl.buildStages.BuildStagesExecutor$1.callStage(BuildStagesExecutor.java:31)
    at jetbrains.buildServer.agent.impl.buildStages.BuildStagesExecutor$1.callStage(BuildStagesExecutor.java:24)
    at jetbrains.buildServer.agent.impl.buildStages.StagesExecutor.callRunStage(StagesExecutor.java:78)
    at jetbrains.buildServer.agent.impl.buildStages.StagesExecutor.doStages(StagesExecutor.java:37)
    at jetbrains.buildServer.agent.impl.buildStages.BuildStagesExecutor.doStages(BuildStagesExecutor.java:24)
    at jetbrains.buildServer.agent.impl.BuildRunActionImpl.doStages(BuildRunActionImpl.java:75)
    at jetbrains.buildServer.agent.impl.BuildRunActionImpl.runBuild(BuildRunActionImpl.java:55)
    at jetbrains.buildServer.agent.impl.BuildAgentImpl.doActualBuild(BuildAgentImpl.java:295)
    at jetbrains.buildServer.agent.impl.BuildAgentImpl.access$100(BuildAgentImpl.java:53)
    at jetbrains.buildServer.agent.impl.BuildAgentImpl$1.run(BuildAgentImpl.java:259)
    at java.lang.Thread.run(Thread.java:745)
[2017-10-01 00:08:06,319]   INFO - ges.RunnerFinishStagesExecutor - Call finish stage jetbrains.buildServer.agent.impl.buildStages.runnerStages.finish.UnsubscribePropertiesFileUpdaterRunnedFStage
[2017-10-01 00:08:06,319]   INFO - ges.RunnerFinishStagesExecutor - Call finish stage jetbrains.buildServer.agent.impl.buildStages.runnerStages.finish.FlushBuildLogRunnerFStage
[2017-10-01 00:08:06,319]  DEBUG - r.agent.impl.AgentLogProxyImpl - Flush messages for explicit request from TC: 00:07:36 Build {id=1120, buildTypeId='MyProject_TestBuild', buildTypeInternalId='bt1'}

 

so, I guess that the real question is - what is the "Unrecognized SSL message". is there a way to find?

 

thanks again!

Dima.

0

Hi Dima,

this is usually a message displayed when the FTP server is not set up for secure connections but a secure connection tries to be established. In general, the message is not understood, which usually happens when it expects encryption and it receives a regular message, but might also happen if it receives a message for a completely different protocol.

Also I was double checking your previous message. WinSCP claims itself to be for SFTP on the own title of the page and doesn't mention FTPS there, it seems to support FTPS as well but as the option (in their website) is not so prominent, I'd want to ensure that you have double checked.

1
Avatar
Permanently deleted user

Hi Denis.

 

I've checked again, and I am able to connect with WinSCP.  here's the Server and protocol information for a successful session:

 



so, what should I do? set it as a regular FTP?

 

thanks in advance!

0
Avatar
Permanently deleted user

I think I know the reason for the issue, but I don't know how to solve/bypass it.

 

the certificate was issued for domain mysite.com, but the server is located on a subdomain (a.mysite.com).

so, when I used WinSCP for the first time, I got this warning:

 

I guess that this is the internal message that TeamCity is seeing, but I really don't know how to overcome it.

 

any idea will be appreciated.

thanks again.

0

Hi Dima,

good catch. That's a possible reason, although it's kind of strange that the SSL Exception isn't clearer about the certificate not being trusted.

The connection is established from the build agent, so you will need to add the key to the agent's keystore. While this is thought for connecting an agent directly to teamcity, the process should be the same for connecting to any other ssl server: https://confluence.jetbrains.com/display/TCD10/Using+HTTPS+to+access+TeamCity+server#UsingHTTPStoaccessTeamCityserver-ConfiguringJVM

1

Please sign in to leave a comment.