Strange CFFTP error

235 views
Skip to first unread message

Snick

unread,
Jun 15, 2010, 6:02:29 AM6/15/10
to ra...@googlegroups.com
Hi there,
I'm now tweaking live CFML on an EC2 instance - whoohoo!

Just checking a few applications and I have found a strange CFFTP message that I dont get.

Here's my code:

<cftry><cfftp connection="myConnection" 
           username="8888888" 
           password="8888888" 
           server="888888" 
           action="Open" 
           stoponerror="Yes" > 
<cfftp action="changedir"
connection="myconnection" directory="/public_html/uploaded_samples/synth">
 
<cfftp 
 connection = "myConnection"
 action = "putFile" 
 name = "uploadFile" 
 transferMode = "binary" 
 localFile = "/home/sonicstate/www/uploads/audio/test.mp3" 
 remoteFile = "009999.mp3" 
 retrycount="3" >
<cfcatch>
<cfdump var ="#cfcatch#" />
</cfcatch>
</cftry>

I can ftp from the command line using the same credentials as in the cfftp tag, but CFFTP throws this error:


string 500 I won't open a connection to 10.248.187.99 (only to 184.73.224.24)
Code
number 500
Detail
string 500 I won't open a connection to 10.248.187.99 (only to 184.73.224.24)
ErrorCode
string 0
ExtendedInfo
string
Message
string action [putfile] from tag ftp failed
StackTrace
string action [putfile] from tag ftp failed at railo.runtime.tag.Ftp.checkCompletion(Ftp.java:640):640 at railo.runtime.tag.Ftp.doEndTag(Ftp.java:178):178 at t.cfftp_test_cfm$cf.call(/home/sonicstate/www/sonicstate.com/t/cfftp_test.cfm:18):18 at railo.runtime.PageContextImpl.doInclude(PageContextImpl.java:674):674 at railo.runtime.listener.ClassicAppListener._onRequest(ClassicAppListener.java:35):35 at railo.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:24):24 at railo.runtime.PageContextImpl.execute(PageContextImpl.java:1765):1765 at railo.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:280):280 at railo.loader.servlet.CFMLServlet.service(CFMLServlet.java:32):32 at javax.servlet.http.HttpServlet.service(HttpServlet.java:91):91 at com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:103):103 at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:187):187 at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:265):265 at com.caucho.server.hmux.HmuxRequest.handleRequest(HmuxRequest.java:436):436 at com.caucho.server.port.TcpConnection.

SNick

unread,
Jun 15, 2010, 9:22:03 AM6/15/10
to Railo
Okay, I have found the issue with using passive mode and added
passive="yes" to all instances of cfftp in my code, but I'm still
getting the same error.
I have also double checked the same set of commands when issued from
the command line on the EC2 instance which does work okay.

Is there anything else that may be worth looking at or might this be a
bug?

Many thanks
> string500 I won't open a connection to 10.248.187.99 (only to 184.73.224.24)
> Codenumber500Detailstring500 I won't open a connection to 10.248.187.99
> (only to 184.73.224.24)ErrorCodestring0ExtendedInfostringMessagestringaction
> [putfile] from tag ftp failedStackTracestringaction [putfile] from tag ftp
> failed at railo.runtime.tag.Ftp.checkCompletion(Ftp.java:640):640 at
> railo.runtime.tag.Ftp.doEndTag(Ftp.java:178):178 at
> t.cfftp_test_cfm$cf.call(/home/sonicstate/www/
> sonicstate.com/t/cfftp_test.cfm:18):18 at
> railo.runtime.PageContextImpl.doInclude(PageContextImpl.java:674):674 at
> railo.runtime.listener.ClassicAppListener._onRequest(ClassicAppListener.jav a:35):35
> at
> railo.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:24) :24
> at railo.runtime.PageContextImpl.execute(PageContextImpl.java:1765):1765 at
> railo.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:280):28 0
> at railo.loader.servlet.CFMLServlet.service(CFMLServlet.java:32):32 at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:91):91 at
> com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.j ava:103):103

Sean Corfield

unread,
Jun 15, 2010, 5:15:04 PM6/15/10
to ra...@googlegroups.com
On Tue, Jun 15, 2010 at 3:02 AM, Snick <soni...@gmail.com> wrote:
string 500 I won't open a connection to 10.248.187.99 (only to 184.73.224.24)

Have you tried using the 184... IP address in the CFFTP tag for the connection?

I know there are some network limitations on using internal vs external IP addresses within Amazon and it might be that Java's DNS lookup is picking the wrong one.
--
Sean A Corfield -- (904) 302-SEAN
Railo Technologies, Inc. -- http://getrailo.com/
An Architect's View -- http://corfield.org/

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood

Snick

unread,
Jun 15, 2010, 6:32:29 PM6/15/10
to ra...@googlegroups.com
Thats the address of the elastic IP for this instance, I think if I use that I'll be connecting to myself, if you see what I mean.

Its only the putfile part of the cfftp that throws the error, if I open the connection and change directory, that seems to be fine.

