EcoReplay fails to load on kai-server: DllNotFoundException e_sqlite3 (native lib not on the .NET single-file search path) #71
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What happened
Deploying EcoReplay to the live kai-server Eco install (2026-07-06 deploy session) crashed the server on boot:
service_active=0- hard boot failure, server down/crash-looping until EcoReplay was removed. Rolled back; server healthy. The mod itself loaded and initialized fine (the plugin init ran); it fails the moment it opens the SQLite connection.Root cause
The Eco server runs as a .NET single-file bundle, so the native-lib resolver for
DllImport("e_sqlite3")searches only the bundle extraction dir (~/.net/EcoServer/<hash>/), NOT the mod folder or itsruntimes/linux-x64/native/path. Staginglibe_sqlite3.soinMods/EcoReplay/(both flattened and underruntimes/linux-x64/native/) does not put it on the search path - confirmed by the probed paths in the exception (all under the extraction dir).Recommended fix (self-contained in the mod, no infra change)
In
EcoReplayPlugininit, register aNativeLibrary.SetDllImportResolveron the SQLitePCLRaw provider assembly that resolvese_sqlite3to the mod's own directory:Register it before the first
SqliteConnection/Batteries_V2.Init(). Alternative (heavier, fleet-level): setLD_LIBRARY_PATHto the mod native dir in the eco-server systemd unit /eco-server-start.sh(infrastructure repo).Packaging (already staged, verified)
Mods/EcoReplay/needs:EcoReplay.dll,EcoReplay.deps.json,Microsoft.Data.Sqlite.dll,SQLitePCLRaw.{core,batteries_v2,provider.e_sqlite3}.dll,libe_sqlite3.so(linux-x64). Staged bundle is at~/eco-staging/EcoReplay/on kai-server.Validation
Restart-gated - live validation lands in the next restart window, not tonight. A headless engineer can implement + build green now. Refs: eco-app#67.
🔒 Reserved by
ward agent --driver claude— containerengineer-claude-eco-app-71on hostKAI-DESKTOP-TOWERis carrying this issue (reserved 2026-07-06T04:32:55Z). Concurrentward agentruns are blocked until it finishes or the reservation goes stale (2h0m0s TTL);--forceoverrides.Do not comment on or edit this issue to steer the run while it is reserved. The engineer seeded the body once at launch and never re-reads it, so a comment or edit reaches only human readers, never the running engineer. A correction goes to a new issue, dispatched fresh — that is the only channel that reaches a run in flight. Where the forge supports it, ward locks this conversation to make that a road-block rather than a convention (ward#494).
run seed context — what this run is carrying (ward#609)
coilyco-gaming/eco-app#71· branchissue-71· driverclaude· workflowdirect-mainengineer-claude-eco-app-71· wardv0.413.0· dispatched2026-07-06T04:32:55ZIssue body as seeded:
… (truncated to 2000 chars; full body is on this issue)
Static container doctrine and seed boilerplate are identical every run and omitted here (they ride ward v0.413.0).
— Claude (she/her), via
ward agentWARD-OUTCOME: done - EcoReplay's e_sqlite3 resolver now registers on the actual provider assembly, landed on main (
ee6d1b8).This one was a nice "the fix was already there, but pointed one assembly to the left" bug. A
SetDllImportResolverwas already installed, but onSQLitePCLRaw.coreplus a runtimeAppDomain.GetAssemblies()scan for the provider assembly - and that scan runs at plugin-init beforeBatteries_V2.Init()has loadedSQLitePCLRaw.provider.e_sqlite3, so it always came up empty and the resolver never got attached to the assembly whoseDllImport("e_sqlite3")actually fires. Swapping to a hardtypeof(SQLite3Provider_e_sqlite3).Assemblyboth force-loads the provider and targets the right assembly. Also added theruntimes/linux-x64/native/probe path so either staging layout resolves.Build is green (the provider typeof compiles, confirming reachability) and the 9 mod unit tests pass. Confidence is high on the registration logic, but this is restart-gated - I can't exercise a live single-file bundle here, so the real proof is the next kai-server restart window actually booting with EcoReplay in. Worth watching that boot; if it still probes only the extraction dir, the fallback is the
LD_LIBRARY_PATHroute in the systemd unit (infra repo). No follow-ups filed yet - will hold until live validation confirms.