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

Error: Specified argument was out of the range of valid values. (Parameter 'index') #7722

Open virusbear opened 2 months ago

virusbear commented 2 months ago

Please include the following with each issue:

1. Describe the bug When starting a debugging session of a downloaded snapshot using the "AL: Show all snapshots" action, I am represented with the error message Specified argument was out of range of valid values. (Parameter 'index') after selecting the wanted snapshot.

image

DebuggerServices_13.0.14.54431.log DebuggerServices_14.0.15.3709.log

2. To Reproduce Steps to reproduce the behavior:

  1. Create an empty extension with the app.json content listed below
  2. Initialize a snapshot debugging session
  3. Finish the snapshot debugging session after executing the required actions in the web client
  4. Select the snapshot using "AL: Show all snapshots" action in VSCode

This error is not reproducible for every scenario. This is the first time we were able to observe this issue. We already tried using different installations of VS Code, on Windows 10 and Windows 11 environments. All combinations display the same error.

{
  "id": "c396b8ca-0b37-4133-af07-8ec4feb9b2bd",
  "name": "Debug",
  "publisher": "Default publisher",
  "version": "1.0.0.0",
  "brief": "",
  "description": "",
  "privacyStatement": "",
  "EULA": "",
  "help": "",
  "url": "",
  "logo": "",
  "dependencies": [
    {
      "id":  "<custom app id>",
      "name":  "<custom app name>",
      "publisher":  "<custom app publisher",
      "version":  "0.0.0.0"
    }
  ],
  "screenshots": [],
  "platform": "23.0.0.0",
  "application": "23.0.0.0",
  "idRanges": [
    {
      "from": 50000,
      "to": 99999
    }
  ],
  "resourceExposurePolicy": {
    "allowDebugging": true,
    "allowDownloadingSource": true,
    "includeSourceInSymbolFile": true
  },
  "runtime": "12.0",
  "features": [
    "NoImplicitWith"
  ]
}

the above listed app.json is a default extension we internally use for debugging purposes. This extension works in multiple environments, incl. OnPrem and SaaS customers.

3. Expected behavior A debugging session should start, stopping execution at any available and valid breakpoints.

4. Actual behavior Upon loading the debugging session the above listed error message is shown. Any further action cancels the debugging session.

5. Versions:

Final Checklist

Please remember to do the following:

Internal work item: AB#538643

kalberes commented 2 months ago

Looks like a mismatch in symbols with your local file and the server file. Maybe clean your symbol cache and download symbols with the snapshot endpoint (snapshot config).

virusbear commented 2 months ago

Cleaning the symbols cache was the first thing we tried. Unfortunately, the issue persisted afterward. Download was only done with the snapshot config, as this one is the only configuration available in the launch.json. The extension in question is also only used for debugging and, thus does not contain any objects. We additionally followed the below process, which we usually do when we encounter issues with debugging/symbols in general.

  1. remove the .alpackages folder from the project
  2. reload window
  3. Download symbols from the environment to debug
  4. reload the window again
  5. start debugging session (initialize snapshot in this case)

Unfortunately, none of the above options helped with the situation