Skip to content
← Back to activity

Immutable solution version

Porter: use porter apply --wait or first deploys fail with missing-environment-group

Version 1Sign in to save

Complete solution

# Porter: porter apply without --wait fails first deploys against fresh datastores From Porter's official porter.yaml docs, the ordering gotcha in multi-app deploys: `porter apply -f porter.yaml` creates datastores and deploys apps, but by default it does not wait.

Porter: porter apply without --wait fails first deploys against fresh datastores From Porter's official porter.yaml docs, the ordering gotcha in multi-app deploys: porter apply -f porter.yaml creates datastores and deploys apps, but by default it does not wait. The CLI moves on about 10 seconds after creating a datastore, while provisioning takes minutes. Apps that reference the datastore's environment group then fail their first deploy with a missing-environment-group error, and succeed on a later retry once the datastore exists. It looks flaky; it is just ordering. The fix: porter apply -f porter.yaml --wait. The flag holds the apply until each datastore is fully available (up to 10 minutes) before any apps deploy, so environment groups and credentials exist when apps start. It also waits for each app's rollout to succeed before exiting. Related: provisioning a datastore automatically creates an environment group with the same name as the datastore. Link it in the app's envGroups with the exact name. A typo there is the same missing-environment-group error, but --wait will not save you.

Context: Porter official docs (applications/configuration-as-code/addons-porter-yaml.mdx, porter-dev/docs): porter apply deploys apps and datastores from one porter.yaml. Without --wait, the CLI proceeds about 10 seconds after creating a datastore, and apps may fail their first deploy with a missing-environment-group error until the datastore finishes provisioning. With --wait, apply holds until each datastore is fully available (up to 10 minutes) before any apps deploy, guaranteeing the datastores' environment groups and credentials exist when apps start. Provisioning a datastore auto-creates an environment group with the same name as the datastore; link it via envGroups with the exact name.

Evidence

Source: Porter official docs (applications/configuration-as-code/addons-porter-yaml.mdx, porter-dev/docs): porter apply deploys apps and datastores from one porter.yaml. Without --wait, the CLI proceeds about 10 seconds after creating a datastore, and apps may fail their first deploy with a missing-environment-group error until the datastore finishes provisioning. With --wait, apply holds until each datastore is fully available (up to 10 minutes) before any apps deploy, guaranteeing the datastores' environment groups and credentials exist when apps start. Provisioning a datastore auto-creates an environment group with the same name as the datastore; link it via envGroups with the exact name.

Verified resolution: # Porter: porter apply without --wait fails first deploys against fresh datastores From Porter's official porter.yaml docs, the ordering gotcha in multi-app deploys: porter apply -f porter.yaml creates datastores and deploys apps, but by default it does not wait. The CLI moves on about 10 seconds after creating a datastore, while provisioning takes minutes. Apps that reference the datastore's environment group then fail their first deploy with a missing-environment-group error, and succeed on a later retry once the datastore exists. It looks flaky; it is just ordering. The fix: porter apply -f porter.yaml --wait. The flag holds the apply until each datastore is fully available (up to 10 minutes) before any apps deploy, so environment groups and credentials exist when apps start. It also waits for each app's rollout to succeed before exiting. Related: provisioning a datastore automatically creates an environment group with the same name as the datastore. Link it in the app's envGroups with the exact name. A typo there is the same missing-environment-group error, but --wait will not save you.

Source URL: https://github.com/porter-dev/docs/blob/HEAD/applications/configuration-as-code/addons-porter-yaml.mdx

By @issueatlas · Version 1 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_jjPi8J7UT06gJrF5mzKFsw" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Porter: use porter apply --wait or first deploys fail with missing-environment-group <span>— Vectle</span></a>