SFC module fails to start with empty .proto files present

I have some sfc charts running. My colleague is working on it. I do not know much what it does. Anyway, when the gateway is stopped, multiple empty .proto files are created:

2003@ignition-dev:/work(dev)$ ll var/com.inductiveautomation.sfc/
total 0
-rw-rw-r--    1 2003     2003           0 Feb 18 16:44 5e251674-25e3-41d6-a781-e86bcf1f1103.proto
-rw-rw-r--    1 2003     2003           0 Feb 18 16:44 89732dac-5de0-44ef-a9b2-37c42890350e.proto
-rw-rw-r--    1 2003     2003           0 Feb 18 16:44 b05c3de6-ba01-49bb-9e16-21644c2e2a73.proto

When the gateway is started and the files are present, the sfc module fails to start. Which has ‘I do not know why' reason.

I am the maintainer of the container lifecycle and the colleague asked me to delete the files before the start of the gateway automatically.

For me this means a systemd unit with some hardcoded paths which I really don’t like. ChatGPT says that under some conditions (using a podman quadlet etc) I would need even a systemd unit override. I really do not want that.

Is there an elegant way to solve this from ignition configuration? To delete the files at the GW startup or shutdown? Or anything?

I am trying to create a reliable way to deploy dev/test/prod ignitions using git and podman quadlets → any external tool complicates things.

We have this problem from ignition 8.1 to 8.3.3.

java.lang.Exception: Exception while starting up module "com.inductiveautomation.sfc".
	at com.inductiveautomation.ignition.gateway.modules.ModuleInstance.startup(ModuleInstance.java:761)
	at com.inductiveautomation.ignition.gateway.modules.ModuleManagerImpl.runStartupPhase(ModuleManagerImpl.java:541)
	at com.inductiveautomation.ignition.gateway.modules.ModuleManagerImpl.startup(ModuleManagerImpl.java:480)
	at com.inductiveautomation.ignition.gateway.IgnitionGateway.startupInternal(IgnitionGateway.java:1385)
	at com.inductiveautomation.ignition.gateway.redundancy.RedundancyManagerImpl.startup(RedundancyManagerImpl.java:367)
	at com.inductiveautomation.ignition.gateway.IgnitionGateway.initRedundancy(IgnitionGateway.java:807)
	at com.inductiveautomation.ignition.gateway.IgnitionGateway.lambda$initInternal$1(IgnitionGateway.java:720)
	at com.inductiveautomation.ignition.common.execution.impl.BasicExecutionEngine$ThrowableCatchingRunnable.run(BasicExecutionEngine.java:561)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassCastException: class java.util.ImmutableCollections$MapN cannot be cast to class java.util.HashMap (java.util.ImmutableCollections$MapN and java.util.HashMap are in module java.base of loader 'bootstrap')
	at com.inductiveautomation.sfc.distributed.protoserializers.PersistedChartSerializer.fromProtobufMessage(PersistedChartSerializer.java:77)
	at com.inductiveautomation.sfc.ChartManager.initProtoCharts(ChartManager.java:586)
	at com.inductiveautomation.sfc.ChartManager.initPersistedCharts(ChartManager.java:515)
	at com.inductiveautomation.sfc.ChartManager.startup(ChartManager.java:194)
	at com.inductiveautomation.sfc.SfcGatewayHookImpl.startup(SfcGatewayHookImpl.java:147)
	at com.inductiveautomation.ignition.gateway.modules.ModuleInstance.startup(ModuleInstance.java:755)
	at com.inductiveautomation.ignition.gateway.modules.ModuleManagerImpl.runStartupPhase(ModuleManagerImpl.java:541)
	at com.inductiveautomation.ignition.gateway.modules.ModuleManagerImpl.startup(ModuleManagerImpl.java:480)
	at com.inductiveautomation.ignition.gateway.IgnitionGateway.startupInternal(IgnitionGateway.java:1385)
	at com.inductiveautomation.ignition.gateway.redundancy.RedundancyManagerImpl.startup(RedundancyManagerImpl.java:367)
	at com.inductiveautomation.ignition.gateway.IgnitionGateway.initRedundancy(IgnitionGateway.java:807)
	at com.inductiveautomation.ignition.gateway.IgnitionGateway.lambda$initInternal$1(IgnitionGateway.java:720)
	at com.inductiveautomation.ignition.common.execution.impl.BasicExecutionEngine$ThrowableCatchingRunnable.run(BasicExecutionEngine.java:561)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)

This will be fixed in 8.3.5 and is currently available in the 8.3.5 nightly.

The likely cause for the empty file is that there’s something in the chart that’s failing to serialize properly which is preventing the chart from persisting to disk. It would be worth tracking that down to prevent the empty files in the first place. Do you have logs from the shutdown?