spin
spin copied to clipboard
Mistakenly using `https` on outbound HTTP request results in hard-to-debug error
I sent an outbound HTTP request to https://localhost:3001/ when I meant to write http://localhost:3001/. It failed with just RequestError. There was nothing in the error or in Spin logs. In the end I had to hack a println! into the Spin source to figure out what was going on. This is a suboptimal diagnostic experience.
We really should have detail strings in these error results...
We totally should, but that's a breaking change, so something to maybe batch up with removing params. As an interim measure I was going to try logging something from Spin - open to thoughts though.
Next step on this will be to try this again and get the current experience.
The current code looks like it's meant to log at warning level but I wasn't seeing it when I tested. Investigating.
It does log but the incantation to see the log is non-obvious:
RUST_LOG=outbound_http=info spin up
But I am not sure how to make this less worse within the constraints of the current design. And given that I may be the only person to ever run into this (or at least, to be troubled enough by it to bring it up), I'm not sure it should be a high priority outside of a broader redesign of error handling and reporting.
I wonder if in the near term we should simply document how to use the RUST_LOG env variable with spin up. In the long term, we could consider making these kinds of things easier to see with the --verbose flag as proposed in #608 ?