Hi guys! I’m new to pulumi, but with help of docs ...
# aws
Hi guys! I’m new to pulumi, but with help of docs I’ve managed to build infrastructure as I wanted. Now I try to move it to Github Actions and in preview I get this error after docker image is successfully built. This doesn’t happen locally. I’ve been googling for few hours now and I don’t have a clue of what is going on. I’ve created a dedicated AWS user for Pulumi with full access and I’m using this users access key id and secret access key in my GH Actions. It looks like Pulumi can’t push an image to ECR. Here is my job setup:
Copy code
    name: Preview IaaC
    runs-on: ubuntu-latest
      - uses: actions/checkout@v2
      - uses: actions/setup-python@v2
          python-version: 3.8
      - name: Configure AWS Credentials
        uses: aws-actions/configure-aws-credentials@v1
          aws-access-key-id: ${{ secrets.PULUMI_AWS_ACCESS_KEY_ID }}
          aws-secret-access-key: ${{ secrets.PULUMI_AWS_SECRET_ACCESS_KEY }}
          aws-region: ${{ secrets.STAGING_AWS_DEFAULT_REGION }}
      - run: pip install pipenv && pipenv lock -r > requirements.txt && pip install -r requirements.txt
      - uses: pulumi/actions@v3
          command: preview
          stack-name: ***/dev
Here is an output that I get:
Copy code
docker:image:Image ***-api-dev-django-dockerimage  Successfully built 481a2e057dd2
      docker:image:Image ***-api-dev-django-dockerimage  Successfully tagged ***.dkr.ecr.***.<http://amazonaws.com/***-api-dev-ecr-repo-5b4a376:latest|amazonaws.com/***-api-dev-ecr-repo-5b4a376:latest>
      pulumi:pulumi:Stack ***-dev running error: Program failed with an unhandled exception:
      pulumi:pulumi:Stack ***-dev running error: Traceback (most recent call last):
      pulumi:pulumi:Stack ***-dev running error: an unhandled error occurred: Program exited with non-zero exit code: 1
      pulumi:pulumi:Stack ***-dev  3 errors
    pulumi:pulumi:Stack (***-dev):
      error: Program failed with an unhandled exception:
      error: Traceback (most recent call last):
        File "/opt/hostedtoolcache/pulumi/3.28.0/x64/pulumi-language-python-exec", line 107, in <module>
        File "/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
          return future.result()
        File "/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/pulumi/runtime/stack.py", line 126, in run_in_stack
          await run_pulumi_func(lambda: Stack(func))
        File "/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/pulumi/runtime/stack.py", line 51, in run_pulumi_func
          await wait_for_rpcs()
        File "/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/pulumi/runtime/stack.py", line 110, in wait_for_rpcs
          raise exception
        File "/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/pulumi/output.py", line 98, in is_value_known
          return await is_known and not contains_unknowns(await future)
        File "/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/pulumi/output.py", line 214, in run
          return await cast(Awaitable[U], transformed)
        File "/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/pulumi_docker/docker.py", line 243, in build_and_push_image
          build_result = await build_image(base_image_name, path_or_build, log_resource, cache_from)
        File "/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/pulumi_docker/docker.py", line 444, in build_image
          raise ResourceError(
      pulumi_docker.docker.ResourceError: No digest available for image ***.dkr.ecr.***.<http://amazonaws.com/***-api-dev-ecr-repo-5b4a376|amazonaws.com/***-api-dev-ecr-repo-5b4a376>
      error: an unhandled error occurred: Program exited with non-zero exit code: 1
  (node:1766) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, stat '/tmp/automation-logs-preview-pp2jEL/eventlog.txt'
  (node:1766) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see <https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode>). (rejection id: 2)
  (node:1766) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
This looks similar to an error we started seeing on Friday, in a repo that was previously deploying OK. We are also pushing docker images to ECR but we are using python and deploying via a BitBucket pipeline. Friday coincided with the release of pulumi_docker-3.2.0 We were able to work around this error by pinning our import of pulumi_docker to version 3.1.0.
I also got around it by pinning to pulumi-docker==3.1.0
So I’m not the only one 😅 Thank you good people for opening an issue! 🤞