Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pulumi resource updated despite error when applying the change #178

Open
piotr-bzdyl-vertexinc opened this issue Jan 5, 2022 · 1 comment
Labels
kind/bug Some behavior is incorrect or out of spec

Comments

@piotr-bzdyl-vertexinc
Copy link

Hello!

  • Vote on this issue by adding a 馃憤 reaction
  • To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already)

Issue details

Even though pulumi up failed with an error when applying a change to the resource, the change got recorded in the state and it didn't show up again in pulumi preview but it should.

Steps to reproduce

  1. Create Pulumi code to create a repository
  2. pulumi up the change so the repository is created
  3. Set archived=True on the repository
  4. Make sure that the Github token used to apply the change doesn't have admin permissions in the repository (e.g. remove its permissions in the repository Settings page)
  5. pulumi preview shows that this attribute will be changed
  6. Run pulumi up
    It fails due to missing Github token permissions with:
    some-github-repo (github:index:Repository)
    error: 1 error occurred:
        * updating urn:pulumi:prod::**masked**::github:index/repository:Repository::some-github-repo: PATCH https://api.github.com/repos/myorg/some-github-repo: 404 Not Found []   ```
    
  7. You can see in Github that the repository hasn't been archived
  8. Run pulumi preview - Pulumi doesn't detect that the repository still needs to be archived
  9. Run pulumi refresh - Pulumi doesn't detect that the repository is not archived and it has archived=True in the state.
@piotr-bzdyl-vertexinc piotr-bzdyl-vertexinc added the kind/bug Some behavior is incorrect or out of spec label Jan 5, 2022
@leezen
Copy link

leezen commented Jan 8, 2022

I'm surprised the refresh doesn't detect this. It sounds like this might be an issue with the upstream provider in how it handles the 404 coming back from GitHub. As a workaround, are you able to edit the state file to remove the archived status and retry?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Some behavior is incorrect or out of spec
Projects
None yet
Development

No branches or pull requests

2 participants