AL icon indicating copy to clipboard operation
AL copied to clipboard

Error on "Download Symbols" or "Publish" with multiple configurations in launch.json

Open rvanbekkum opened this issue 6 years ago • 14 comments

Describe the bug When I have a launch.json file with two configurations and I try to use the "AL: Download Symbols" command, I get an error saying "Could not download symbols. Please see the Visual Studio Code output log for more details.". The output log then only reports: "Error: No server has been chosen". If I try this a second time, then I will be prompted to select the instance I would like to use, and everything works as expected.

To Reproduce First, have a launch.json with multiple configurations, e.g. (N.B. I have removed our server and instance names from this example):

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "al",
            "request": "launch",
            "name": "Config1",
            "server": "<myserver>",
            "serverInstance": "<config1_instance>",
            "authentication": "Windows",
            "startupObjectId": 30,
            "startupObjectType": "Page",
            "breakOnError": true,
            "breakOnRecordWrite": false,
            "schemaUpdateMode": "Synchronize"
        },
        {
            "type": "al",
            "request": "launch",
            "name": "Config2",
            "server": "<myserver>",
            "serverInstance": "<config2_instance>",
            "authentication": "Windows",
            "startupObjectId": 30,
            "startupObjectType": "Page",
            "breakOnError": true,
            "breakOnRecordWrite": false,
            "schemaUpdateMode": "Synchronize"
        }
    ]
}

(If you want to, you can restart VSCode after this change, but it does not make a difference.) Then press Ctrl + Shift + P and choose "AL: Download Symbols" from the command palette. You will shortly see the prompt pop up, but it closes immediately, so you won't be able to make a selection. After this you will get the error described above. If you try this a second time, it works as expected.

This happens at least every time you reopen VSCode and try to run this command.

The same happens when you try to Publish, for which you would expect to be prompted to select a configuration, but instead you'll get a similar error.

All my colleagues are experiencing the same bug.

Expected behavior I would expect it to work the first time that I try to run the command, prompting me for the instance that I would like to use, like it does when I try to run this command a second time.

Versions:

  • AL Language: 2.1.79379
  • Business Central: W1 13.3 (27233)

  • VSCode: 1.30.2

rvanbekkum avatar Jan 25 '19 12:01 rvanbekkum

Hi @rvanbekkum, I can also reproduce it on our master branch version. Thanks for reporting this bug.

JohanStenberg100 avatar Jan 25 '19 16:01 JohanStenberg100

If you look closely you could see that "choose server window" opens for couple milliseconds and closes. You have no chance to select server in time and hence the error. It is really annoying

tinfister avatar Apr 15 '19 06:04 tinfister

Are there any news or a workaround for this Topic? It's really hard to test and debug on different Environments.

PatrickSchiefer avatar May 02 '19 11:05 PatrickSchiefer

Comment the configuration/s in launch and leave just one

tinfister avatar May 02 '19 11:05 tinfister

I recently had the same issue when trying to download symbols from our cloud sandbox. The strange thing is, it worked for one project, but not for the other while they had the same launch.json.

{
    "version": "0.2.0",
    "configurations": [                
        {
            "name": "Microsoft cloud sandbox",
            "request": "launch",
            "type": "al",
            "environmentType": "Sandbox",
            "environmentName": "Dyselsb",
            "tenant": "ea2b2504-af48-4904-aa12-8c612eedd299", //For this post, this is a fictional tenant ID
            "startupObjectId": 22,
            "startupObjectType": "Page",
            "breakOnError": true,
            "launchBrowser": true,
            "enableLongRunningSqlStatements": true,
            "enableSqlInformationDebugger": true
        }
    ]
}

Version: NL Business Central 19.0 (Platform 19.0.29884.32731 + Application 19.0.29894.30403)

Result:

afbeelding

PeterConijn avatar Nov 23 '21 11:11 PeterConijn

@PeterConijn I just had the very same issue, but it was caused by a comment in the app.json file. The compiler seems to handle // comments in app.json, but the AL Language Extension freaks out with really strange behaviors.

jwikman avatar Nov 23 '21 12:11 jwikman

@jwikman Thanks for the tip. However, I checked our app.json and it is woefully devoid of comments. The comment about the dummy guid in the launch.json in my original post is not normally there, but only added for clarification.

PeterConijn avatar Nov 23 '21 12:11 PeterConijn

I have the same issue . there is no comment in app.json files.

KuljitSinghParmar avatar Feb 02 '22 04:02 KuljitSinghParmar

I just had the same issue, for anyone facing it: in my case the cause was having some not valid character in the app.json (no error compiling) because of copy pasting from the BC docs regarding app vaults.

kontax85 avatar Feb 22 '22 16:02 kontax85

I just had the same issue, for anyone facing it: in my case the cause was having some not valid character in the app.json (no error compiling) because of copy pasting from the BC docs regarding app vaults.

Thanks for the input. I thought this might be the case, so I created a new project with AL:Go! that auto-generates the configuration, but it keeps showing the same behavior, which leads me to believe it is something in VS Code or one of the AL extensions.

PeterConijn avatar Feb 23 '22 09:02 PeterConijn

I was tracking this for a bit and i saw no resolution had been found. My issue was that there was no comma between my dependencies in my app.json. The compiler doesn't highlight these errors.

rellorin-accessit avatar Jul 08 '22 14:07 rellorin-accessit

I faced the same problem. Identified the problem. It was to do with my App.Json File. A comma was missing from IDRanges, as i had defined several ID Ranges. Correcting this i was able to successfully Download Symbols and connect to the BC Environment.

Ashneil avatar Aug 08 '22 23:08 Ashneil

I had a similar problem, and it turned out that I had several dependencies in my app.json, of which the last one had a trailing comma; removing this comma solved my problem.

tmajvdlaan avatar Sep 07 '23 12:09 tmajvdlaan

I also had this problem and for me it was the line: "allowDownloadingSource": true. in my App.json file. I had to change it from false to true.

LLeeman avatar Nov 01 '23 09:11 LLeeman