Machines API - Waiting for "destroyed" state returns 404

Hello,

Im trying to understand if i’ve run into an issue or if im just using the Machines API wrong. My flow is:

  • Spin up a short lived machine (via POST /machines)
  • Wait for state change to started, works fine (GET /wait?state=started)
  • Wait for state change to stopped, works fine (GET /wait?state=stopped, this one needs the instance id for some reason)
  • Start background process and Wait for state change to destroyed (GET /wait?state=destroyed)
  • Verify a few things, then make a call to destroy the machine (DELETE /machines/id)
  • Delete call goes through fine, but the wait process we just started actually stops with HTTP 404 code. Full response: {"error":"machine not found"}

In this particular scenario the wait for destroy HTTP call was issues prior to deletion and should have returned 200 instead. Any ideas?

Hey, I’m checking the logs for the machine calls you made and I can see that the wait issue was called prior to deletion, which is the right way to go about it. We recently moved a lot of our internal API away from nats.io to connect.build and there could be an issue with how we’re retrieving a machine that’s in the process of deletion. I’ll dig into this more and see what I can find.

Any update on this? Worth mentioning that waiting for machine destruction is necessary for name reuse.

Hey, thanks for checking in on this. We have a change that fixes this ready to go but we’re waiting on some other fixes to roll this out. I imagine this will be ready by tomorrow. I tested the change and it looks to have fixed it, I’ll update you when we have this rolled out

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.