Issue with Project Structure -> Subscription

208 views
Skip to first unread message

RonSFDev

unread,
Mar 11, 2021, 4:59:06 AM3/11/21
to Illuminated Cloud Q&A
Hi friends.

For quite a time, I had a problem with going to Project Structure and changing the Subscription.  It was grayed out and I think I used to get around it with some clever use of the CLI.  This is when you are connected to sandboxes not scratch orgs.

Then I did something some months ago that fixed it for me.

Yesterday I convinced a coworker to give Illuminated Cloud in IntelliJ a try.  She pulled her source out of github, she got herself authenticated, she had some fun with scratch orgs, and then we needed to do Sandbox based work.  She's got the same problem as I had.

She can't choose any option in that area because it's all grayed out.  She can't even point to a package.xml file.

What did I do to fix this once upon a time?  Please remind me!!

Thanks!!

Scott

unread,
Mar 11, 2021, 10:01:35 AM3/11/21
to Illuminated Cloud Q&A, RonSFDev
Hi, Ron. The subscription options are disabled when IC2 determines that you're working against a scratch org or against a sandbox where the sandbox connection is configured to use source tracking (i.e., push/pull). How is this connection configured?

Regards,
Scott Wells

RonSFDev

unread,
Mar 11, 2021, 11:11:33 AM3/11/21
to Illuminated Cloud Q&A, Scott
You can configure a sandbox to source track like you can a scratch org to work with push and pull?  I can't see where to configure that.  We matched every possible setting up that I could find so that she had exactly what I had.  What ends up happening is you can't deploy anything and you can't retrieve anything when it's in this state.  How would you catch up the subscriptions?

Scott

unread,
Mar 11, 2021, 11:21:22 AM3/11/21
to Illuminated Cloud Q&A, RonSFDev, Scott
When an OAuth (vs. native) connection is found to be for a sandbox org, a connection-level option is presented as "Use push/pull instead of deploy/retrieve/delete." Again, that's only made available for OAuth connections to sandboxes, though, as those are the only non-scratch orgs (for now) that support source tracking.

Can you provide a screenshot of the connection that's being used in this case? Feel free to redact usernames and such, but that would help me to understand how this connection is being interpreted by IC2.

Regards,
Scott Wells

RonSFDev

unread,
Mar 11, 2021, 1:19:09 PM3/11/21
to Illuminated Cloud Q&A, Scott, RonSFDev
Now mine is behaving strangely as well.  

Screenshot 2021-03-11 at 18.07.15.png

Here's the screenshot of my connection.  This project is under source control.  I'm free to add and remove here as I have to be.  Or else I can't metadata deploy.  I'm not even sure it has all the metadata types now that I've got under source control.  

Speaking of Metadata deploy to sandboxes, the behavior of the key shortcut is different.  Good old Shift-Alt-Command-F9 doesn't work the same anymore.  I was sure that when I was in a project with scratch orgs, it did force:source:push.  When I was connected to sandboxes, it did the usual Metadata deploy.  Now even though I'm pointing at a sandbox, when I use that key combination,  it's trying to push and it fails.  I have to push the green button icon now to do a deploy.

Notice the connection below. "Use push/pull ..." is not checked:

Screenshot 2021-03-11 at 18.12.20.png

I'm finding this a real frustration after many years of whizzing through my work using that particular keyboard shortcut

Scott

unread,
Mar 11, 2021, 2:13:00 PM3/11/21
to Illuminated Cloud Q&A, RonSFDev, Scott
Hmmmm...there's quite a bit here.

Let's start with the nature of this project. Are the files stored in metadata format or source format? Just in case those aren't familiar terms, are your files XML named, for example, *.object or *.object-meta.xml? Based on the screenshots you've provided I'd think they're stored in metadata format because IC2 is offering you the option of a Selected metadata subscription which isn't available for source format projects, but then you also mention that it's trying to push the metadata which it should never try to do for a metadata format project.

The next thing that would provide insights into what's going on is to enable debug logging for metadata deployment, reproduce the behavior you're seeing, and then send me the resulting idea.log file(s) for review. You can email them to sup...@illuminatedcloud.com so that they're not posted here to a public discussion group.

Let's start there. Something seems misconfigured (which could well be something IC2 did wrong in helping to auto-configure the project). Let's figure out what and I bet we can get this resolved quickly.

Regards,
Scott Wells

Tsampika Sotiraki

unread,
Mar 11, 2021, 3:40:21 PM3/11/21
to Illuminated Cloud Q&A, Scott, RonSFDev
Hi Scott, 

My name is Tsampika and I'm Ron's coworker.

I think I may have figured out the missing piece in the config. 

When I was poking around in the project structure I noticed that the "Mark as" options were clickable and then I marked the root folder as Source and our test folders as Tests (see pre and post config screenshots attached).

I made a small change to the code and tried deploying back to the sandbox and it worked like a charm! 

@Ron - Thanks for showing me the ropes! 
@Scott - Very impressed with IC2 so far - great product!

Thanks,
Tsampika
Pre-patch Config.png
Post=patch Config.png

Scott

unread,
Mar 11, 2021, 3:45:28 PM3/11/21
to Illuminated Cloud Q&A, Tsampika Sotiraki, Scott, RonSFDev
Ah, yes. It's going to be critical that you mark source root directories as appropriate. IC2 should help you do that, though it'll only tell you if you don't have any source root directories. Once you've established at least one--valid or not--it will assume you know what you're doing. In general directories such as "src" (metadata format) and "force-app/main/default" / "force-app/test/default" should be designated as source root directories. The project root should only be designated if it truly is the top-level container for metadata, though. Otherwise some files which shouldn't be considered project source will be included. In your example it looks like you've designated the project root, so you might consider pushing that down one or even two levels. Here's an example from one of my projects:

SourceRootConfig.png

I'm happy to look help you decide how to configure your project's source roots if you need. I'd just need a more detailed description of the project directory structure.

Regards,
Scott

RonSFDev

unread,
Mar 12, 2021, 8:27:40 AM3/12/21
to Illuminated Cloud Q&A, Scott, Tsampika Sotiraki, RonSFDev
Hi Scott

I have emailed my idea.log file.  To answer your questions:

The files are definitely stored in source format not metadata format.  I was never able to do a Selected metadata subscription until recently.  And once i was able to, my world became much easier.  It was always a big pain to pull something out of a sandbox that wasn't in source control and not subscribed to.  I would rely on SFDX/CLI commands to do that when needed.  Not great but it worked.  With scratch orgs, it all works fine.

I'm at the point now where I'm developing mainly against sandboxes.  I've always authenticated with OAuth to make my life easier.  And up until recently Shift-Cmd-Alt-F9 would deploy that properly.  Now it gives me "13:22 Push Complete: Pushed 0/1 components to msg in 6 s 26 ms with status 1."   It used to also tell me in the Event Log exactly what the error was.  

In the logs you'll see "This command can only be used on orgs that have source tracking enabled, such as sandboxes and scratch orgs."

As you see in the connection screen shot, "Use push/pull instead of deploy/retrieve/delete" is NOT checked.  I don't have source tracking enabled for scratch orgs as far as I know.

Regards,
Scott Wells

Scott

unread,
Mar 12, 2021, 9:53:11 AM3/12/21
to Illuminated Cloud Q&A, RonSFDev, Scott, Tsampika Sotiraki
Hi, Ron. Did you set up your source roots as Tsampika noted yesterday? Do you mind providing your project's .iml file via email for review? Let's see whether that resolves the issue before diving into other options since that did fix it for her yesterday.

Regards,
Scott Wells
Reply all
Reply to author
Forward
0 new messages