Sql2014CreateBackup(): Sandbox key succeeds, API key fails

Discussion in 'Control Panel API' started by leahcimp, Nov 25, 2014.

  1. I am using Sql2014CreateBackup(). Using the sandbox key, the backup works fine, but using the "live" API key an exception is thrown. My debug output is below. I have been using the Sql2008CreateBackup() API successfully for several years; all I have done is changed to the Sql2014CreateBackup() method. The target database does exist. Any idea what's going on here? Thanks.

    Using SANDBOX key
    Code:
    The backup process was started by the host 198.XX.XX.XXX
    The API key XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX was verified successfully
    The database SQL2014_NNNNNN_mydatabase was successfully backed up
    Backup process completed [Success]
    Using API key
    Code:
    The backup process was started by the host 198.XX.XX.XXX
    The API key YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY was verified successfully
    Database SQL2014_NNNNNN_mydatabase backup exception: System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> Dasp.CustomerAPI.Web.UnknownException: An unknown error has occurred (1002)
       at Dasp.CustomerAPI.Web.CustomerApi.ValidateKey(String key, String customIdentifier, Boolean incrementUsage, Boolean throttleSandbox, Boolean throwException)
       at Dasp.CustomerAPI.Web.CustomerApi.Sql2014CreateBackup(String key, String databaseName)
       --- End of inner exception stack trace ---
     
  2. martino

    martino DiscountASP.NET Staff

    I wonder if it failed because you already have a .bak file with the same backup name in the _database directory.

    Since you first ran it using the Sandbox key it might of failed when you ran it with the live key since the backup might already be in the _database directory.

    FTP into your site account and check if the .bak file is in the _database. If it is, go ahead and rename or or download it locally and delete off the account.
     
  3. I checked and there is no .bak file already in the _database directory. Also, my understanding is that when using the Sandbox key nothing will actually be written because it's a read-only key.

    Any other suggestions?

    Thanks.
     
  4. I have spent some more time debugging this and it seems like the issue is on the DASP side....

    Additional stack trace info:

    Code:
    The backup process was started by the host 98.XXX.XX.XX
    The API key ################################################################ was verified successfully
    Database SQL2014_NNNNNN_xxxxxx backup exception: System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> Dasp.CustomerAPI.Web.UnknownException: An unknown error has occurred (1002)
       at Dasp.CustomerAPI.Web.CustomerApi.ValidateKey(String key, String customIdentifier, Boolean incrementUsage, Boolean throttleSandbox, Boolean throwException)
       at Dasp.CustomerAPI.Web.CustomerApi.Sql2014CreateBackup(String key, String databaseName)
       --- End of inner exception stack trace ---
    
    Stack Trace:    at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
       at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
       at JJS.DASPApi.SQLBackup.DASPApiWebservice.CustomerApi.Sql2014CreateBackup(String key, String databaseName)
       at JJS.DASPApi.SQLBackup.DoBackup.ProcessRequest(HttpContext context)
    Backup process completed [Failed]
    VerifyKey() method invoked in browser via DASP documentation (succeeds):

    [​IMG]

    Sql2014CreateBackup() method invoked in browser via DASP documentation (fails):

    [​IMG]

    I have verified the database name that I'm passing in, and it is correct.

    Any other suggestions? Can someone on the DASP side take a look at this?

    Thanks.
     
  5. FrankC

    FrankC DiscountASP.NET Staff

    can you create a support ticket? i need your account information to check the log.
     
  6. FrankC -- done. I sent you a "conversation" message with the ticket number. Thank you!
     
  7. Works perfectly now, thanks for resolving this!
     
  8. mjp

    mjp

Share This Page