Giter Site home page Giter Site logo

Comments (10)

davidji99 avatar davidji99 commented on July 26, 2024

Proposed solution will be add some exponential backoff potentially.

from terraform-provider-heroku.

talbright avatar talbright commented on July 26, 2024

I ran into a form of this the other week as well. In my case the app already existed in the statefile, but I was adding a heroku_domain. Of course re-running apply can get one past the problem, but that's far from ideal and not expected.

The aws provider client has some built-in retry/backoff mechanism, we might look to see if that can be extracted. I've also use https://github.com/cenkalti/backoff before, but I would like to get some additional 👀 on it to see if that looks like a dependency we want to bring in.

Ideally, I'd like to see retry logic built into the client, that way we get this for free across all our API calls and don't have to retrofit retry logic everywhere. I'll open a discussion in https://github.com/heroku/heroku-go.

from terraform-provider-heroku.

talbright avatar talbright commented on July 26, 2024

Actually perhaps the right thing to do here is use this: https://godoc.org/github.com/hashicorp/terraform/helper/resource#StateRefreshFunc

from terraform-provider-heroku.

bernerdschaefer avatar bernerdschaefer commented on July 26, 2024

I think using StateRefreshFunc is the more appropriate solution for this case, rather than baking retries into the client.

from terraform-provider-heroku.

talbright avatar talbright commented on July 26, 2024

Agreed, the more I think about it the more that seems like the right thing to do.

from terraform-provider-heroku.

bernerdschaefer avatar bernerdschaefer commented on July 26, 2024

@talbright Thinking about this more, I think the refresh should be done on the app after creation. By waiting there for the app to be ready, we would also fix https://github.com/terraform-providers/terraform-provider-heroku/issues/37 and anything else which depends on the app being provisioned for resources to be added. It would be a smarter version of the work-around that we've been using of introducing a sleep after app creation (https://github.com/terraform-providers/terraform-provider-heroku/issues/37#issuecomment-356378747).

from terraform-provider-heroku.

talbright avatar talbright commented on July 26, 2024

That makes sense to me as well. There's an issue with a couple of tests, I'm waiting to hear back from @davidji99 on and get those cleared out. If this hasn't been worked on by the time I get that cleaned up, I will implement the fix suggested here on the app resource.

from terraform-provider-heroku.

talbright avatar talbright commented on July 26, 2024

Hitting this up next.

from terraform-provider-heroku.

talbright avatar talbright commented on July 26, 2024

@bernerdschaefer I don't see anything in the production API for checking app status. I could hit the webhook API and look for past events, but that seems dodgy. There's a status field for the domain endpoint (https://devcenter.heroku.com/articles/platform-api-reference#domain) but that wouldn't fix the original issue here:

heroku_domain.app: Post https://api.heroku.com/apps/meh/domains: App meh is being provisioned. Please try again later.

Now I can fix this in the heroku resource by greping for this error message. That would not however fix if for the broader scenerios we have discussed here.

from terraform-provider-heroku.

talbright avatar talbright commented on July 26, 2024

Addressed by #142

from terraform-provider-heroku.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.