microsoft / AL

Home of the Dynamics 365 Business Central AL Language extension for Visual Studio Code. Used to track issues regarding the latest version of the AL compiler and developer tools available in the Visual Studio Code Marketplace or as part of the AL Developer Preview builds for Dynamics 365 Business Central.
MIT License
719 stars 242 forks source link

debugger connection stopped working with on prem #7709

Closed dmachanick closed 2 months ago

dmachanick commented 2 months ago

Please include the following with each issue:

1. Describe the bug I used to be able to connect with debug from VS Code at a specific on prem customer. Now it just hangs and does not connect. They are using Edge as the browser (company requirement). Operating system is Windows 2019 server standard.

2. To Reproduce Bring up project in VS Code. Select debug without publishing.

  1. Go to '...'
N/A

Note: Because the developers need to copy and paste the code snippet, including a code snippet as a media file (i.e. .gif) is not sufficient.

3. Expected behavior A clear and concise description of what you expected to happen.

4. Actual behavior A clear and concise description of what happened accompanied by images, animations, or a link to a video showing the issue occurring

5. Versions: 13.0.971907

Please remember to do the following:

thloke commented 2 months ago

We'll need more logs to be able to figure out what is going on. Can you do the following?

  1. In your VSCode settings.json, set "al.editorServicesLogLevel": "Verbose"
  2. Reproduce the scenario
  3. Under the path C:\Users\<username>\.vscode\extensions\ms-dynamics-smb.al-<version>\bin\win32, collect the editorservices.log and debuggerservices.log files. Important: These files might contain PII, so please do not attach them to this issue.
  4. Send them to me at: thloke@microsoft.com with the subject Github AL Issue #<issue number> (so I don't miss it)

Thanks!

thloke commented 2 months ago

Thanks for the logfiles, you are right in that there seems to be nothing much in them. That is very weird. What is in the debug output in VSCode when it hangs? I assume general connectivity from VSCode is fine: i.e. you can download symbols and publish to the server?

dmachanick commented 2 months ago

NO - I cannot download symbols. I had them before this stopped working. I just tried it, and now all my symbol references are gone. Is there a way to get them back?

(If I have to, I can do it on my local Docker and copy it back.) I have been publishing using PowerShell which works just fine.

output log: [2024-04-09 21:21:53.06] Using reference symbols cache paths: [c:\Users\David.Machanick\Documents\al\DLH\DLH\DLH Customizations.alpackages] [2024-04-09 21:21:53.10] Targeting server 'http://G5DD7511', server instance 'BC220' and tenant 'default'. [2024-04-09 21:21:53.10] Using Windows authentication. [2024-04-09 21:21:53.12] Sending request to http://g5dd7511:7049/BC220/dev/metadata?tenant=default

On Tue, Apr 9, 2024 at 8:08 PM Thaddeus Loke @.***> wrote:

Thanks for the logfiles, you are right in that there seems to be nothing much in them. That is very weird. What is in the debug output in VSCode when it hangs? I assume general connectivity from VSCode is fine: i.e. you can download symbols and publish to the server?

— Reply to this email directly, view it on GitHub https://github.com/microsoft/AL/issues/7709#issuecomment-2046277775, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYZXW7J36NLA4MMG67CO7U3Y4SGI3AVCNFSM6AAAAABF5REBCCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBWGI3TONZXGU . You are receiving this because you authored the thread.Message ID: @.***>

-- This email may contain confidential or privileged information.  If you believe you have received this email in error,

 please notify the sender by reply email and then delete this email immediately.

thloke commented 2 months ago

I see, it's failing on the very first request to the server (dev/metadata) so it can't reach the server at all. Does the request eventually time out and give you something like:

[2024-04-10 10:36:45.74] Error: No such host is known. (bcserver:7049)
No such host is known.

[2024-04-10 10:36:45.74] Error: An error occured while processing the request.
Request ID: 344da29c-81b0-4f69-a899-54c7ec4358b7
Session ID: 34ea89c7-ff95-44b6-a23e-0f2a0f6137cf

Or does it hang indefinitely and stay stuck?

Checking the obvious, the developer port on the server (default 7049) is enabled right?

