IMD SolutionComputing LibraryShop main store

Troubleshooting

Why a ctrlX snap build on Windows drops its package.manifest config

Edge computing and IIoT Published 6 min read By IMD Solution engineering team

Short answer

The build script checks and rewrites the config section of snapcraft.yaml, so a snap can build cleanly while the widget and other package.manifest settings are ignored. Remove that rewrite for a custom project, or keep your own snapcraft.yaml, after ruling out Docker startup, architecture and proxy problems.

On this page
  1. Why does Docker fail to start before the build runs?
  2. Which parts of the build happen on Windows and which in the container?
  3. Why does the architecture flag matter more than a clean exit code?
  4. Why do the proxy lines break the build on a direct connection?
  5. Why does a successful build still ignore my package.manifest?
  6. How do I confirm the fix on the controller?
  7. What is the decision for each symptom?
  8. Questions asked

A snap that builds without errors can still be wrong. On a Windows host, the packaged script runs the build, rewrites the config section of snapcraft.yaml, and hands you a snap file even though the widget and other settings from your package.manifest were never carried into it. The fix is to remove that rewrite step and keep your own snapcraft.yaml, after you have ruled out the three other things that stop a Windows snap build: Docker not starting, the wrong amd64 or arm64 target, and proxy lines the container cannot reach.

Work through the checks below in order. Each one separates a host problem from a packaging problem from a configuration problem, and the last one is the one that produced the reported symptom.

Why does Docker fail to start before the build runs? #

If Docker Desktop cannot start, the snapcraft container never runs, and the failure has nothing to do with your snapcraft.yaml. Docker Desktop on Windows uses WSL as its Linux backend, so a WSL startup problem blocks the build before packaging begins.

The demonstrated recovery, when the machine's hypervisor is set not to launch, is to run bcdedit /set hypervisorlaunchtype auto in an elevated command window, restart the host, and retest Docker. That command changes only the hypervisor launch setting; it does not repair every WSL failure, so read the Docker error first and confirm this setting is the one at fault.

Expected result after the fix: Docker Desktop reports running, and the build reaches the point of pulling ghcr.io/canonical/snapcraft:8_core22, the snapcraft image the script uses as its Linux packaging environment.

The reference environment for the reported case was Windows 11, Docker Desktop 27.4.0 with Docker Engine 28.3.3 also seen on the same host, the snapcraft 8 core22 image, ctrlX AUTOMATION SDK 2.6.7 with ctrlX Data Layer 2.6.4, and a ctrlX CORE or ctrlX CORE virtual on 2.6.9. Treat those versions as a reproducible baseline, not a compatibility matrix.

Which parts of the build happen on Windows and which in the container? #

Compilation and packaging are separate stages, and the language of your project decides where each one runs. Knowing the boundary tells you whether a missing binary or a metadata rewrite is your problem.

  • .NET: compile, publish and package all run on Windows, with the packaging done in the Docker snapcraft container. Debugging stays outside this procedure.
  • Python: compilation and debugging stay in the ctrlX SDK environment because of the ctrlX Data Layer dependencies; there is no publish step, and only packaging runs in Docker on Windows.
  • C++: compile, debug and produce deployable Linux artifacts in the SDK environment; only packaging runs in Docker on Windows.

If the .NET publish output is missing, fix compilation and dependencies first. A snap containing nothing usable is a build failure even when the packaging command exits cleanly.

Why does the architecture flag matter more than a clean exit code? #

The script asks you to select amd64 or arm64, and a snap for the wrong instruction set still packages successfully. Read the target architecture from the device information and match the build selection to it, then check that your published native artifacts and dependencies target the same architecture.

This is where project-root placement matters too. The demonstrated .NET placement copies Win\Net\build-snap-dotnet.ps1 into the sample's project directory, so the command window opens in the project root. Run it from elsewhere and relative paths resolve against the wrong files, which can mean packaging someone else's output or none at all.

Why do the proxy lines break the build on a direct connection? #

The script passes proxy environment variables into the container for corporate networks:

-e http_proxy="http://host.docker.internal:3128" `
-e https_proxy="http://host.docker.internal:3128" `

On a host with direct internet access, nothing listens on that local port, so the container's downloads fail even though Windows itself browses fine. If you are not behind a proxy, delete those two lines from the script before running it.

For a corporate proxy, the demonstrated approach runs a local proxy server on the Windows host and lets host.docker.internal route the container to it. Host applications and containers do not share proxy settings, so a working browser proves nothing about the container's path.

Why does a successful build still ignore my package.manifest? #

The script's own list of steps says it checks and modifies the original snapcraft.yaml before packaging. In the reported failure, that rewrite replaced the config section, and after packaging the widget and other configuration declared in package.manifest were simply absent from the installed app. The snap built cleanly and installed cleanly; it was just not your configuration.

