spin icon indicating copy to clipboard operation
spin copied to clipboard

Mistakenly using `https` on outbound HTTP request results in hard-to-debug error

Open itowlson opened this issue 3 years ago • 2 comments

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.

itowlson avatar Aug 30 '22 00:08 itowlson

We really should have detail strings in these error results...

lann avatar Aug 30 '22 21:08 lann

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.

itowlson avatar Aug 30 '22 21:08 itowlson

Next step on this will be to try this again and get the current experience.

michelleN avatar Feb 21 '23 21:02 michelleN

The current code looks like it's meant to log at warning level but I wasn't seeing it when I tested. Investigating.

itowlson avatar Feb 21 '23 22:02 itowlson

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.

itowlson avatar Feb 21 '23 22:02 itowlson

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 ?

michelleN avatar Feb 22 '23 16:02 michelleN