microsoft / microsoft/vscode-mssql
[Bug]: Query failed: Object reference not set to an instance of an object.
- Dominant language
- TypeScript
- Stars
- 1.9k
- Forks
- 610
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 97
Description
### Description
When I try to run any query, even just Select top 1000, I get this exception:
9:00:27 AM
Started executing query at Line 1
Query failed: Object reference not set to an instance of an object.
Total execution time: 00:00:00.454
When this started:
This started to happen last week, and few weeks ago, the entire login using Microsoft Entra MFA broke down. So I think these are somehow linked.
Console output when trying to login, select a table to perform query:
Also:
languageDetectionWebWorker.ts:241 ReferenceError: require is not defined
at r.f.require (index.js:2:702403)
at index.js:2:702071
at Array.reduce ()
at r.e (index.js:2:702049)
at n.loadModel (index.js:2:705059)
at n.runModel (index.js:2:705351)
at n.detectLanguagesImpl (languageDetectionWebWorker.ts:239:41)
at async u (languageDetectionWebWorker.ts:54:21)
at async n.$detectLanguage (languageDetectionWebWorker.ts:81:19)
### Steps to Reproduce
How to reproduce this:
- Make new MS SQL Server, for example to Azure, and have tables with encrypted columns. Encryption method: Deterministic, references Azure Key Vault key.
- Use Azure CLI to authenticate yourself for the encryption keys, located in Azure Key Vault
- Try to query tables with encrypted values.
### Affected Area
- [x] Connection dialog (SQL Server | Azure browse/Fabric browse)
- [x] Query editor
- [x] Query results panel
- [ ] Object Explorer
- [ ] GitHub Copilot integration
- [ ] Preview/Edit data
- [ ] Table Designer
- [ ] Schema Designer
- [ ] Schema Compare
- [ ] Local SQL Server Container provisioning
- [ ] SQL database in Fabric provisioning
- [ ] DACPAC/BACPAC export/import
- [ ] SQL Database projects
- [ ] Query Plan Visualizer
- [ ] Other (please describe below)
### If you selected "Other", please describe the affected area
_No response_
### Environment Information
Version: 1.118.1 (Universal)
MacOS Tahoe 26.4.1
SQL Server version: 1.42.1
### Confirmation
- [x] I have searched existing issues and couldn't find a match
- [ ] I want to work on this issue
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the failure with an Azure SQL Server table containing deterministically encrypted columns and Azure Key Vault authentication, using the reported VS Code and SQL Server versions. Inspect languageDetectionWebWorker.ts around line 239 and the query, connection-dialog, and results-panel paths implicated by the report. Done means encrypted queries execute successfully without the null-reference error and the related console failure is understood or resolved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, sql, typescript
- Domain
- authentication, cloud, database
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100