Integrations and APIs for Service

Get Involved. Join the Conversation.

Topic

    Kurt Helfrich
    "The NameOfSLA ID provided does not correspond with an...
    Topic posted October 10, 2014 by Kurt HelfrichGold Trophy: 10,000+ Points 
    214 Views, 10 Comments
    Title:
    "The NameOfSLA ID provided does not correspond with an active SLA" - but it IS Active!
    Content:

    I'm working on a C# program that creates orgs with SLA instances.  It works most of the time for the hundreds of SLA types we have and orgs that I have created in a cloned testing environment.

    Occasionally, I get an error trying to create one of the SLAIs, and this is what the error message and stack trace look like this.

    *   *   *   *   *

    SLA Error - Not Active: The NameOfSLA ID provided does not correspond with an active SLA.; Organization.ServiceSettings.SLAInstances[0].NameOfSLA

    While performing create on Organization

    Server stack trace: 
       at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
       at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)
       at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
       at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

    Exception rethrown at [0]: 
       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
       at ContractLoader5.RightNowService.RightNowSyncPort.Create(CreateRequest request)
       at ContractLoader5.RightNowService.RightNowSyncPortClient.ContractLoader5.RightNowService.RightNowSyncPort.Create(CreateRequest request) in c:\Users\khelfric\Documents\Visual Studio 2013\Projects\ContractLoader5\ContractLoader5\Service References\RightNowService\Reference.cs:line 23139
       at ContractLoader5.RightNowService.RightNowSyncPortClient.Create(ClientInfoHeader ClientInfoHeader, RNObject[] RNObjects, CreateProcessingOptions ProcessingOptions) in c:\Users\khelfric\Documents\Visual Studio 2013\Projects\ContractLoader5\ContractLoader5\Service References\RightNowService\Reference.cs:line 23147
       at ContractLoader5.RNTContract.CreateNew() in c:\Users\khelfric\Documents\Visual Studio 2013\Projects\ContractLoader5\ContractLoader5\RNTContract.cs:line 722

    *   *   *   *   *

    The first exasperating thing is that the SLAs in question ARE ACTIVE!  I export the list from the database in RightNow and import it into a SQL Server db that keeps all the data I have to load.

    The second exasperating thing is that while this error talks about what would appear to be the FIRST element in the list of new SLAInstances at index 0, "Organization.ServiceSettings.SLAInstances[0].NameOfSLA", the number isn't always 0, and it's frequently larger than the number of new SLAInstances , so for instance, one time I was adding 4 SLAInstances , and the message included  "Organization.ServiceSettings.SLAInstances[13].NameOfSLA".  

    I had been specifying the SLA types by name, so I switched from looking up using the actual SLA name to using the ID number, and that didn't help.  In fact, that's a THIRD exasperating thing I discovered.  When you create an SLAInstance, and you want to use the ID to specify the type of SLAInstance to create, you don't use the sla_id (database name), you actually use the sla_set (database name) for the ID.  Talk about confusing...

    Anyway, HELP!  Has anyone seen this error when the SLA type actually exists?  I have to think it's a database issue, but I can't seem to fix it.

     

    Comment

     

    • Allan Schrum

      As part of the validation a query is made against the "slas" table to ensure the ID that is passed is "active" (meaning the active column is non-zero). That is failing resulting in your error message.

      If you specify by name then the lookup must be resolving incorrectly (meaning finding one that happens to also be inactive). It looks like the current code which resolves the name only worries about the name and not whether or not the SLA is active. I suspect there are several SLAs that have the same name where some are active and some are inactive.

      If you have the ID of an active slas, then please us it as it resolves the ambiguity over the active or inactive SLA.

      Yes, the combination of sla_id and sla_set create the primary key for this object. I agree that it could be better. This is a topic that has come up a few times and is being discussed by product management. Posting ideas on the Idea Lab is always a good place to suggest changes. That area is highly visible to the product managers.

      As far as the array indices, that is a harder thing to respond to. The code simply counts each array element in the XML request as it is processed and, if there is an error, uses it in the response. Assuming we have a bug, was this in a batch request that had multiple elements? Could an earlier batch request item (in the same request) failed while a later one failed with the "13" index? Some supporting information about the request might help.

      Regards,

      -Allan

    • Kurt Helfrich

      Allan:

      Thanks.  I actually have been using the ID (which is actually the SLA set) since the first few errors.

      I'll investigate further - I have lots of logs that could tell me if previous transactions failed.  There may be inactive versions of some of them, with the same sla_set but other sla_id values.  I've had to do some updating over the years.

      I'll let you know what I find out.  I'm working with August 2014, btw.

      Kurt

    • Kurt Helfrich

      Allan:

      I have some more information from this morning's work.

      I isolated 40 test cases from failures that I recorded in previous runs.

      1. I understand, sort of, the array index issue.  It counts not just the active SLAIs, but all the disabled/used up/expired ones, too.
        Thus, when the very first attempt failed as expected, and index 21, I checked the target org.
        It has 4 active SLAIs, 16 inactive, and I was adding 2.  Assuming that the numbering is 0-based, the second SLAI addition is the culprit.  I have one error case where that particular SLA type was the only one being added and it failed, so I have confirmation of my theory.
      2. The particular SLA type in question is active, and it's never been edited since it was added in 2001.  There is no second SLA type with the same name (actually, the name is an entry in the labels table where labels.tbl=42).  I did have some duplicate names at some point, but they are gone.
        I therefore have no theory about why that particular SLA type fails every time, but it does.
      3. I verified that I use new variables every time I build a list of SLAIs to create.  Nothing gets re-used, but I understand the index numbering now anyway.  There are no leftovers from previous attempts.  In fact, in today's testing, it failed on the very first test, before anything could be left over.

      Any ideas?  I thought about renaming the existing SLA type and creating a new one with the name, but I'm leery of doing that and messing up the data any more.

      Kurt

    • Kurt Helfrich

      Update:
      I went back to using the name instead of ID (a.k.a. SLA set).  That seems to be working now for some of the problem SLAs at the moment.  I didn't do anything to them, but we did get updated over the weekend to August 2014 SP1, since my last testing runs.

      I'm letting it run to see what happens.

    • Allan Schrum

      OK - I await further information  smiley

      Regards,

      -Allan

    • Kurt Helfrich

      Well, it looks like the SP fixed almost all of the problems - thanks for your help, Allan.  You got me through some of the data issues that were confounding the error messages.

      I'm still getting one error on one org out of over 30,000, and it does not appear to be related to SLAs as far as I can tell.  I haven't made much progress with it yet.

      Has anyone see anything like this:

      The content type text/html; charset=UTF-8 of the response message does not match the content type of the binding (text/xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 389 bytes of the response were: '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml">
      <head>
          <title>There is a an error with your request</title>
          <meta http-equiv="content-type" content="text/html; charset=utf-8" />
      </head>
      <body>
        <p>There has been an error with your request.</p>
      </body>
      </html>
      

      The error message says the response is bad, but the embedded message says the request is bad.

      I looked - no non-English characters, no SLAs that don't exist or have duplicates.  I haven't single-stepped through the code on that org yet (probably today), but has anyone see this and have any pointers on how to diagnose the problem?

    • Allan Schrum

      See if you can get the server-side error logs examined for that request. I suspect an unexpected failure is occurring which causes the process to exit prematurely leaving the Apache server to provide the simple response you see. We can then see what the root cause is and whether or not is a known problem.

      If you can post the request (properly sanitized) so that we can take a look at it, that might help as well.

      Regards,

      -Allan

    • Kurt Helfrich

      Is there an easy way to see the SOAP info sent using the update method?  I might be able to figure it out if I can see it.

    • Allan Schrum

      The only ways I can think of are to have your client print out the serialized request as part of its process. Obviously, this depends a lot on the flexibility of the framework you are using to serialize the XML.

      Another common approach is to use tools like Fiddler which setup local proxies so that your request goes through them before being sent to the SOAP endpoint. In that situation you can see the entire dialog for the request. This approach can be extended to any local proxy that you can setup that will log the requests in case Fiddler is not appropriate for your environment.

      I'm not sure of any other approaches.

      Regards,

      -Allan

    • Kurt Helfrich

      Thanks, Allan.  I have Fiddler installed, but I was being lazy.  Didn't want to have to do all the redirection.

      Fortunately, or unfortunately perhaps, the problem appears to have stopped.

      I know what I'll do next time it crops up, though.

      Thanks for all the help.