'DebugLevel' is not supported

Issue #911 resolved
Steven Hugo created an issue

Hello

I keep getting this error when trying to run tests.

Capture.PNG

If I click OK tests come up ignored and it suggests I need to check if the classes exist on the server. They exist on the server. All classes also compile on the server. I have this error since a month now. I recently upgraded to the latest version but no luck. Any idea how I can fix this? I need to run test classes in the browser now which kind of is a pain compared to doing it in IC.

:-)

Thanks!

P.S.: I use dx to push code to my scratch org. Created different scratch orgs and all have the same issue.

Comments (11)

  1. Scott Wells repo owner

    That's very odd, Steven That's a standard object that should be both present and available via authorization in any org. I can certainly make IC more defensive against this potential situation, but it would mean that it won't be able to configure the logging levels for unit test execution (or anonymous Apex or just in general via the Log Viewer). I'm very curious as to why this isn't accessible in the scratch org. Let me investigate a bit and see if I can get an answer for that, and if you need a quick workaround I can issue a pre-release build that catches and logs this error but doesn't cause it to go belly-up. At least you'd be able to run tests from IC even if you can't adjust logging.

  2. Scott Wells repo owner

    Steven, I'm going to post a build that you can use to work around this shortly. Can you verify whether you're using IC2 or IC1? I want to make sure that I'm posting a build that you can use.

  3. Scott Wells repo owner

    Steven, if you are using IC2, you can find a build with the aforementioned workaround posted here:

    https://bitbucket.org/RoseSilverSoftware/illuminatedcloud/issues/912

    along with installation instructions. If you'd like to help gather additional diagnostic info on this problem, you can add the following under Help>Debug Log Settings:

    #com.illuminatedcloud.client.ApexLogUtil
    

    and then run your tests, grab the log as documented in the linked issue, and email it to me so I can see more about what's going on. Hopefully that will help me to understand why that object is inaccessible and hopefully allow me to find a solution for it.

  4. Scott Wells repo owner

    Oh, and if you're running IC1 I can spin a build with the same changes and attach that here. Just let me know.

  5. Steven Hugo reporter

    Hello

    I just email you the log. I'm using IC 2 but had the same problem in IC1

    Thank you for the quick response.

  6. Scott Wells repo owner

    Thanks for sending the log. There's definitely something odd going on in that org. For example, I also see a stack trace saying that the results of a SOQL query against CustomField cannot be cast to CustomField. Add that to the fact that it's saying that DebugLevel isn't a valid SObject in the org and I'm concerned about what's going on with this particular org. What API version are you using? I'm wondering if perhaps that's coming into play, though to some extent I'm grasping at straws.

    Do you mind running these two queries in Developer Console with the Use Tooling API checkbox checked:

    SELECT EntityDefinition.DeveloperName, EntityDefinition.NamespacePrefix
    FROM CustomField
    

    and:

    SELECT Id, DeveloperName, ApexCode, ApexProfiling, Callout, Database, System, Validation, Visualforce, Workflow
    FROM DebugLevel
    WHERE DeveloperName = 'SFDC_DevConsole'
    

    I'll be curious to know what kinds of results you see because those are the two exact queries that IC is running against the org.

  7. Steven Hugo reporter

    I ran both queries in the dev console and I got a result back. First one retrieves 639 records and second one only one record. But no errors.

    I am using a low api version 33.0. It did work in the beginning so I don't think it's the api version.

    Thanks

  8. Scott Wells repo owner

    Okay. Do you mind doing one more thing? Do you mind adding the following to Help>Debug Log Settings:

    #com.illuminatedcloud.client.ForceComApiClient!trace
    

    then clear your existing logs (Help>Show Log in Explorer/Finder/Files and remove all idea.log* files), restart the IDE (required to pick up the log change above), and reproduce issue. Finally zip up all idea.log* files from the log directory and send them to me. That's going to show the actual SOAP messages being sent back and forth so I can see exactly what's going on.

    Apologies for asking you to jump through such hoops, but this is truly perplexing.

  9. Scott Wells repo owner

    By the way, if you do that, once you provide the logs go ahead and remove that debug logging line and restart the IDE one more time. Otherwise it's going to be logging VERY verbosely for everything.

  10. Scott Wells repo owner

    This was due to a much older API version for metadata not interoperating with the current SOAP API client. Unfortunately there's not much I can do about that and keep IC on the latest client.

  11. Log in to comment