1. Docs
  2. Support & Troubleshooting
  3. Troubleshooting
  4. Common Issues
  5. Interrupted updates

Recovering from an interrupted update

    If the Pulumi CLI is interrupted when performing a deployment, you may see a warning message that looks something like this on your next update:

    $ pulumi up
    ...
    Diagnostics:
      pulumi:pulumi:Stack (proj):
        warning: Attempting to deploy or update resources with 1 pending operations from previous deployment.
          * urn:pulumi:dev::proj::aws:s3/bucket:Bucket::bucket, interrupted while creating
        These resources are in an unknown state because the Pulumi CLI was interrupted while waiting for changes to these resources
        to complete. You should confirm whether or not the operations listed completed successfully by checking the state of the
        appropriate provider. For example, if you are using AWS, you can confirm using the AWS Console.
    
        Once you have confirmed the status of the interrupted operations, you can repair your stack using `pulumi refresh` which will refresh the state from the provider you are using and clear the pending operations if there are any.
    
        Note that `pulumi refresh` will need to be run interactively to clear pending CREATE operations.
    ...
    

    This occurs when the Pulumi CLI fails to complete cleanly. There are a number of ways this can happen:

    • The CLI experiences a network partition when attempting to save your stack’s state.
    • The CLI process is killed by your operating system while performing an update.
    • The CLI crashes when performing an update.

    This error means that the Pulumi engine initiated an operation but was not able to determine if the operation completed successfully. As a result, resources may have been created that Pulumi does not know about.

    To fix this condition, you should first cancel the update:

    $ pulumi cancel
    ...
    The currently running update for 'interruptedstack' has been canceled!
    

    If pulumi cancel fails with error: [400] Bad Request: the update has already completed, you can safely ignore that error and continue with the next step.

    Then run pulumi refresh to remove any pending operations cleanly, allowing you to resolve any pending operations that Pulumi could not fix unaided.

    Resolving pending creates

    When you have pending create operations, pulumi refresh will prompt you interactively to resolve them. You’ll need to determine whether the resource was actually created in your cloud provider:

    1. If the resource was not created: Select “clear” to remove the pending operation
    2. If the resource was created: You’ll need to provide the resource’s physical ID so Pulumi can import it into state

    Non-interactive mode

    In CI/CD environments or scripts where interactive prompts aren’t available, use these flags:

    To clear all pending creates (resource was not created):

    pulumi refresh --clear-pending-creates --yes
    

    To import pending creates (resource was created):

    Use --import-pending-creates to specify each resource to import. Because this flag accepts exactly one value per invocation, you must pass the resource URN and its physical ID as two consecutive flag invocations — one for the URN and one for the ID.

    The full resource URN appears in the diagnostic output of pulumi up (as shown above) and can also be retrieved by running pulumi stack --show-urns.

    pulumi refresh \
      --import-pending-creates "urn:pulumi:dev::myproject::aws:s3/bucket:Bucket::mybucket" \
      --import-pending-creates "my-bucket-abc123" \
      --yes
    

    For multiple pending creates, alternate URN and physical ID invocations in order:

    pulumi refresh \
      --import-pending-creates "urn:pulumi:dev::myproject::aws:s3/bucket:Bucket::bucket1" \
      --import-pending-creates "bucket1-id" \
      --import-pending-creates "urn:pulumi:dev::myproject::aws:s3/bucket:Bucket::bucket2" \
      --import-pending-creates "bucket2-id" \
      --yes
    
    Each --import-pending-creates invocation accepts exactly one value. Do not combine a URN and ID in a single invocation — for example, --import-pending-creates "urn:... my-id" will fail with each URN must be followed by an ID: found an odd number of entries. Similarly, do not pass both values as arguments to a single flag — for example, --import-pending-creates "urn:..." "my-id" will fail with unknown command "my-id" for "pulumi refresh".

    Finding the physical ID

    To find the physical ID of a resource that was created:

    • AWS: Check the AWS Console or use the aws CLI to find the resource
    • Azure: Check the Azure Portal or use the az CLI
    • GCP: Check the Cloud Console or use the gcloud CLI

    The physical ID format varies by provider and resource type. For example:

    • AWS S3 bucket: the bucket name (e.g., my-bucket-abc123)
    • AWS EC2 instance: the instance ID (e.g., i-0123456789abcdef0)
    • Azure resource: the full resource ID path

    At this point your stack should be valid, up-to-date, and ready to accept future updates.