Organization Namespace assigned incorrectly for developer org connection (SFDX)

Issue #1682 new
Jim Page created an issue

Hi there Scott - first THANK YOU for a superb product that has saved myself and my colleagues man-months of work.

I am not sure if my issue is pilot error, hopefully it is. I have a managed package project that has been running great under Illuminated Cloud for over a year. Recently (in the last few days, hard to pinpoint exactly when) I have started having trouble getting apex tests to run on a Developer org that I have been using since I started using Illuminated Cloud. It is a standard developer org, not set up with any namespaces or packages. The error is

Error 403/Forbidden - INVALID_INPUT: This class name's value is invalid: nbavs.TestAPI. Provide the name of an Apex class that has test methods.

The problem appears to be the Organization Namespace setting in this org's connection - the namespace should be <unassigned> (other Developer org connections that work have an <unassigned> org namespace) but this connection uses the managed package’s namespace. If I create a new Oauth connection for this org, it starts off <unassigned> and the tests work, but at some point (not sure what triggers it) the namespace is no longer unassigned, and the tests start failing.

I cannot see a way to modify this setting.

Have you come across this issue? Have you any suggestions to try?

I have tried creating a new Developer org and connecting to that and deploying source, and it shows the same issue.

My IC build: 202000723122844

My IntelliJ IDEA build: 2020.1.3 (ultimate)



Comments (5)

  1. Scott Wells repo owner

    Hi, Jim. IC will pick up your namespace from one of two locations. The main one is on the connection itself, and it gets that value from querying the org when you click the Test button. The other location is the sfdx-project.json file. Do you see a namespace of nbavs set in either of those locations? If the former, try clicking Test again; if the latter, just remove that entry. Let me know whether that helps or not. If it doesn't we'll try some other things.

  2. Jim Page reporter

    Thanks for getting back to me Scott. I had the namespace set up in the sfdx-project.json file. I tried removing it and recreating the offline data, no luck. Clicking Test doesn’t alter the fact that the Organisation Namespace for the connection is still nbavs. So I have a couple of questions: 1) what does your code look for on the target org to determine the namespace? 2) would it be possible to make the Organisation Namespace somehow editable per connection?

    What I don’t get is why this has suddenly started happening recently. sfdx-project.xml has been stable for at least 6 months.

    Thanks Jim

  3. Scott Wells repo owner

    Jim, there was a potentially (likely?) related change a few builds back:

    Issue 1661 - Fixed an issue that could cause the namespace to be missed for Salesforce CLI connections when one is specified in sfdx-project.json. Note that this is not a 100% perfect fix because the namespace is not included in the response from force:org:list or force:org:display and must be sourced from the project-specific sfdx-project.json file. If the relevant project is not open when the connection details are evaluated, the namespace will not be found. I have filed an enhancement request with Salesforce to include the namespace in one/both of those CLI actions so that the namespace for a CLI-managed org is always known.

    You might try reverting to to see if that restores the original behavior. If so, I'll need to revisit that change.

  4. Log in to comment