UNKNOWN_EXCEPTION: Invalid parameter value

Issue #359 resolved
Rick Hedin created an issue

I downloaded IntelliJ and Illuminated Cloud today. When I tried to make a project based on my Salesforce sandbox contents, I got this error. Of course, unless there's a log file somewhere, this isn't enough information. My theories are: 1. An apostraphe in my project name is bad. I chose Rick's Sandbox . 2. I shouldn't have chosen to download All. Some of those items aren't thoroughly tested.

Comments (30)

  1. Scott Wells repo owner

    Rick, you can get a log using Help>Show Log in Explorer/Finder. Feel free to send that over and I'll take a look.

  2. Rick Hedin reporter

    I’m hoping replying with the file attached puts the file into the issue. I see several occurrences of Invalid Parameter in the log.

    I was able to make it work by: 1. Turning the beta parallel processing off. 2. Not putting an apostrophe in my project name. 3. Not selecting everything. I took the defaults. Not sure which of those made the difference, but it worked with those changes.

  3. Scott Wells repo owner

    Thanks, Rick. I'm away from my machine for the day but will take a look this evening and let you know what I find.

  4. Rick Hedin reporter

    Thanks, Scott. A little more information. When I leave everything else the same, but select "All" the data, I get the Invalid Parameter error.

  5. Scott Wells repo owner

    Yeah, I glanced over the log and it appears to be getting errors from the Salesforce metadata API trying to list metadata for a few types. I'll check with Salesforce about which types I might need to blacklist. Right now I just react to their metadata. For now you're on the right track by setting up an explicit metadata subscription.

  6. Tye Robinson

    I think the issue is org specific because I work on several orgs and this is the only one affected.

  7. Scott Wells repo owner

    Sorry for the issue, Tye. Thanks for providing the log. Unfortunately the information there is still a bit scarce for debugging this. Would you mind doing me a favor and trying to isolate the metadata that's causing the issue? Perhaps just perform a refresh on a few specific folders at a time until you can nail down which metadata type and/or specific metadata items cause it? I know that's quite onerous so I'm going to instrument this with additional logging to try to help corner the issue as well. I'll let you know when a build is available with that additional logging.

  8. Scott Wells repo owner

    You know what...referring to the original log, this seems to be happening during calls to MetadataApi.listMetadata(). Let me make sure that all of those have proper defensive behavior so that failure with one type doesn't cause the entire operation to fail. I'll post a test build here with that change and perhaps you can verify whether it addresses the issue or not, then assuming it does, I'll include that fix in the next official build. More to come in a bit...

  9. Scott Wells repo owner

    Okay, here's a build with what I hope to be a fix for the issue. You can install it using Settings>Plugins>Install plugin from disk. It's the exact same build as the current official release but with this and one other small fix. It will not interfere with updates to official builds. If you don't mind installing it and letting me know whether it does or does not address the issue you're seeing, I'd appreciate it.

  10. Tye Robinson

    issue persists and it says Version: 1.7.9.0-idea14 Is that the expected version post installation. I forgot to note version prior to installing.

  11. Scott Wells repo owner

    Tye, thanks for checking it out. That's the correct version. I didn't bump the version relative to the current official build since it's a pre-release test build. Do you mind providing your idea.log with the information from the failure this time?

  12. Tye Robinson

    I'm attaching the log but i don't see time stamps updating after tripping the error. The update didn't change the log file path did it?

  13. Scott Wells repo owner

    Thanks, Tye. Okay, let's try this...please add the following to Help>Debug Log Settings, reproduce the error, and send me your idea.log:

    #com.illuminatedcloud.intellij.builder.RefreshAction
    #com.illuminatedcloud.intellij.builder.ForceComBuilder
    #com.illuminatedcloud.intellij.builder.ForceComMetadataRetriever
    

    That should give me considerably more insight into what's going on here. I sincerely appreciate the assistance in debugging this!

  14. Scott Wells repo owner

    Okay, my guess is that the issue is the following from the generated package.xml being used for the retrieval:

    {
        "members": [
            null,
            "null/Topic_Shared_Document_Folder-meta.xml",
            "null/Communities_Shared_Document_Folder-meta.xml"
        ],
        "name": "Document"
    }
    

    I see the same thing for the Report metadata type. That looks to me like a bug with foldered metadata types for sure. Let me look at how that's being created and try to understand how those null values are ending up in there. Hopefully I'll find the issue quickly and can post a new build for you to try to validate the real fix. Thanks for providing the log!

  15. Scott Wells repo owner

    Tye, how is your subscription configured? Are you using Selected or Package.xml? If the latter, would you mind sharing your package.xml file with me? You can email it if you'd prefer.

    UPDATE: It looks like you're configured for All/Package based on this:

    2017-04-20 08:17:43,840 [3200909]  DEBUG - lder.ForceComMetadataRetriever - Retrieving all metadata. 
    

    I'd recommend that you change that to be either Selected or, if you have an existing and authoritative package.xml file, Package.xml, then select exactly the metadata that represents your project.

    I'll try to reproduce this issue using All/Package and fix it assuming I can reproduce it, but in general I recommend that folks not use that unless they're also using development packages in the org. I've even considered removing the All aspect of that option altogether because of all the issues that it can cause even outside of potential bugs in IC. There are just certain types of metadata that shouldn't be retrieved/deployed for tooling purposes and that cause Salesforce to throw internal errors.

    I'll keep looking at reproducing this using All/Package, but please let me know if switching to Selected or Package.xml doesn't resolve the issue for you.

  16. Tye Robinson

    For most projects we use all so that our git repo can track the non developer related changes. Limiting the packages to just developer related files allows for the retrieve to work properly.

  17. Scott Wells repo owner

    Okay. Yeah, there's a bug in there no matter what, so I do need to fix it. There shouldn't be any null values in the generated package.xml, nor should the meta.xml files end up in there. I think the main reason no one has kicked it over before now (or at least with no real frequency) is that very few people use All/Package against orgs of any size. I'll keep this issue open until I address that problem. I may need your help verifying the fix if you don't mind because so far I haven't been able to reproduce it myself even using All/Package against some of my larger orgs.

  18. Tye Robinson

    Sounds good as long as the org keeps throwing the error I'm available to help. On an unrelated note I noticed a "delete metadata" option does that delete the local copy or go up to the org and delete things? I wasn't going to risk pushing it and couldn't find documentation on what exactly is would delete.

  19. Scott Wells repo owner

    The Delete Metadata action is basically an undeploy action. It removes things from the server only. If you want to delete from both, just use IntelliJ IDEA's standard Delete action and Illuminated Cloud will then prompt you as to whether to remove that metadata from the server and/or your metadata subscription.

  20. Scott Wells repo owner

    Partial fix included in 1.7.9.1, though it wouldn't address the issue that was observed with All/Package subscriptions so I'm leaving this issue open.

  21. Scott Wells repo owner
    • edited description
    • changed status to resolved

    Resolving as I actually discourage the use of All/Package except when a package is explicitly selected (and might even remove it as an option). If this is still a problem outside of the All scenario, please let me know.

  22. Mike

    I am experiencing this issue, even when individually selecting (I'm not selecting everything, though I am selecting most). I'd prefer to use All since we're a small org. Currently on IC 2.0.0.5 in IntelliJ IDEA 2017.2.6:

    Build #IC-172.4574.11, built on November 13, 2017 JRE: 1.8.0_152-release-915-b12 x86_64 JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o Mac OS X 10.13.2

  23. Log in to comment