JetBrains / teamcity-deployer-plugin

Deployer plugin for TeamCity CI server
http://confluence.jetbrains.net/display/TW/Deployer+plugin
Apache License 2.0
39 stars 29 forks source link

NPE in FtpBuildProcessAdapter #68

Closed nskvortsov closed 8 years ago

nskvortsov commented 8 years ago

Caused by: java.lang.NullPointerException at jetbrains.buildServer.deployer.agent.ftp.FtpBuildProcessAdapter.dirExists(FtpBuildProcessAdapter.java:386) at jetbrains.buildServer.deployer.agent.ftp.FtpBuildProcessAdapter.createPath(FtpBuildProcessAdapter.java:358) at jetbrains.buildServer.deployer.agent.ftp.FtpBuildProcessAdapter.access$400(FtpBuildProcessAdapter.java:32) at jetbrains.buildServer.deployer.agent.ftp.FtpBuildProcessAdapter$1.run(FtpBuildProcessAdapter.java:221)

nskvortsov commented 8 years ago

Fixed in this build

vladkosarev commented 8 years ago

Used the build that's linked and got a success in TP. The issue is thought that nothing was changed on the server. Upload took time and shows that multiple files were uploaded but FileZilla shows otherwise.

nskvortsov commented 8 years ago

@vladkosarev please enable teamcity agent debug logs https://confluence.jetbrains.com/display/TCD8/Viewing+Build+Agent+Logs and use lateset build: https://teamcity.jetbrains.com/repository/download/bt402/622858:id/deploy-runner.zip

vladkosarev commented 8 years ago

Put the newest version up and now get a new error 0 [2015-11-12 07:31:24,696] ERROR - jetbrains.buildServer.AGENT - Failed to upload artifacts via FTP. Reply was: 501 Server cannot accept argument.

jetbrains.buildServer.RunBuildException: Failed to upload artifacts via FTP. Reply was: 501 Server cannot accept argument.

at jetbrains.buildServer.deployer.agent.ftp.InterruptibleUploadProcess.dirExists(InterruptibleUploadProcess.java:162)
at jetbrains.buildServer.deployer.agent.ftp.InterruptibleUploadProcess.createPath(InterruptibleUploadProcess.java:124)
at jetbrains.buildServer.deployer.agent.ftp.InterruptibleUploadProcess.run(InterruptibleUploadProcess.java:68)
at java.lang.Thread.run(Thread.java:745)
nskvortsov commented 8 years ago

@vladkosarev apologize for this. Looks like there is something special about the server. I have prepared a new build of plugin for you: https://teamcity.jetbrains.com/guestAuth/repository/download/bt402/624162:id/deploy-runner.zip?guest=1 Please install it, open FTP deployer settings, enable "Debug" check box and run the build once again. Then attach the part of log with failure here.

vladkosarev commented 8 years ago

[09:16:24][Step 1/1] > USER [09:16:24] [Step 1/1] < 331 Password required [09:16:24][Step 1/1] > PASS [09:16:25] [Step 1/1] < 230 User logged in. [09:16:25][Step 1/1] Starting upload via FTP to ftp://omitted.ftp.azurewebsites.windows.net/site/wwwroot [09:16:25] [Step 1/1] > PWD [09:16:25] [Step 1/1] < 257 "/" is current directory. [09:16:25] [Step 1/1] > PORT 10,210,184,115,245,181 [09:16:25] [Step 1/1] < 501 Server cannot accept argument. [09:16:25] [Step 1/1] Exception while uploading files: Failed to upload artifacts via FTP. Reply was: 501 Server cannot accept argument. [09:16:25] [Step 1/1] Failed to upload artifacts via FTP. Reply was: 501 Server cannot accept argument.

nskvortsov commented 8 years ago

Do you use any secure settings? (like FTPS or FTPES)

vladkosarev commented 8 years ago

No, but I can try and point to a secure ftp and try again (that still wouldn't explain why plan didn't work).

nskvortsov commented 8 years ago

No, you should not. I think, there is something wrong about active/passive ftp mode. I will try to implement it soon.

nskvortsov commented 8 years ago

So it is ready. Try this build: https://teamcity.jetbrains.com/guestAuth/repository/download/bt402/624450:id/deploy-runner.zip?guest=1 There is an additional option of "FTP Mode": Active or Passive, with default to passive (it was active before). Give it a try (use Passive mode)

vladkosarev commented 8 years ago

Set it to active and it failed. Set it to passive and it worked! Thank you!

inbanco commented 8 years ago

I'm having this same issue where i get the error Exception while uploading files: Failed to upload artifacts via FTP. Reply was: 501 Server cannot accept argument. Can i try the active/passive mode option? That link is dead

nskvortsov commented 8 years ago

@inbanco please try this build: https://teamcity.jetbrains.com/guestAuth/repository/download/bt402/662499:id/deploy-runner.zip?guest=1

jst-cyr commented 8 years ago

Thanks for this @nskvortsov! I had the same 501 error using FTPES and needed that build to specify the passive mode. However, with that build I now receive a 534 error. I can see in the FTP server logs the control channel authenticating, but when an upload message is sent, the response in the logs reads "534 SSL Policy requires SSL for data channel". Is there an additional configuration required to force the SSL over the data channel?

jst-cyr commented 8 years ago

@nskvortsov: You can ignore me! This turned out to be an IIS configuration issue. If the FTP Security settings for the certificate is assigned to the FTP site, but not at the root level of the IIS server, this error is received when SSL is required.

nskvortsov commented 8 years ago

Jason, Thank you for the follow up! 4 марта 2016 г. 1:16 пользователь "Jason St-Cyr" notifications@github.com написал:

@nskvortsov https://github.com/nskvortsov: You can ignore me! This turned out to be an IIS configuration issue. If the FTP Security settings for the certificate is assigned to the FTP site, but not at the root level of the IIS server, this error is received when SSL is required.

— Reply to this email directly or view it on GitHub https://github.com/JetBrains/teamcity-deployer-plugin/issues/68#issuecomment-191991103 .