github RunOnFlux/flux v8.6.2

18 hours ago

PR #1673 revealed that enterprise apps have compose: [] in the local DB (encrypted in the enterprise field), which unearthed multiple critical bugs in the redeployment and recovery logic.

Issues Fixed

1. Repeated Redeployments Every 12 Minutes

  • reinstallOldApplications was comparing appSpecifications.hash vs installedApp.hash
  • decryptEnterpriseApps called specificationFormatter() which strips metadata (hash, height, instances, expire)
  • Result: installedApp.hash was undefined, causing false positive "obsolete" detection
  • Fix: Added formatSpecs option (default: true for backward compatibility), getInstalledAppsFromDb now passes formatSpecs: false to preserve metadata

2. Missing Container Recovery

  • When containers were missing (not just stopped), no recovery mechanism existed
  • Fix: Added recreateMissingContainers() to peerNotification.js that reinstalls components when containers don't exist

3. Syncthing Delay Applied Incorrectly

  • Apps with syncthing flags (r:, g:) would wait 30 minutes before recreation even when containers were completely missing
  • The delay is meant for stopped containers to allow data syncing, not missing containers
  • Fix: Check container existence first; only apply 30-minute delay if container exists but is stopped

4. Component Redeployment Crashes

  • softUninstallComponent and hardUninstallComponent called with null appId causing crashes
  • Fix: Calculate appId using dockerService.getAppIdentifier() before calling uninstall functions
  • Fix: Pass appComponent instead of appSpecifications as third parameter

5. Hard Redeployment Broken for Enterprise Apps

  • hardRedeployComponent loaded specs from getStrictApplicationSpecifications (doesn't decrypt)
  • Then tried to access empty compose array
  • Fix: Added decryption check before accessing compose array

6. Soft Redeployment Component Broken for Enterprise Apps

  • softRedeployComponent had the same issue as hardRedeployComponent
  • Loaded specs without decryption, then tried to access empty compose array
  • Fix: Added decryption check before accessing compose array

7. stopAppMonitoring Parameter Bugs

  • softUninstallComponent called with boolean true instead of the actual stopAppMonitoring function (fixed in previous commit)
  • hardUninstallComponent also called with boolean true instead of function
  • Both functions invoke stopAppMonitoring() as a function, so passing true would crash with "true is not a function"
  • Fix: Pass the function reference, not a boolean

Testing

  • Verified on nodes: 38.240.227.140, 162.55.241.211, 195.3.222.71, 148.251.229.179, 65.108.231.135, 176.9.31.60, 23.88.73.206
  • Confirmed streamrnode apps no longer repeatedly redeploy
  • Confirmed wordpress apps with syncthing now recreate immediately when containers are missing
  • Confirmed syncthing apps are created but not started, then handleReceiveOnlyTransition starts them after sync
  • Confirmed container recreation works for missing enterprise app containers

Related

  • Builds on #1673 which identified the root cause (enterprise compose redaction)

Don't miss a new flux release

NewReleases is sending notifications on new releases.