Error in Log analyzer

Issue #1392 resolved
Luke Kozakewycz created an issue

A new error has started appearing in the log analyzer (since the recent upgrades). Looks like your query in attempting to query a non-existent field.

Comments (20)

  1. Scott Wells repo owner

    Hmmmmm....that's interesting. NBA is the log level for Einstein Next Best Action, and so far it seems to be present in every org I've hit, nor have I heard about it from other users. Must be something org-specific. What type of org are you hitting here? Sounds like I need to make that conditional?

  2. Luke Kozakewycz reporter

    I’ve never seen this error before. I can’t actually load the logs because of it.

    I’m just using a normal scratch org. I’ve not really done anything different to normal.

  3. Scott Wells repo owner

    Yeah, it would be due to the recent logging changes in IC. IC was missing the Wave and NBA log levels that have been available for a while, so I added them and up-leveled them into the UI.

    I'll take a look this morning. What is the scratch org shape? Hopefully that will allow me to reproduce it and see if I can detect whether this log level is available.

  4. Luke Kozakewycz reporter

    { "orgName": "DEV-LSI-3DS", "edition": "Developer", "features": [ "API", "AuthorApex", "Communities", "DebugApex", "ExternalSharing", "ForceComPlatform" ], "orgPreferences": { "enabled": [], "disabled": [] }}

  5. Scott Wells repo owner

    I'm unable to reproduce the issue. I've just created a scratch org with the following config:

    {
      "orgName": "issue1392",
      "edition": "Developer",
      "features": [
        "API",
        "AuthorApex",
        "Communities",
        "DebugApex",
        "ExternalSharing",
        "ForceComPlatform"
      ],
      "orgPreferences": {
        "enabled": [],
        "disabled": []
      }
    }
    

    That matches exactly, no? Have you tried deleting and recreating that scratch org by chance? Is it by any chance a pre-release scratch org or something else that would make it distinct from others?

  6. Luke Kozakewycz reporter

    That is an exact match - yes. I haven’t created an org since the pre-release feature has been enabled (if it has yet).

  7. Scott Wells repo owner

    There must be something else going on here. If you open Developer Console and try to configure log levels, what does it show, e.g.:

    Issue_1392_DevConsole.png

    Notice the last Nba column there. That's in my scratch org created with the config in my last response.

    Again, the fact that I've neither seen this nor heard about it from others--and it seems like if it happened with vanilla scratch orgs I'd have heard about it pervasively--makes me think there's something wonky in this particular scratch org. I just don't know what that would be...

  8. Luke Kozakewycz reporter

    The Nba column is there but it is blank. I’ve set to it NONE and it is still producing that error.

    I can try creating a new scratch org and seeing if that works.

  9. Scott Wells repo owner

    Yes, I think that's the logical next step. NBA is definitely documented to be a standard logging category:

    https://help.salesforce.com/articleView?id=code_setting_debug_log_levels.htm&type=5

    It just seems like something went awry with this particular scratch org. Let's see if it happens again with a fresh one. If it does I'll likely need to follow up with Salesforce to understand when/why certain logging categories would be missing from an org and how to handle that when managing log levels in that org.

  10. Scott Wells repo owner

    Hey, Luke. Just figured I'd follow up and see if the same issue appears with a new scratch org or not. Any new insights?

  11. Luke Kozakewycz reporter

    Hey there - I created a new scratch org and it’s still doing the same unfortunately. Having to resort to using the debug logs in the UI.

  12. Scott Wells repo owner

    I'll need to follow up with Salesforce on this one, Luke. As a workaround in the interim, have you tried adding Einstein features to the scratch org?

  13. Scott Wells repo owner

    Luke, I've been chatting with Salesforce about this a bit and it's definitely perplexing. Can I get you to do one thing? Can you add the following to Help>Debug Log Settings (the leading # is important):

    #com.illuminatedcloud.client.ForceComApiClient!trace
    

    then completely restart the IDE and reproduce the issue. That's going to include the raw API requests and responses in idea.log including your username and password during login, so don't post the resulting raw log here.

    What I would like is the following extract from it where this specific query is executed:

    2019-08-19 20:02:11,553 [  30527]   INFO - gService.ToolingApi.ToolingApi - Outbound Message
    ---------------------------
    ID: 2
    Address: https://na71.salesforce.com/services/Soap/T/46.0/00D37000000Hl6W
    Encoding: UTF-8
    Http-Method: POST
    Content-Type: text/xml
    Headers: {Accept=[*/*], SOAPAction=[""]}
    Payload: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Header><SessionHeader xmlns:ns3="urn:metadata.tooling.soap.sforce.com" xmlns:ns2="urn:sobject.tooling.soap.sforce.com" xmlns="urn:tooling.soap.sforce.com"><sessionId>REDACTED</sessionId></SessionHeader><CallOptions xmlns:ns3="urn:metadata.tooling.soap.sforce.com" xmlns:ns2="urn:sobject.tooling.soap.sforce.com" xmlns="urn:tooling.soap.sforce.com"><client>IlluminatedCloud</client></CallOptions></soap:Header><soap:Body><query xmlns="urn:tooling.soap.sforce.com" xmlns:ns2="urn:sobject.tooling.soap.sforce.com" xmlns:ns3="urn:metadata.tooling.soap.sforce.com" xmlns:ns4="urn:fault.tooling.soap.sforce.com"><queryString>SELECT Id, DeveloperName, ApexCode, ApexProfiling, Callout, Database, System, Validation, Visualforce, Workflow, Nba, Wave FROM DebugLevel WHERE DeveloperName = 'SFDC_DevConsole'</queryString></query></soap:Body></soap:Envelope>
    -------------------------------------- 
    2019-08-19 20:02:11,891 [  30865]   INFO - gService.ToolingApi.ToolingApi - Inbound Message
    ----------------------------
    ID: 2
    Response-Code: 200
    Encoding: UTF-8
    Content-Type: text/xml; charset=utf-8
    Headers: {Cache-Control=[no-cache,must-revalidate,max-age=0,no-store,private], content-type=[text/xml; charset=utf-8], Date=[Tue, 20 Aug 2019 01:02:11 GMT], Expires=[Thu, 01 Jan 1970 00:00:00 GMT], Set-Cookie=[BrowserId=PTvMmz-JR9mr2lw14MIXcA;Path=/;Domain=.salesforce.com;Expires=Sat, 19-Oct-2019 01:02:11 GMT;Max-Age=5184000], transfer-encoding=[chunked], Vary=[Accept-Encoding]}
    Payload: <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="urn:tooling.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:sf="urn:sobject.tooling.soap.sforce.com"><soapenv:Body><queryResponse><result><done>true</done><entityTypeName>DebugLevel</entityTypeName><queryLocator xsi:nil="true"/><records xsi:type="sf:DebugLevel"><sf:Id>7dl3700000000TDAAY</sf:Id><sf:ApexCode>FINEST</sf:ApexCode><sf:ApexProfiling>ERROR</sf:ApexProfiling><sf:Callout>ERROR</sf:Callout><sf:Database>INFO</sf:Database><sf:DeveloperName>SFDC_DevConsole</sf:DeveloperName><sf:Nba>ERROR</sf:Nba><sf:System>FINEST</sf:System><sf:Validation>ERROR</sf:Validation><sf:Visualforce>FINE</sf:Visualforce><sf:Wave>ERROR</sf:Wave><sf:Workflow>ERROR</sf:Workflow></records><size>1</size><totalSize>1</totalSize></result></queryResponse></soapenv:Body></soapenv:Envelope>
    

    Basically search for , Nba, in the resulting log and grab the paired Outbound Message and Inbound Message. That should show this exact request and the resulting response from the server.

    Once you have that, please remove the debug logging line added above and restart the IDE again because otherwise you're going to have some seriously noisy logs!

    Thanks much...

  14. Luke Kozakewycz reporter
    2019-08-20 14:52:27,196 [  44022]   INFO - gService.ToolingApi.ToolingApi - Outbound Message
    ---------------------------
    ID: 1
    Address: https://connect-customer-5531-dev-ed.cs96.my.salesforce.com/services/Soap/T/41.0/00D1g0000004y6PEAQ
    Encoding: UTF-8
    Http-Method: POST
    Content-Type: text/xml
    Headers: {Accept=[*/*], SOAPAction=[""]}
    Payload: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Header><SessionHeader xmlns:ns3="urn:metadata.tooling.soap.sforce.com" xmlns:ns2="urn:sobject.tooling.soap.sforce.com" xmlns="urn:tooling.soap.sforce.com"><sessionId>REDACTED</sessionId></SessionHeader><CallOptions xmlns:ns3="urn:metadata.tooling.soap.sforce.com" xmlns:ns2="urn:sobject.tooling.soap.sforce.com" xmlns="urn:tooling.soap.sforce.com"><client>IlluminatedCloud</client></CallOptions></soap:Header><soap:Body><query xmlns="urn:tooling.soap.sforce.com" xmlns:ns2="urn:sobject.tooling.soap.sforce.com" xmlns:ns3="urn:metadata.tooling.soap.sforce.com" xmlns:ns4="urn:fault.tooling.soap.sforce.com"><queryString>SELECT Id, DeveloperName, ApexCode, ApexProfiling, Callout, Database, System, Validation, Visualforce, Workflow, Nba, Wave FROM DebugLevel WHERE DeveloperName = 'SFDC_DevConsole'</queryString></query></soap:Body></soap:Envelope>
    -------------------------------------- 
    2019-08-20 14:52:27,717 [  44543]   INFO - gService.ToolingApi.ToolingApi - Inbound Message
    ----------------------------
    ID: 1
    Response-Code: 500
    Encoding: UTF-8
    Content-Type: text/xml; charset=utf-8
    Headers: {Cache-Control=[no-cache,must-revalidate,max-age=0,no-store,private], content-type=[text/xml; charset=utf-8], Date=[Tue, 20 Aug 2019 13:52:27 GMT], Expires=[Thu, 01 Jan 1970 00:00:00 GMT], Set-Cookie=[BrowserId=OFXMgAljRoSaFuHpS8Bozg;Path=/;Domain=.salesforce.com;Expires=Sat, 19-Oct-2019 13:52:27 GMT;Max-Age=5184000], transfer-encoding=[chunked]}
    Payload: <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sf="urn:fault.tooling.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><soapenv:Fault><faultcode>sf:INVALID_FIELD</faultcode><faultstring>INVALID_FIELD: 
    Validation, Visualforce, Workflow, Nba, Wave FROM DebugLevel WHERE
                                       ^
    ERROR at Row:1:Column:114
    No such column &apos;Nba&apos; on entity &apos;DebugLevel&apos;. If you are attempting to use a custom field, be sure to append the &apos;__c&apos; after the custom field name. Please reference your WSDL or the describe call for the appropriate names.</faultstring><detail><sf:InvalidFieldFault xsi:type="sf:InvalidFieldFault"><sf:exceptionCode>INVALID_FIELD</sf:exceptionCode><sf:exceptionMessage>
    Validation, Visualforce, Workflow, Nba, Wave FROM DebugLevel WHERE
                                       ^
    ERROR at Row:1:Column:114
    No such column &apos;Nba&apos; on entity &apos;DebugLevel&apos;. If you are attempting to use a custom field, be sure to append the &apos;__c&apos; after the custom field name. Please reference your WSDL or the describe call for the appropriate names.</sf:exceptionMessage><sf:row>1</sf:row><sf:column>114</sf:column></sf:InvalidFieldFault></detail></soapenv:Fault></soapenv:Body></soapenv:Envelope>
    -------------------------------------- 
    
  15. Scott Wells repo owner

    Aha...there's the problem:

    Address: https://connect-customer-5531-dev-ed.cs96.my.salesforce.com/services/Soap/T/41.0/00D1g0000004y6PEAQ
    

    Notice the version number. I just swore up, down, and sideways that IC always communicates with the server using the latest API version compiled into the plugin, but evidently that's not the case after all.

    The workaround would be to change your API version number to something that includes the NBA log level...I think 43.0+ but certainly 46.0 should be fine. I'll also investigate why it's using the older version number to communicate with the server. I'm concerned that it won't necessarily be safe to change, though, as folks may well be depending on it using the configured API version number.

    Let me chew on this today and I'll let you know my thoughts shortly. Thanks for providing this! It certainly clears up why it's happening.

  16. Scott Wells repo owner

    Ah, I see. This is a minor difference between IC native connections (those configured explicitly in IC) and those derived from the Salesforce CLI. When setting up the API client for the former, the latest API version is always used; when setting up the API client for the latter the API version from sfdx-project.json is used. That's a bug. I'll attach a test build in just a minute that should have both using the latest API version.

  17. Scott Wells repo owner

    Okay, here's a build that always uses the latest API version for internal communication even against OAuth connections. It's otherwise the exact same as 2.0.7.8 which I released this morning.

    Download the zip (don't extract it) and install it using Settings/Preferences>Plugins>Install plugin from disk (under the gear drop-down). Let me know if this does or does not resolve the issue for you. If it does, just sit on this build and I'll ensure that the same fix is included in the next official build.

  18. Scott Wells repo owner

    That's great, Luke! Thanks for confirming. Like I said, just sit tight on that build and I'll ensure that the same fix makes it into the next official build along with whatever else I put into it. And thanks for working through this one with me.

  19. Scott Wells repo owner

    Issue tracker grooming. If this is still an issue, please feel free to reopen, ideally with a concrete reproduction scenario.

  20. Log in to comment