• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

ftp action:getFile - Attribute validation error

New Here ,
Apr 27, 2015 Apr 27, 2015

Copy link to clipboard

Copied

Hi,

First, the code :

LOCAL.fileName = lsDateFormat(now(), 'yyyymmdd') & '.csv';

LOCAL.filePath = "example_file";

LOCAL.ftpService = new FTP();

LOCAL.ftpService.setServer('sftpr.emv2.com');

LOCAL.ftpService.setPort('22');

LOCAL.ftpService.setUserName('example_user');

LOCAL.ftpService.setSecure('true');

LOCAL.ftpService.setKey(example_key.ppk");

LOCAL.ftpService.setStopOnError(true);

LOCAL.ftpService.setRemoteFile('example_remote_file');

LOCAL.ret = LOCAL.ftpService.open();

writeDump(LOCAL.ret);

LOCAL.doInsert = 0;

if(LOCAL.ret.getPrefix().succeeded){

     LOCAL.testExists = LOCAL.ftpService.existsFile();

     writeDump(LOCAL.testExists);

     if(LOCAL.testExists.getPrefix().returnValue){

          LOCAL.doInsert = 1;

          LOCAL.ftpService.setLocalFile(LOCAL.filePath);

          LOCAL.ftpService.setFailIfExists(false);

          LOCAL.resp = LOCAL.ftpService.getFile();

          writeDump(LOCAL.resp); abort;

     }

}

LOCAL.ftpService.close();


Open Connection : OK

Test file exists : OK

getFile : KO


I fire this message every time :


Attribute validation error for tag CFFTP.It has an invalid attribute combination: action,failifexists,key,localfile,port,remotefile,server,stoponerror,username. Possible combinations are:<li>Required attributes: 'action,localfile,password,remotefile,server,username'. Optional attributes: 'agentname,asciiextensionlist,attributes,buffersize,failifexists,fingerprint,passive,port,proxybypass,proxyserver,result,retrycount,secure,stoponerror,timeout,transfermode'. <li>Required attributes: 'action,localfile,key,remotefile,server,username'. Optional attributes: 'agentname,asciiextensionlist,attributes,buffersize,failifexists,fingerprint,passphrase,port,proxybypass,proxyserver,result,retrycount,secure,stoponerror,timeout,transfermode'. <li>Required attributes: 'action,connection,localfile,remotefile'. Optional attributes: 'agentname,asciiextensionlist,attributes,buffersize,failifexists,fingerprint,passive,password,port,proxybypass,proxyserver,result,retrycount,secure,server,stoponerror,timeout,transfermode,username'.


I turn around to this problem since this morning without finding any valid track. Anyone have an idea?

Thanks you

Views

747

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 02, 2015 May 02, 2015

Copy link to clipboard

Copied

You've set the username. Set the password as well.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 02, 2015 May 02, 2015

Copy link to clipboard

Copied

In this SFTP there is no password. just a user and a private key. And in this configuration, if we refer to the doc, my params are good. I can connect to the sftp and I can check if the file exists. So the issue cannot be a password problem.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 02, 2015 May 02, 2015

Copy link to clipboard

Copied

I understand. OK, use password="", and let's see what happens.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 03, 2015 May 03, 2015

Copy link to clipboard

Copied

You may also have to include the attributes, passphrase and fingerprint, according to the cfftp documentation.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 05, 2015 May 05, 2015

Copy link to clipboard

Copied

I tried to set password as an empty string and same thing with passphrase. No change.

I have to specify that my CF server is CF 9.0.1 version. Thx for help anyway. This issue seems not have a simply solution : so I think I will try to get the file by an another way (may be a cfexecute with a ftp software ...)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 05, 2015 May 05, 2015

Copy link to clipboard

Copied

Hang on. Your code says

LOCAL.ftpService.setKey(example_key.ppk");

whereas the documentation says that that must be "the absolute path to the private key of the user".

Furthermore, you say,

I tried to set password as an empty string and same thing with passphrase.

whereas the documentation says that "Because private keys are stored in an encrypted form on the client host, the user must supply a passphrase to enable generating the signature.".

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 05, 2015 May 05, 2015

Copy link to clipboard

Copied

It could be ... if I didn't connected yet and checked the file exists. I don't believe, if it was a key issue, I would be able to do that. The passphrase is an optional setting as password if you set a key to the ftp object.

It would seem that the problem is related to CF 9 and it is impossible to do this in a simple manipulation in this context.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 06, 2015 Aug 06, 2015

Copy link to clipboard

Copied

LATEST

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation