1 vote
FtpPublisher throwing WebException

Description

 
I just cannot get FtpPublisher to upload some build packages, instead it throws a WebException when attempting to upload files. Here's my config:

<ftpPublisher>
<username>ccnet</username>
<password>ccnetpassword</password>
<continueOnFailure>true</continueOnFailure>
<server>my.remote.server</server>
<port>21</port>
<useSsl>false</useSsl>
<usePassive>false</usePassive>
<workingDirectory>/latest</workingDirectory>
<files>
<file>D:\Deploy\build.label</file>
<file>D:\Deploy\MyPackage.msi</file>
<file>D:\Deploy\MyScripts.zip</file>
</files>
<timeout>60</timeout>
</ftpPublisher>

and here's a sample from the CC.NET log file:

2009-04-28 15:05:15,342 [Build MyBuild:DEBUG] Uploading D:\Deploy\build.label to ftp://my.remote.server/latest/
2009-04-28 15:05:15,405 [Build MyBuild:WARN] INTERNAL ERROR: The requested URI is invalid for this FTP command.
----------
System.Net.WebException: The requested URI is invalid for this FTP command.
at System.Net.FtpWebRequest.GetRequestStream()
at CCNet.Community.Plugins.Components.Ftp.FtpWebRequest.Write(Uri ftpUrl, String method, Stream stream) in d:\Source\ccnetplugins-22541\trunk\CCNet.Community.Plugins\CCNet.Community.Plugins\Components\Ftp\FtpWebRequest.cs:line 267
at CCNet.Community.Plugins.Components.Ftp.FtpWebRequest.UploadFile(Stream fileStream, Uri ftpUrl) in d:\Source\ccnetplugins-22541\trunk\CCNet.Community.Plugins\CCNet.Community.Plugins\Components\Ftp\FtpWebRequest.cs:line 243
at CCNet.Community.Plugins.Components.Ftp.FtpWebRequest.UploadFile(FileInfo localFile, Uri ftpUrl) in d:\Source\ccnetplugins-22541\trunk\CCNet.Community.Plugins\CCNet.Community.Plugins\Components\Ftp\FtpWebRequest.cs:line 234
at CCNet.Community.Plugins.Publishers.FtpPublisher.Run(IIntegrationResult result) in d:\Source\ccnetplugins-22541\trunk\CCNet.Community.Plugins\CCNet.Community.Plugins\Publishers\FtpPublisher.cs:line 231
----------

From the commandline, I can connect fine to the FTP server, using the specified credentials. Any idea what's going on?


Comments

most recent at top (show oldest at top)
CtrlAltDel wrote May 1 2009 at 3:17 AM
OK, the Uri for the FtpWebRequest was not being generated properly - it needs the name of the file in there as well. I've added a patch to fix it (see attached, against trunk revision 24559).

Updating...
© 2006-2010 Microsoft | About CodePlex | Privacy Statement | Terms of Use | Code of Conduct | Advertise With Us | Version 2010.1.12.16187