Giter VIP home page Giter VIP logo

Comments (2)

hanneshayashi avatar hanneshayashi commented on June 19, 2024

Hi and thanks for the bug report!
The API is unfortunately a little inconsistent sometimes. There is actually code in GSM that is supposed to make the function only return the Drive object after it can be queried by the API by checking the permissions on it:
https://github.com/hanneshayashi/gsm/blob/main/gsmdrive/drives.go#L51-L61
This seems to work in most cases. I also tried querying it again immediately after creation, but this will just work most of the time but subsequent calls will still fail. It just seems that the backend takes a while to replicate the information about the Drive...

Since the API is really inconsistent, it is also hard to test this behaviour.

The sleep timer should just be a failsafe, but it looks like it may not be enough. I could definitely try to increase it to 10 seconds, although I would prefer a more elegant and permanent solution.

I will take a look at this for the next release. As an immediate workaround you could try something with https://registry.terraform.io/providers/hashicorp/time/latest/docs/resources/sleep.

from terraform-provider-gdrive.

hanneshayashi avatar hanneshayashi commented on June 19, 2024

@jannishuebl I was able to reproduce the issue and it still boils down to the API not being strongly consistent. After the creation of a Drive, the API immediately returns the object, but subsequent calls that reference or use the Drive may result in 404 errors for a while. Even if one or two requests succeed, the next one may still return 404.

The workaround for now is to have a longer wait time to give the backend time to replicate. I just released version v0.9.1 of the provider that introduces a new optional parameter called wait_after_create with a default value of 60 that allows you to configure the time the provider waits after the initial creation of the Drive object. Please test it out and let me know if this fixes the issue or re-open this issue if it still doesn't work.

As a side-note: In hindsight, it might have been better to create a separate resource for Drive restriction, as these cannot be set during the creation and need an update operation after the Drive has been created. I may change this in a v1.0 of the provider, as it would be a breaking change.

from terraform-provider-gdrive.

Related Issues (3)

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.