dmachanick commented 2 months ago

Hangs forever Dev port is enabled It is late here I will be back online in the morning I am USA central time

On Tue, Apr 9, 2024 at 8:55 PM Thaddeus Loke @.***> wrote:

I see, it's failing on the very first request to the server (dev/metadata) so it can't reach the server at all. Does the request eventually time out and give you something like:

[2024-04-10 10:36:45.74] Error: No such host is known. (bcserver:7049) No such host is known.

[2024-04-10 10:36:45.74] Error: An error occured while processing the request. Request ID: 344da29c-81b0-4f69-a899-54c7ec4358b7 Session ID: 34ea89c7-ff95-44b6-a23e-0f2a0f6137cf

Or does it hang indefinitely and stay stuck?

Checking the obvious, the developer port on the server (default 7049) is enabled right?

— Reply to this email directly, view it on GitHub https://github.com/microsoft/AL/issues/7709#issuecomment-2046317553, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYZXW7PTTNZHKXRPT2QD4MDY4SLYFAVCNFSM6AAAAABF5REBCCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBWGMYTONJVGM . You are receiving this because you authored the thread.Message ID: @.***>

-- This email may contain confidential or privileged information.  If you believe you have received this email in error,

 please notify the sender by reply email and then delete this email immediately.

thloke commented 2 months ago

That's very weird, in which case it might be the server that's causing the hanging and not the VSCode extension. Can you check the Event Viewer of the server host for entries under MicrosoftDynamicsNavServer to see if there's any errors server-side?

If it's a problem with this specific server, it's very likely a server side configuration issue.

Reply when convenient, there's no rush.

dmachanick commented 2 months ago

No new events on event viewer. I exited VS Code and brought it back up, which restored my symbols. IIS has a list of allowed apps that can communicate through Windows Defender Firewall. Do you know if VS Code debugging needs to be allowed - and if yes, what has to be allowed?

On Tue, Apr 9, 2024 at 10:09 PM Thaddeus Loke @.***> wrote:

That's very weird, in which case it might be the server that's causing the hanging and not the VSCode extension. Can you check the Event Viewer of the server host for entries under MicrosoftDynamicsNavServer to see if there's any errors server-side?

If it's a problem with this specific server, it's very likely a server side configuration issue.

Reply when convenient, there's no rush.

— Reply to this email directly, view it on GitHub https://github.com/microsoft/AL/issues/7709#issuecomment-2046466902, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYZXW7KN7A6R6CMAMQ6GR2DY4SUM5AVCNFSM6AAAAABF5REBCCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBWGQ3DMOJQGI . You are receiving this because you authored the thread.Message ID: @.***>

-- This email may contain confidential or privileged information.  If you believe you have received this email in error,

 please notify the sender by reply email and then delete this email immediately.

dmachanick commented 2 months ago

When I follow the link, I see this text: { "runtimeVersion": "11.1", "webApiVersion": "6.0", "debuggerVersion": "6.0", "webEndpoint": "http:////Webclient", "extensionAllowedTargetLevel": "Internal" } The web site it takes me to: http://localhost:7049/BC220/dev/metadata?tenant=default

Does this mean anything to you?

On Wed, Apr 10, 2024 at 9:10 AM David Machanick @.***> wrote:

No new events on event viewer. I exited VS Code and brought it back up, which restored my symbols. IIS has a list of allowed apps that can communicate through Windows Defender Firewall. Do you know if VS Code debugging needs to be allowed - and if yes, what has to be allowed?

On Tue, Apr 9, 2024 at 10:09 PM Thaddeus Loke @.***> wrote:

That's very weird, in which case it might be the server that's causing the hanging and not the VSCode extension. Can you check the Event Viewer of the server host for entries under MicrosoftDynamicsNavServer to see if there's any errors server-side?

If it's a problem with this specific server, it's very likely a server side configuration issue.

Reply when convenient, there's no rush.

— Reply to this email directly, view it on GitHub https://github.com/microsoft/AL/issues/7709#issuecomment-2046466902, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYZXW7KN7A6R6CMAMQ6GR2DY4SUM5AVCNFSM6AAAAABF5REBCCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBWGQ3DMOJQGI . You are receiving this because you authored the thread.Message ID: @.***>

