PROD mxgw vp04 + par-vp03/04: grant ZMR\WONDER-APP-VP04$, WONDER-PAR-VP03$, WONDER-PAR-VP04$ read on ZB (Galaxy Repository on wonder-app-vp03 SQL) #60

Closed
opened 2026-11-20 15:40:05 -05:00 by dohertj2 · 2 comments
Owner

mxgw on wonder-app-vp04 (LocalSystem) connects to the Galaxy Repository ZB on wonder-app-vp03 with Integrated Security, as QA vq04 -> vq03. SQL refuses it every 30 s: Cannot open database \"ZB\" requested by the login. The login failed. Login failed for user ZMR\WONDER-APP-VP04$ (4060). vp04 /health/ready = 503 until then; the service is running and needs no restart. Needed (someone with rights on the vp03 SQL instance): a login for ZMR\WONDER-APP-VP04$ + db_datareader on ZB (mirror what vp03 LocalSystem / QA vq04$ have). Record: mxaccessgw docs/deploy/2026-11-20-prod-e74918cc.md (08a9cfd6).

mxgw on wonder-app-vp04 (LocalSystem) connects to the Galaxy Repository `ZB` on wonder-app-vp03 with Integrated Security, as QA vq04 -> vq03. SQL refuses it every 30 s: `Cannot open database \"ZB\" requested by the login. The login failed. Login failed for user ZMR\WONDER-APP-VP04$ (4060)`. vp04 `/health/ready` = 503 until then; the service is running and needs no restart. Needed (someone with rights on the vp03 SQL instance): a login for `ZMR\WONDER-APP-VP04$` + db_datareader on ZB (mirror what vp03 LocalSystem / QA vq04$ have). Record: mxaccessgw `docs/deploy/2026-11-20-prod-e74918cc.md` (08a9cfd6).
Author
Owner

2026-11-22: two more accounts need the same grant. mxgw e74918cc is now installed on par-vp03 and par-vp04 (record: mxaccessgw docs/deploy/2026-11-22-prod-par-e74918cc.md). Both PAR gateways answer /health/ready 503 because galaxy-sql fails: Login failed for user 'ZMR\WONDER-PAR-VP03$' / 'ZMR\WONDER-PAR-VP04$', error 4060. Their MXAccess sessions work, and site-par is Connected on the par-vp03 gateway since 12:24:56Z.

Combined T-SQL for the DBA, run on WONDER-APP-VP03's SQL Server:

DECLARE @a sysname, @s nvarchar(max);
DECLARE c CURSOR LOCAL FAST_FORWARD FOR
  SELECT v FROM (VALUES (N'ZMR\WONDER-APP-VP04$'), (N'ZMR\WONDER-PAR-VP03$'), (N'ZMR\WONDER-PAR-VP04$')) t(v);
