AL icon indicating copy to clipboard operation
AL copied to clipboard

Bad request error with Download Symbols command on VSCode with a demo cloud Business Central

Open Magicrevette opened this issue 6 years ago • 15 comments

Describe the bug Hello, I a a noob at Business Central and VSCode. I have a 30 days trial for Business Central online. I've downloaded and installed VSCode on my pc (Windows 10 Familial Edition) and installed AL extension.

I created a new script with >AL:Go and choosed 5.0 version of BC. Then, when I tried Download Symbols command, it showed me the error message "Bad Request" :

[2020-05-12 13:12:56.78] Using reference symbols cache path: c:\Users\Pierre\Documents\AL\ALProject8./.alpackages [2020-05-12 13:12:56.82] Sending request to https://api.businesscentral.dynamics.com/v1.0/sandbox/dev/packages?publisher=Microsoft&appName=System&versionText=16.0.0.0 [2020-05-12 13:12:56.82] Sending request to https://api.businesscentral.dynamics.com/v1.0/sandbox/dev/packages?publisher=Microsoft&appName=System Application&versionText=16.0.0.0 [2020-05-12 13:12:56.82] Sending request to https://api.businesscentral.dynamics.com/v1.0/sandbox/dev/packages?publisher=Microsoft&appName=Base Application&versionText=16.0.0.0 [2020-05-12 13:12:57.31] The request for path /v1.0/sandbox/dev/packages?publisher=Microsoft&appName=System&versionText=16.0.0.0 failed with code BadRequest. Reason: Bad Request [2020-05-12 13:12:57.78] The request for path /v1.0/sandbox/dev/packages?publisher=Microsoft&appName=Base%20Application&versionText=16.0.0.0 failed with code BadRequest. Reason: Bad Request [2020-05-12 13:12:58.37] The request for path /v1.0/sandbox/dev/packages?publisher=Microsoft&appName=System%20Application&versionText=16.0.0.0 failed with code BadRequest. Reason: Bad Request [2020-05-12 13:12:58.37] Could not download reference symbols. Please ensure that:

  1. The correct server name and instance are specified in the launch.json file.
  2. The correct application version is specified in the app.json file.
  3. The dependencies are correctly specified in the app.json file.

To Reproduce When I click on "Download Symbols" command, I have to connect to my online Microsoft Account through my browser. I create a script with AL:Go and connect to my online account connect

Which I do successfully. success_connect

My Business Central on Firefox browser : BConline

After that, when I try again to Download Symbols, I have this error message : error

Here are my launch.json : { "version": "0.2.0", "configurations": [ { "type": "al", "request": "launch", "name": "Microsoft cloud sandbox", "startupObjectId": 22, "startupObjectType": "Page", "breakOnError": true, "launchBrowser": true, "enableLongRunningSqlStatements": true, "enableSqlInformationDebugger": true } ] }

My app.json : { "id": "7fd0594f-2c0e-4927-8a89-b1d222253cae", "name": "ALProject8", "publisher": "Default publisher", "version": "1.0.0.0", "brief": "", "description": "", "privacyStatement": "", "EULA": "", "help": "", "url": "", "logo": "", "dependencies": [ { "id": "63ca2fa4-4f03-4f2b-a480-172fef340d3f", "publisher": "Microsoft", "name": "System Application", "version": "16.0.0.0" }, { "id": "437dbf0e-84ff-417a-965d-ed2bb9650972", "publisher": "Microsoft", "name": "Base Application", "version": "16.0.0.0" } ], "screenshots": [], "platform": "16.0.0.0", "idRanges": [ { "from": 50100, "to": 50149 } ], "contextSensitiveHelpUrl": "https://ALProject8.com/help/", "showMyCode": true, "runtime": "5.0" }

My settings.json : { "al.defaultLaunchConfigurationName": "Microsoft cloud sandbox" }

How can I download symbols correctly please ?

I've read seveal topics about the same problem, but none of the solutions I've tried have worked. I changed version and and runtime numbers, I added a tenant... but still the same error.

How can I do please ?

Thank you.

Versions:

  • AL Language : 5.0.271898
  • Business Central : FR Business Central 16.0 (plateforme 16.0.11233.12864 + application 16.0.11240.11946)

Magicrevette avatar May 12 '20 11:05 Magicrevette

I have the same problem.

guilliano avatar May 20 '20 08:05 guilliano

Can you try:

  1. Setting "al.useLegacyRuntime" : true in your settings
  2. Restarting VSCode
  3. Clearing credentials
  4. Downloading symbols again ?

It might be that the device login that is causing issues.

atoader avatar May 21 '20 13:05 atoader

Thank you for the answer. I tried that. Changed the way I log in to my account. Before it was on my browser, nom it's on Windows.

But the error message is the same when I try to Download Symbols. same_error

But I see in my AL extension settings that there is twi fields in red : first_pb

And : second_pb

Is it related to my error ?

Thanks for your time.

Magicrevette avatar May 21 '20 14:05 Magicrevette

I found a solution for my problem. You have to define the tenant ID and sandboxName: image

guilliano avatar May 22 '20 07:05 guilliano

I tried your technique, and I obtain a new error :

new_error

It seems that I can't download symbols from a free trial sandbox. I need to have an active subscription.

Do you have an active one guilliano ?

Magicrevette avatar May 22 '20 11:05 Magicrevette

Your tenant is wrong. Tenant is like a GUID. You can find your tenant GUID in the Help section: (Question mark right up) image

guilliano avatar May 22 '20 11:05 guilliano

I've changed my tenant, and now I have a new error :

new_error_after_tenant_changed

I've changed my tenant to the tenant indicated in my BC :

BC_browser

Magicrevette avatar May 22 '20 13:05 Magicrevette

Try setting "disableHttpRequestTimeout":true in your launch.json for the current configuration.

atoader avatar May 22 '20 14:05 atoader

You can't install the extension via Visual studio on a Production cloud. You have to create an sandbox, go to https://businesscentral.dynamics.com/TENANT GUID\admin

guilliano avatar May 22 '20 14:05 guilliano

I've tried your url @guilliano with my tenant, and I've this screen on my brower : admin_tenant

Magicrevette avatar May 22 '20 14:05 Magicrevette

Than you have to talk your administrator to do this.

guilliano avatar May 22 '20 14:05 guilliano

I don't know who is my administrator. I'm alone in my home, it's not an account linked to a company. I just wanted to test C/AL extensions on my own.

Magicrevette avatar May 22 '20 14:05 Magicrevette

I don't know who is my administrator. I'm alone in my home, it's not an account linked to a company. I just wanted to test C/AL extensions on my own.

Maybe this can help: https://thinkaboutit.be/2019/10/create-your-own-microsoft-demos-environment-for-free-and-valid-for-1-year/

guilliano avatar May 22 '20 14:05 guilliano

@Magicrevette use the link from https://businesscentral.dynamics.com/AAD Tenant Id, where AAD Tenant Id you can take from the "Unauthorized" page you mentioned above. Then you need to create a Sandbox: click "Search" and type Sandbox, open Sandbox Environment -> Create. Then you should be able to download symbols. Please check also the version of the System, Base Application etc: click "Search", then type/choose "Extension Management".

AndreyKorepanov avatar Jun 25 '20 14:06 AndreyKorepanov

Thank you for reaching out. Your issue seems to be a question about existing functionality. Please reach out to Business Central Community Forum to ask questions: (forum)[https://community.dynamics.com/business/f/758]. Thank you.

AndreyKorepanov avatar Jun 25 '20 14:06 AndreyKorepanov