The check that catches this takes one minute: diff your snapcraft.yaml before and after running the build script. Any write to the config section that does not match what you declared is your cause. The reported fix was to remove that rewrite from the script, after which the package.manifest settings came through. For any project beyond the SDK samples, the sounder position is the one the sample author states himself: use the script as a guideline and write your own snapcraft.yaml rather than letting a sample-oriented script regenerate parts of it.

The sample scripts target the SDK sample layout. A custom project has its own artifact directories, dependencies and app metadata, so every assumption the script makes about paths and metadata deserves the same before-and-after check.

How do I confirm the fix on the controller? #

Install the rebuilt snap on the intended ctrlX CORE or ctrlX CORE virtual and check the app itself, not the build log. Confirm the widget renders, the app appears in the expected category, and the Data Layer settings you declared are active. For what runs next to your app on the controller, see running PLC logic and Node-RED on one ctrlX CORE, and if the install step itself fails with an upload error, the snap upload exit status article covers that failure separately.

A safety and release note: a snap that carries your configuration but binaries for the wrong architecture, or that was verified only by a green build, should not be released to a machine that runs. Install, observe and confirm on the target before declaring the app production-ready.

What is the decision for each symptom? #

  • Docker does not start: fix the host first. If the error points at the hypervisor not launching, apply the documented bcdedit setting, restart, retest.
  • Downloads fail inside the container: remove the two proxy lines on a direct connection, or run a local proxy on the host and keep them on a corporate network.
  • The snap builds but the app is wrong on the target: check the amd64 or arm64 selection and the artifacts' architecture.
  • The snap builds and installs but the widget and package.manifest settings are missing: diff snapcraft.yaml around the build, delete the script's write to the config section, rebuild, and for a custom project maintain your own snapcraft.yaml from then on.

A green build line is evidence that a snap file exists. Only the diff of your metadata and a confirmed install on the target are evidence that your app shipped.

Questions asked

Does a green build confirm the snap is correct?

No. Packaging success proves only that Docker assembled a snap file. The script can overwrite app metadata during the build, and it can assemble a snap with binaries for the wrong amd64 or arm64 target. After building, install on the intended ctrlX CORE or virtual target and confirm the widget and Data Layer settings actually appear before you call the release done.

Why do I have to remove the proxy lines when I have no proxy?

The script passes http_proxy and https_proxy environment variables pointing at host.docker.internal on port 3128, a local proxy setup. On a machine with direct internet access nothing listens there, so the container's downloads fail or stall. Delete those two lines from the script before running it on a network without a proxy.

What does bcdedit /set hypervisorlaunchtype auto actually do?

It sets Windows to launch the hypervisor at boot, which Docker Desktop on Windows depends on for its Linux backend. Run it from an elevated command window only when Docker fails to start with a WSL-related error, then restart the host and retest. It repairs a hypervisor that is set to not launch, not every WSL failure.

Where can I see a snap template documented?

The ctrlX AUTOMATION documentation describes snap templates and their shell scripts for container image apps, and the SDK ships sample scripts for .NET, Python and C++ packaging from Windows. Read the template's own snapcraft.yaml before running a build script against your project, so you know which sections the script touches.

Is the same rewrite problem present for Python and C++ scripts?

The reported case is the .NET script, build-snap-dotnet.ps1. The language scripts share the same approach of checking and modifying snapcraft.yaml before packaging, so verify each one the same way: diff your snapcraft.yaml before and after a build and remove any write to the config section that discards your own package.manifest settings.

Keep reading

  • Troubleshooting

    node-red-industrial snap upload failed with exit status 1

    The exit status 1 upload error on a ctrlX CORE almost always means the snap is built for amd64 instead of arm64. Confirm the cause in the device diagnostic log, download with UBUNTU_STORE_ARCH=arm64, verify meta/snap.yaml lists arm64, then enable unknown sources and re-upload.

    Edge computing and IIoT

  • How-to

    Collect drive parameter data without master communication

    Node-RED reads ctrlX DRIVE and IndraDrive parameters through the ctrlX CORE Data Layer and the Drive Connect app, with no changes to the master control program. Same-subnet Ethernet covers every fieldbus case except EtherCAT, EtherCAT needs a configured EoE tunnel, and drives behind a gateway controller need a route on the collection CORE plus an explicit registration per drive address.

    Edge computing and IIoT

  • Troubleshooting

    Edge gateway config mode error: edit the right Gateway.cfg

    When the Allow Edge Gateway... tray command throws an error, the gateway service is reading a different Gateway.cfg than the one being edited: it runs as the system account and reads the file in the newest randomly named folder under CODESYSGatewayV3. Add MaintenanceMode=1 under the CmpEdgeGateway section there and retry the tray command; if it still fails, version 3.5.20.0 is the reported fallback that works without any edit.

    Edge computing and IIoT

Why storeDataPoints backfill drops Ignition history partitions