-- This email may contain confidential or privileged information.  If you believe you have received this email in error,

 please notify the sender by reply email and then delete this email immediately.

thloke commented 2 months ago

There shouldn't be anything special about VSCode debugging that needs to be enabled beyond making sure that port 7049 (or whichever is configured on your server as the developer port) is open. Unfortunately since we're getting into the weeds of the server configuration, I don't think I can help much more through the github repo. I'll need someone with expertise on the server side, so this is at the point where we should move this to a customer support case. From there, it will be easier to bring additional people in to look at this. It will be much faster to get a resolution that way too.

Can you do one of the following?

If it helps make some progress, that URL that you shared just means that you're targeting a local server on your machine (docker probably). I assume you can contact the server through other means (webclient, web api calls, etc..) and it's just a problem with the developer endpoint (port 7049)? If so, you can try to verify that traffic through that port is actually reaching the server.

dmachanick commented 2 months ago

Support is passing the buck and saying you need to support this. It is also happening now on our other on prem customers who are on BC22 or higher. Since there was an AL debugging problem in the 12.0 release, maybe this is the same or similar problem in the current release and the pre-release. This is my incident with support: Re: VS Code cannot connect to Bu... - TrackingID#2404080030006180

thloke commented 2 months ago

I'm going to raise this internally to see why support is pushing you to here, since I cannot handle what should be a support case through github.

dmachanick commented 2 months ago

I think I finally convinced support to take it further, but I think it would still be good to raise this internally. Otherwise you become an adjunct of the support department.

Dave

On Thu, Apr 11, 2024 at 8:23 PM Thaddeus Loke @.***> wrote:

I'm going to raise this internally to see why support is pushing you to here, since I cannot handle what should be a support case through github.

— Reply to this email directly, view it on GitHub https://github.com/microsoft/AL/issues/7709#issuecomment-2050801708, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYZXW7PMO4RKQ37XX4UHWW3Y44ZRLAVCNFSM6AAAAABF5REBCCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANJQHAYDCNZQHA . You are receiving this because you authored the thread.Message ID: @.***>

-- This email may contain confidential or privileged information.  If you believe you have received this email in error,

 please notify the sender by reply email and then delete this email immediately.

dmachanick commented 2 months ago

There is a setting in the instance configuration for PublicWebBaseURL that does not look like it is used for user connections. I set this: Set-NAVServerConfiguration BC220 -keyname PublicWebBaseUrl -keyvalue " http://localhost:8080/BC220/?company=US&dc=0" and now the debug works. It is fussier though - it hangs if it thinks breakpoints are in other apps w2here I don't have access. Once I clear all breakpoints it works.

The other app has these settings "allowDebugging": true, "allowDownloadingSource": false, "includeSourceInSymbolFile": true

This used to be okay to set breakpoints - did this change?

Dave

On Fri, Apr 12, 2024 at 8:53 AM David Machanick @.***> wrote:

I think I finally convinced support to take it further, but I think it would still be good to raise this internally. Otherwise you become an adjunct of the support department.

Dave

On Thu, Apr 11, 2024 at 8:23 PM Thaddeus Loke @.***> wrote:

I'm going to raise this internally to see why support is pushing you to here, since I cannot handle what should be a support case through github.

— Reply to this email directly, view it on GitHub https://github.com/microsoft/AL/issues/7709#issuecomment-2050801708, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYZXW7PMO4RKQ37XX4UHWW3Y44ZRLAVCNFSM6AAAAABF5REBCCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANJQHAYDCNZQHA . You are receiving this because you authored the thread.Message ID: @.***>

-- This email may contain confidential or privileged information.  If you believe you have received this email in error,

 please notify the sender by reply email and then delete this email immediately.

thloke commented 2 months ago

That's interesting because the PublicWebBaseUrl is used to determine the URI to handle web client requests, so if that was set wrongly you shouldn't have been able to even access BC through the browser. It's also a component of where we send our VSCode requests too, so it will have an effect on debugging.

It shouldn't hang on breakpoints in other apps though, it should work given the settings you mentioned.