Jump to content


Photo

Error 17


  • Please log in to reply
18 replies to this topic

#1 pro510

pro510
  • Members
  • 33 posts

Posted 15 March 2011 - 03:08 PM

We have been using SmartFTP library version 1.5 for several years now. We recently upgraded to version 2 because of a random crashing error in 1.5. Version 2.0 fixed the crashing error, but now we have a new issue. On rare occassions, we get an Error 17 - ftpErrorLicense. This will continue to happen until our application is restarted. The code to initialize the license key has not changed from 1.5. The code we use to write the licence key is show below and we only call this once at the start of our application.

Any suggestions on what this may be?

Thanks,
Graham

sfFTPLib::IGlobalPtr pGlobal; 

if (SUCCEEDED(pGlobal.CreateInstance(__uuidof(sfFTPLib::Global)))) 
{ 
    // Load the licence file into the DLL 
    if (pGlobal->LoadLicenseKeyData(_szLicence)) 
    { 
        m_bCreated = TRUE; 
    } 
    else 
    { 
        AfxMessageBox(_T("Failed to load FTP license key data."), MB_ICONERROR); 
    } 
} 
else 
{ 
    AfxMessageBox(_T("FTP not found."), MB_ICONERROR); 
}


#2 pro510

pro510
  • Members
  • 33 posts

Posted 15 March 2011 - 03:24 PM

The licence key for version 2.0 is 400133629

#3 pro510

pro510
  • Members
  • 33 posts

Posted 15 March 2011 - 03:26 PM

I should also have mentioned that the LoadLicenseKeyData succeeds, but when we try to connect we get the error 17.

#4 mb

mb

    Developer

  • Administrators
  • 11521 posts
  • Gender:
    Male
  • Location:
    Worldwide

Posted 15 March 2011 - 03:43 PM

Can you provide a sample which reproduces the problem?

#5 pro510

pro510
  • Members
  • 33 posts

Posted 15 March 2011 - 05:30 PM

There is no reliable way to reproduce the problem. During our testing we have seen the issue about 5 times - out of probably hundreds of times which we've ran our application. It was not isolated to one machine.

Even though the chances of this happening are slim, we don't know how this will affect customers, so are holding off releasing an update to the software which includes the latest ftp lib until we know more.

I can send you the C++ class I use that wraps your library, but I can't send sample code that you can run that triggers the error.

Graham

Edited by pro510, 15 March 2011 - 05:32 PM.


#6 mb

mb

    Developer

  • Administrators
  • 11521 posts
  • Gender:
    Male
  • Location:
    Worldwide

Posted 15 March 2011 - 06:06 PM

Ultimately we need a way to reproduce it.

Try to enable logging:
pGlobal->LogFile = _T("c:\\temp\\sfFTPLib.log");

If the license key fails to load, additional debug information is written to the .log file.

#7 pro510

pro510
  • Members
  • 33 posts

Posted 15 March 2011 - 06:32 PM

The logging has been enabled since we first discovered the issue. The log is empty other than one line that shows the version of the library.

#8 mb

mb

    Developer

  • Administrators
  • 11521 posts
  • Gender:
    Male
  • Location:
    Worldwide

Posted 15 March 2011 - 07:38 PM

Have you ever tried to put the LoadLicenseKeyData() function into a loop with 1M iterations?

#9 pro510

pro510
  • Members
  • 33 posts

Posted 17 March 2011 - 04:27 PM

No I haven't. We have not seen LoadLicenseKeyData() fail. That has always succeeded and we just get error 17 when we try to connect to an ftp server.

#10 mb

mb

    Developer

  • Administrators
  • 11521 posts
  • Gender:
    Male
  • Location:
    Worldwide

Posted 17 March 2011 - 06:41 PM

I assume that you are calling LoadLicenseKeyData() just once and not for every new connection. If this is the case, did you try to reproduce the problem by repetitively calling Connect()? E.g. from different threads.

#11 pro510

pro510
  • Members
  • 33 posts

Posted 18 March 2011 - 08:31 PM

Correct. I only call it once at the start of the program. Repeatedly calling Connect() does not cause the issue.

We have had this issue on 5 different machines. However, it has only ever happened once for each machine. It may be that it only ever happened the first time the application was run with the new ftp lib, but we can't be sure of that. I wonder if there is anything different about the first time the library is used that is different than the subsequent times that could cause LoadLicenseKeyData to succeed but still cause Error 17?

We are currently testing with Virtual Machines to see if we can reproduce the issue.

#12 mb

mb

    Developer

  • Administrators
  • 11521 posts
  • Gender:
    Male
  • Location:
    Worldwide

Posted 19 March 2011 - 04:21 AM

To your question: No it's stateless and hence there is nothing different.

#13 pro510

pro510
  • Members
  • 33 posts

Posted 21 March 2011 - 02:50 PM

Do you see there being any side effects if we called LoadLicenseKeyData before each time we Connect?

Edited by pro510, 21 March 2011 - 02:51 PM.


#14 mb

mb

    Developer

  • Administrators
  • 11521 posts
  • Gender:
    Male
  • Location:
    Worldwide

Posted 21 March 2011 - 07:33 PM

Yes. You should only call it once.

#15 pro510

pro510
  • Members
  • 33 posts

Posted 24 March 2011 - 08:02 PM

I've just had the issue again. I have our application running on a virtual machine (XP virtual machine within Microsoft Virtual PC hosted on Windows 7 64 bit). The app was running without issue. The virtual machine was then hinernated. 6 days later (today) I restarted the virtual machine. Our app is still running, but now as soon as I try to connect I get Error 17.

Is there some timeout in the license key due to inactivity possibly?

Graham

Edited by pro510, 24 March 2011 - 08:02 PM.


#16 pro510

pro510
  • Members
  • 33 posts

Posted 24 March 2011 - 08:03 PM

Only line in the log is

SmartFTP FTP Library 2.0.101.0

#17 mb

mb

    Developer

  • Administrators
  • 11521 posts
  • Gender:
    Male
  • Location:
    Worldwide

Posted 24 March 2011 - 11:28 PM

There is no timeout or anything like that. How do you set the log file? Can you post the lines from the code?

#18 pro510

pro510
  • Members
  • 33 posts

Posted 25 March 2011 - 02:12 PM

HRESULT hr = m_ftp.CreateInstance(__uuidof(sfFTPLib::FTPConnectionMTA)); 

if (SUCCEEDED(hr)) 

{ 

    m_bInitialised = TRUE; 



    // Perform basic initialisation 

    m_ftp->UseMessageLoop = VARIANT_FALSE; 

    m_ftp->Protocol = sfFTPLib::ftpProtocolNormal; 

    m_ftp->Passive = CAppPrefsIP::bGetPassiveFTP() ? VARIANT_TRUE : VARIANT_FALSE; 

    m_ftp->Async = VARIANT_FALSE;// Not asynchronous 

    m_ftp->Proxy->Type = sfFTPLib::ftpProxyTypeNone; 

    m_ftp->HidePassword = VARIANT_TRUE; 

    m_ftp->LogFile->File = _T("C:\\FTPLOG.TXT"); 



    // Set timeout 

    m_ftp->Timeout = nGetRegistryInt (REG_SECTION_GENERAL, _T("FTPTimeout"), 30, FALSE);// 30 second timeout 

}


#19 mb

mb

    Developer

  • Administrators
  • 11521 posts
  • Gender:
    Male
  • Location:
    Worldwide

Posted 25 March 2011 - 04:14 PM

You need to enable the global log as of my previous post:
>Try to enable logging:
>pGlobal->LogFile = _T("c:\\temp\\sfFTPLib.log");




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users