Title: MSSQL datasource via PDC: login fails with empty username — field clears itself on save
Hi everyone,
I’m stuck on a very specific issue with the MSSQL datasource in Grafana Cloud and hoping someone has seen it.
Setup
- Grafana Cloud (recent)
- Private Data Source Connect (PDC) agent running on Windows Server 2016, 1 agent connected, healthy
- Target DB: SQL Server 2019 Express on the same server, TCP port 50000
- Database: eazybusiness (it’s a JTL-Wawi installation)
The error
Every time I click “Save & Test” I get:
Database error: Failed to connect to the mssql server
mssql: login error: Fehler bei der Anmeldung für den Benutzer “”.
(Login failed for user “”.)
The verboseMessage from /health shows quite literally an empty string as username. Matching that: the Username field in the form clears itself after save — it goes back to the placeholder “Benutzername erforderlich” (“Username required”). The password shows as “configured” but the username is gone.
What I’ve already verified
- PDC agent healthy, “1 agent connected” in the UI
- netstat -an | findstr 50000 → TCP 0.0.0.0:50000 LISTENING
- sqlcmd -S 127.0.0.1,50000 -U GrafanaUser -P ‘…’ -d eazybusiness → logs in fine, returns @@VERSION
- SQL Server Mixed Mode is enabled
- GrafanaUser exists in the DB with db_datareader
- Authentication dropdown is set to “SQL Server Authentication” (not Windows AD, not Azure)
- Datasource has been fully deleted and recreated multiple times
- Tried every host format I could think of: localhost:50000, 127.0.0.1,50000, 127.0.0.1:50000, localhost\INSTANCENAME,50000, public IP,50000
- Encrypt tried as false and true (with Skip TLS verify)
- Tested in a fresh incognito window (no extensions, no autofill) — same result
Health endpoint response (DevTools → Network)
{
“details”: { “errorDetailsLink”: “Microsoft SQL Server data source | Grafana documentation” },
“message”: “Database error: Failed to connect to the mssql server”,
“status”: “ERROR”,
“verboseMessage”: “mssql: login error: Fehler bei der Anmeldung für den Benutzer “”.”
}
So the test on SQL Server really does receive an empty string as the username — confirmed by SQL Server’s error log as well. This is not a network or PDC issue (those would produce TCP errors, not an MSSQL login error). The credentials themselves are correct. Something between the form and the mssql backend plugin is losing the username.
Questions
- Has anyone else seen the MSSQL form drop the user value on save when SQL Server Authentication is selected? (The password is preserved, just the username is lost.)
- Is there a known inconsistency between jsonData.authType and jsonData.authenticationType where the UI shows one value but the backend interprets another? I saw grafana/grafana#95757 which looks adjacent but is about provisioning.
- What’s the cleanest way to provision the MSSQL datasource via the HTTP API with SQL Server Authentication + PDC injected? Would be a great workaround until this is fixed.
Thanks in advance — any pointers or “me too” would be helpful.
Grafana version: Grafana Cloud (current as of April 2026)
Browser: Chrome 147 on Windows 11
MSSQL plugin: built-in