OPEN c; FETCH NEXT FROM c INTO @a;
WHILE @@FETCH_STATUS = 0
BEGIN
  IF SUSER_ID(@a) IS NULL
  BEGIN SET @s = N'CREATE LOGIN ' + QUOTENAME(@a) + N' FROM WINDOWS WITH DEFAULT_DATABASE = [ZB];'; EXEC (@s); END;
  SET @s = N'USE [ZB]; IF USER_ID(' + QUOTENAME(@a, '''') + N') IS NULL CREATE USER ' + QUOTENAME(@a) + N' FOR LOGIN ' + QUOTENAME(@a)
         + N'; ALTER ROLE db_datareader ADD MEMBER ' + QUOTENAME(@a) + N';';
  EXEC (@s);
  FETCH NEXT FROM c INTO @a;
END;
CLOSE c; DEALLOCATE c;

No restart is needed. Each gateway retries every 30 s and turns ready on its own, and the Overview cards go Up.

**2026-11-22: two more accounts need the same grant.** mxgw `e74918cc` is now installed on par-vp03 and par-vp04 (record: mxaccessgw `docs/deploy/2026-11-22-prod-par-e74918cc.md`). Both PAR gateways answer `/health/ready` 503 because `galaxy-sql` fails: `Login failed for user 'ZMR\WONDER-PAR-VP03$'` / `'ZMR\WONDER-PAR-VP04$'`, error 4060. Their MXAccess sessions work, and site-par is Connected on the par-vp03 gateway since 12:24:56Z. Combined T-SQL for the DBA, run on WONDER-APP-VP03's SQL Server: ```sql DECLARE @a sysname, @s nvarchar(max); DECLARE c CURSOR LOCAL FAST_FORWARD FOR SELECT v FROM (VALUES (N'ZMR\WONDER-APP-VP04$'), (N'ZMR\WONDER-PAR-VP03$'), (N'ZMR\WONDER-PAR-VP04$')) t(v); OPEN c; FETCH NEXT FROM c INTO @a; WHILE @@FETCH_STATUS = 0 BEGIN IF SUSER_ID(@a) IS NULL BEGIN SET @s = N'CREATE LOGIN ' + QUOTENAME(@a) + N' FROM WINDOWS WITH DEFAULT_DATABASE = [ZB];'; EXEC (@s); END; SET @s = N'USE [ZB]; IF USER_ID(' + QUOTENAME(@a, '''') + N') IS NULL CREATE USER ' + QUOTENAME(@a) + N' FOR LOGIN ' + QUOTENAME(@a) + N'; ALTER ROLE db_datareader ADD MEMBER ' + QUOTENAME(@a) + N';'; EXEC (@s); FETCH NEXT FROM c INTO @a; END; CLOSE c; DEALLOCATE c; ``` No restart is needed. Each gateway retries every 30 s and turns ready on its own, and the Overview cards go Up.
dohertj2 changed title from PROD mxgw vp04: grant ZMR\WONDER-APP-VP04$ read on ZB (Galaxy Repository on wonder-app-vp03 SQL) to PROD mxgw vp04 + par-vp03/04: grant ZMR\WONDER-APP-VP04$, WONDER-PAR-VP03$, WONDER-PAR-VP04$ read on ZB (Galaxy Repository on wonder-app-vp03 SQL) 2026-11-22 07:45:33 -05:00
Author
Owner

Resolved without the DBA grant: on 2026-11-22, between 17:00 and 17:02Z, all four PROD gateways (app-vp03, app-vp04, par-vp03, par-vp04) were switched to a SQL login for the Galaxy Repository, so the machine accounts no longer need access to ZB.

  • MxGateway__Galaxy__ConnectionString now uses the SQL login wwpdgdbro (db_datareader on ZB, WONDER-APP-VP03) instead of Integrated Security.
  • The string was staged by SMB and deleted after use; the password is not in any record.
  • Each box kept a backup of its old environment in the registry: AppEnvironmentExtra.bak-20261122-pregalaxysql.
  • /health/ready is 200 on all four, with galaxy-sql Healthy. Alarm-attribute discovery works, with watchList=5659 on each box.
  • At the same time, the PAR gateways' alarm subscription was set to \\WONDER-PAR-VP0x\Galaxy!NewJersey. Their feeds are on the alarm manager and not degraded.

The T-SQL grant in comment 12963 is no longer needed. Record: mxaccessgw main 54367e74 (docs/deploy/2026-11-22-prod-par-e74918cc.md); PROD plan §0.1a in scadaproj 1ab2bca.

Resolved without the DBA grant: on 2026-11-22, between 17:00 and 17:02Z, all four PROD gateways (app-vp03, app-vp04, par-vp03, par-vp04) were switched to a SQL login for the Galaxy Repository, so the machine accounts no longer need access to `ZB`. - `MxGateway__Galaxy__ConnectionString` now uses the SQL login `wwpdgdbro` (`db_datareader` on `ZB`, WONDER-APP-VP03) instead of Integrated Security. - The string was staged by SMB and deleted after use; the password is not in any record. - Each box kept a backup of its old environment in the registry: `AppEnvironmentExtra.bak-20261122-pregalaxysql`. - `/health/ready` is **200 on all four**, with galaxy-sql Healthy. Alarm-attribute discovery works, with `watchList=5659` on each box. - At the same time, the PAR gateways' alarm subscription was set to `\\WONDER-PAR-VP0x\Galaxy!NewJersey`. Their feeds are on the alarm manager and not degraded. The T-SQL grant in comment 12963 is no longer needed. Record: mxaccessgw `main` `54367e74` (`docs/deploy/2026-11-22-prod-par-e74918cc.md`); PROD plan §0.1a in scadaproj `1ab2bca`.
Sign in to join this conversation.