Skip to content

Static Web Apps (swa) deployment fails on K8s worker pool but succeeds locally #10209

Description

@Rose-Northey

Root cause

This is a known issue listed in the Azure Static Web Apps CLI: Azure/static-web-apps-cli#514 (also see the troubleshooting doc).

  • kubernetes workers use a network drive, not a local disk
  • swa deploy writes its scratch/deploy files relative to the current working directory
  • swa deploy treats all working directories like local disks even when they aren't

Errors / stacktrace

generic swa error may be seen unknown error has occured

Workaround

stage the build output on local disk (e.g. /tmp) before invoking swa, so it never touches the network-backed work directory:

STAGE=$(mktemp -d /tmp/swa-XXXXXX)
cp -a package/dist "$STAGE/dist"
cd "$STAGE" && swa deploy ./dist --deployment-token "$TOKEN" --env Production

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions