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

ftp action:getFile - Attribute validation error

New Here ,
Apr 27, 2015 Apr 27, 2015

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

859
Translate
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

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

Translate
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

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.

Translate
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

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

Translate
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

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

Translate
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

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 ...)

Translate
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

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.".

Translate
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

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.

Translate
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
LATEST
Translate
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