But, in case this needs sorting:
How do I get Java's DNS to look in the right place - that sounds like a horrid process of bash messing right there.

Or perhaps theres a work around for this.
Maybe if I explain it, something might suggest itself?

Submissions of images and MP3s can be submitted and associated with listings in my DB.
Currently, I receive the file, the app emails me, I approve and process by renaming the file and uploading it to my image/mp3 location which is off server - hence the cfftp.

Many thanks for this - its the last piece of the puzzle and its frustrating that I've come up against something.

Nick

Snick

unread,
Jun 16, 2010, 6:09:11 PM6/16/10
to ra...@googlegroups.com
Okay, I'm truly stumped. I cant find anything referring to how to ensure Railo picks up the external IP rather than the internal one. I think what is happening is that the CFFTP tag attempts to open a port is that is refers to the internal IP which of course cannot accept any incoming connections from  the oustide world.

I've tried putting passive="true" to all tags and then adding the external IP to the hosts file and the like, but all to no effect. 
I cant seem to find any reference to this issue when searching.

I guess my question would be, has anyone successfully executed CFFTP putFile  from an EC2 instance.
So I can narrow down the culprit. many thanks.

Nick

Michael Forell

unread,
Jun 17, 2010, 2:34:53 PM6/17/10
to Railo
Hi Nick,

although I'm not sure this affects your installation, as I don't know
the amazin setup. I think Railo still has a bug with CFFTP and passive
mode.
https://jira.jboss.org/browse/RAILO-323

Maybe Micha can fix this for one of the following releases, as I think
one of those two solutions might work?

Regards
Michael


On Jun 17, 12:09 am, Snick <sonic....@gmail.com> wrote:
> Okay, I'm truly stumped. I cant find anything referring to how to ensure
> Railo picks up the external IP rather than the internal one. I think what is
> happening is that the CFFTP tag attempts to open a port is that is refers to
> the internal IP which of course cannot accept any incoming connections from
>  the oustide world.
>
> I've tried putting passive="true" to all tags and then adding the external
> IP to the hosts file and the like, but all to no effect.
> I cant seem to find any reference to this issue when searching.
>
> I guess my question would be, has anyone successfully executed CFFTP putFile
>  from an EC2 instance.
> So I can narrow down the culprit. many thanks.
>
> Nick
>
> On 15 June 2010 23:32, Snick <sonic....@gmail.com> wrote:
>
> > Thats the address of the elastic IP for this instance, I think if I use
> > that I'll be connecting to myself, if you see what I mean.
>
> > Its only the putfile part of the cfftp that throws the error, if I open the
> > connection and change directory, that seems to be fine.
>
> > But, in case this needs sorting:
> > How do I get Java's DNS to look in the right place - that sounds like a
> > horrid process of bash messing right there.
>
> > Or perhaps theres a work around for this.
> > Maybe if I explain it, something might suggest itself?
>
> > Submissions of images and MP3s can be submitted and associated with
> > listings in my DB.
> > Currently, I receive the file, the app emails me, I approve and process by
> > renaming the file and uploading it to my image/mp3 location which is off
> > server - hence the cfftp.
>
> > Many thanks for this - its the last piece of the puzzle and its frustrating
> > that I've come up against something.
>
> > Nick
>
> > On 15 June 2010 22:15, Sean Corfield <seancorfi...@gmail.com> wrote:
>
> >> On Tue, Jun 15, 2010 at 3:02 AM, Snick <sonic....@gmail.com> wrote:
>
> >>>  string 500 I won't open a connection to 10.248.187.99 (only to
> >>> 184.73.224.24)
>
> >> Have you tried using the 184... IP address in the CFFTP tag for the
> >> connection?
>
> >> I know there are some network limitations on using internal vs external IP
> >> addresses within Amazon and it might be that Java's DNS lookup is picking
> >> the wrong one.
> >> --
> >> Sean A Corfield -- (904) 302-SEAN
> >> Railo Technologies, Inc. --http://getrailo.com/
> >> An Architect's View --http://corfield.org/

Snick

unread,
Jun 17, 2010, 2:44:35 PM6/17/10
to ra...@googlegroups.com
Aha, that _could_ be it. 

thanks, fingers crossed.

Dont suppose anyone can think of a workaround way to solve my issue, as I was hoping to go live quite soon.

denstar

unread,
Jun 17, 2010, 3:49:33 PM6/17/10
to ra...@googlegroups.com
On Thu, Jun 17, 2010 at 12:44 PM, Snick wrote:
> Aha, that _could_ be it.
> thanks, fingers crossed.
> Dont suppose anyone can think of a workaround way to solve my issue, as I
> was hoping to go live quite soon.

Do you *have* to use FTP? What about SCP/SSH?

:den

--
I thoroughly disapprove of duels. If a man should challenge me, I
would take him kindly and forgivingly by the hand and lead him to a
quiet place and kill him.
Mark Twain

Snick

unread,
Jun 17, 2010, 4:51:34 PM6/17/10
to ra...@googlegroups.com
Thanks for the suggestion.
I dont know how I would do that, would it be via cfexecute?
FTP works from the command line, just not from Railo so I could use FTP, jusrt not CFFTP, but I'm not familliar with how I might go about that.



Nick

denstar

unread,
Jun 17, 2010, 5:12:19 PM6/17/10
to ra...@googlegroups.com
On Thu, Jun 17, 2010 at 2:51 PM, Snick wrote:
> Thanks for the suggestion.
> I dont know how I would do that, would it be via cfexecute?
> FTP works from the command line, just not from Railo so I could use FTP,
> jusrt not CFFTP, but I'm not familliar with how I might go about that.

Is this with Windows boxes? If so, FTP will probably be easier.

Also, since you've got stuff set up for FTP already, it might be
easiest to use the cfexecute tag to do it.

I don't have any hints for that, sadly. I always google it when I need it.

FWIW, if it's not to Windows boxes, I'm pretty sure I have a cfscp tag somewhere

...and I'm *thinking* that cffile can do SCP type operations, but
don't quote me on that. Hrm, check this out:

http://classic.railo.ch/en/index.cfm?treeID=339

Might be worth a shot?

:den

--
People seem to enjoy things more when they know a lot of other people
have been left out of the pleasure.
Russell Baker

Ryan LeTulle

unread,
Jun 17, 2010, 5:18:49 PM6/17/10
to ra...@googlegroups.com
Don't laugh but I had to cfhttp a php file until the cfftp tag is fixed.

<cfhttp method="get" url="http://www.example.com/ftp.php"></cfhttp>

</ryan>

Snick

unread,
Jun 17, 2010, 5:43:08 PM6/17/10
to ra...@googlegroups.com
Thanks, thats a very interesting function, although I cant quite get it to work, trying this:

<cffile action="copy" 
source="/home/sonicstate/www/uploads/audio/test.mp3" 

I get this error:

can't write file [ftp://userxxx:xx...@ftp.mydomain.com:21/public_html/uploaded_samples/synth/test.mp3] as a file, missing parent directory


I'm sure I am doing something dumb. But its late and I am fried.

Thanks

denstar

unread,
Jun 17, 2010, 6:02:52 PM6/17/10
to ra...@googlegroups.com
I've never actually tried doing FTP with CFFILE, so I dunno what the issue could be.  Might not be you at all tho, ja know?

I do have access to an FTP server to test on tho, I think... what version of Railo are you running?

:Den

-- 
Advice to writers: Sometimes you just have to stop writing. Even before you begin. 
Stanislaw J. Lec 

Todd Rafferty

unread,
Jun 17, 2010, 6:07:22 PM6/17/10
to ra...@googlegroups.com
When the user logs in, they're in what directory? Do they have immediate access to /public_html/uploaded_samples/synth?

Can you log onto your box and show us the full 'pwd' path? Should look something like:

[tuser@server www]#pwd
/path/to/public_html/www/folder/folder/folder
--
~Todd Rafferty ** Volunteer Railo Open Source Community Manager ** http://getrailo.org/

Snick

unread,
Jun 17, 2010, 6:08:30 PM6/17/10
to ra...@googlegroups.com
Hi Den, latest build 0014 I believe.

Snick

unread,
Jun 17, 2010, 6:26:00 PM6/17/10
to ra...@googlegroups.com
pwd returns "/"

under which public_html/etc...

but I know that this is in /home/user/ 

But this is standard ftp setup for all my linux cpanel boxes

Thanks for your help!

Nick

Todd Rafferty

unread,
Jun 17, 2010, 6:30:39 PM6/17/10
to ra...@googlegroups.com
Can you ping me offlist with a username / pass, so I can check this out?

Michael Offner-Streit

unread,
Jun 18, 2010, 12:39:01 PM6/18/10
to ra...@googlegroups.com
does the directory ftp://userxxx:xx...@ftp.mydomain.com:21/public_html/uploaded_samples/synth/ exists?

the ftp resource will fail as well, because it use exact the same functionality as cfftp.

/micha


Snick schrieb:

Michael Offner-Streit

unread,
Jun 18, 2010, 12:39:36 PM6/18/10
to ra...@googlegroups.com
We will look into this ticket and fix for the next patch release, stay tuned.

/micha

Snick schrieb:

Todd Rafferty

unread,
Jun 18, 2010, 1:10:12 PM6/18/10
to ra...@googlegroups.com
This is a different error that I'm getting on his box:
can't write to file [ftp://xxx:xxx@domain:21/public_html/uploaded_samples/synth/test_from_todd_railo.txt],file is readonly

I can cfdirectory just fine, but I run into that error. Looks like a permission issue?

Michael Offner-Streit

unread,
Jun 23, 2010, 11:04:25 AM6/23/10
to ra...@googlegroups.com
ticket https://jira.jboss.org/browse/RAILO-323 is solved for version 3.1.2.015

/micha

Todd Rafferty schrieb:

Snick

unread,
Jun 23, 2010, 3:36:25 PM6/23/10
to ra...@googlegroups.com
Wow, thats impressive!
Any idea when its out?
I tried an update and were on 014.
Reply all
Reply to author
Forward
0 new messages