fix(install): assert Wonderware sidecar deploy is complete in Refresh-Services
v2-ci / build (push) Failing after 37s
v2-ci / unit-tests (tests/Core/ZB.MOM.WW.OtOpcUa.Cluster.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.ControlPlane.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.Security.Tests) (push) Has been skipped
v2-ci / integration (tests/Server/ZB.MOM.WW.OtOpcUa.Host.IntegrationTests) (push) Has been skipped
v2-ci / integration (tests/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer.IntegrationTests) (push) Has been skipped
v2-ci / build (push) Failing after 37s
v2-ci / unit-tests (tests/Core/ZB.MOM.WW.OtOpcUa.Cluster.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.ControlPlane.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.Security.Tests) (push) Has been skipped
v2-ci / integration (tests/Server/ZB.MOM.WW.OtOpcUa.Host.IntegrationTests) (push) Has been skipped
v2-ci / integration (tests/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer.IntegrationTests) (push) Has been skipped
Add a post-publish Step 4b that fails the refresh if the sidecar deploy folder is missing any load-bearing file (System.Memory.dll, MessagePack.dll, the .exe, or the net48 binding-redirect .exe.config). A partial/stale deploy that bypasses `dotnet publish` drops System.Memory.dll, so the sidecar JIT-load-faults in PipeServer.RunOneConnectionAsync (FileNotFoundException 'System.Memory, Version=4.0.1.2') and NSSM crash-loops it (exit 2 every ~2 min). Catching this at publish time beats discovering it as a production crash-loop. Guarded by -WhatIf; throws before any service is started.
This commit is contained in:
@@ -118,6 +118,43 @@ Run {
|
||||
-c Release -o (Join-Path $PublishRoot "lmxopcua\WonderwareHistorian") | Out-Null
|
||||
} "dotnet publish (Host + sidecar)"
|
||||
|
||||
# ------------------------------------------------------------------------
|
||||
# Step 4b: Assert the Wonderware historian sidecar deploy is COMPLETE
|
||||
# ------------------------------------------------------------------------
|
||||
# A partial/stale sidecar deploy (e.g. a hand-copy that bypassed the
|
||||
# `dotnet publish` above) silently drops the net48 binding-redirect
|
||||
# .exe.config and the transitive runtime DLLs MessagePack needs — most
|
||||
# notably System.Memory.dll. The sidecar then JIT-load-faults inside
|
||||
# PipeServer.RunOneConnectionAsync ("FileNotFoundException: System.Memory,
|
||||
# Version=4.0.1.2") and NSSM crash-loops it (exit 2 every ~2 min, ~120 s of
|
||||
# retry backoff before it gives up). Fail loudly here so an incomplete deploy
|
||||
# is caught at publish time instead of by a production crash-loop.
|
||||
# (Root-caused 2026-06-12; these four files have no alternate resolution path,
|
||||
# unlike the AVEVA SDK DLLs which the Historian install can also supply.)
|
||||
|
||||
if (-not $WhatIf) {
|
||||
Step "Verifying Wonderware historian sidecar deploy is complete"
|
||||
|
||||
$sidecarDir = Join-Path $PublishRoot "lmxopcua\WonderwareHistorian"
|
||||
$sidecarRequired = @(
|
||||
'OtOpcUa.Driver.Historian.Wonderware.exe',
|
||||
'OtOpcUa.Driver.Historian.Wonderware.exe.config', # net48 binding redirects
|
||||
'System.Memory.dll', # MessagePack's load-bearing dep
|
||||
'MessagePack.dll'
|
||||
)
|
||||
|
||||
$missing = $sidecarRequired | Where-Object { -not (Test-Path (Join-Path $sidecarDir $_)) }
|
||||
|
||||
if ($missing.Count -gt 0) {
|
||||
$msg = "Wonderware historian sidecar deploy at '$sidecarDir' is INCOMPLETE — missing: " +
|
||||
"$($missing -join ', '). It would crash-loop with a FileNotFoundException in PipeServer. " +
|
||||
"Re-run the sidecar 'dotnet publish' into that folder (Step 4) — never hand-copy a partial build output."
|
||||
throw $msg
|
||||
}
|
||||
|
||||
Write-Host " sidecar deploy OK — all $($sidecarRequired.Count) load-bearing files present" -ForegroundColor DarkGreen
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------------------
|
||||
# Step 5: Service env block — ensure OTOPCUA_HISTORIAN_ALARM_WRITE_ENABLED
|
||||
# is set on the Wonderware historian service (PR C.2 toggle).
|
||||
|
||||
Reference in New Issue
Block a user