Files
pxe-server/playbook/shopfloor-setup/gea-shopfloor-cmm/scripts/gocmm-debug.bat
cproudlock 7af66575d0 CMM: gocmm-debug - capture the real startup NRE (PC-DMIS COM not registered)
debug.log from the bay shows the part group enumerates fine (14 .geop files
opened), then goCMM connects to PC-DMIS over COM and throws:

  System.ArgumentNullException: Value cannot be null. Parameter name: type
     at System.Activator.CreateInstance(Type type)
     at GEAE.Common.CMM.CMMInterfaces.PCDMIS.PCDMIS.<ConnectToSoftware>b__43_0()
  -> System.NullReferenceException at ConnectToSoftware(...)

Root cause: PC-DMIS automation server is not COM-registered, so
Type.GetTypeFromProgID returns null -> CreateInstance(null) throws -> the NRE
is the downstream symptom. Not part-group, not permissions, not calibration.

- PROBE 4: pull the .NET Runtime / Application Error crash stack for goCMM from
  the Application log so the next run captures the null in one shot.
- PROBE 5: (a) part-group UNC reachability; (b) PC-DMIS COM registration check
  (PCDLRN.* ProgID -> CLSID -> LocalServer32) that names the missing registration
  and the Pcdlrn.exe /regserver fix; plus install presence for context.
- .bat header documents the COM root cause.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-17 08:31:11 -04:00

34 lines
1.5 KiB
Batchfile

@echo off
REM gocmm-debug.bat - launcher for gocmm-debug.ps1
REM
REM *** RUN THIS AS THE OPERATOR (the locked-down shop-floor user). ***
REM *** DO NOT right-click "Run as administrator" - that hides the bug. ***
REM
REM Diagnoses goCMM startup failures:
REM 1. "Requested registry access is not allowed" - dumps the goCMM key ACL
REM to confirm lockdown stripped the BUILTIN\Users write grant (PROBE 1-2).
REM 2. "Object reference not set to an instance of an object" at start:
REM - PROBE 3: part-group match (reg vs ApplicationSettings.xml, case-sensitive).
REM - PROBE 4: pulls the actual .NET crash stack from the Application log.
REM - PROBE 5: part-group UNC reachability + PC-DMIS COM registration.
REM Confirmed root cause to date: PC-DMIS COM server NOT registered ->
REM goCMM's Activator.CreateInstance gets a null type -> NRE. Fix: run
REM Pcdlrn.exe once elevated (/regserver). PROBE 5 reports this directly.
REM Output lands in C:\Logs\CMM\.
setlocal
set "HERE=%~dp0"
echo.
echo Running goCMM debug as %USERDOMAIN%\%USERNAME% ...
echo (If you see "Administrator: ..." in this window title, STOP - run as the operator instead.)
echo.
powershell.exe -NoProfile -ExecutionPolicy Bypass -File "%HERE%gocmm-debug.ps1"
echo.
echo ---------------------------------------------------------------
echo Done. Collect everything under C:\Logs\CMM\ (the .txt and .reg).
echo ---------------------------------------------------------------
pause