dshackle icon indicating copy to clipboard operation
dshackle copied to clipboard

ResponseParser Failed - Which upstream?

Open MysticRyuujin opened this issue 3 years ago • 1 comments

Feature Request

I upgraded to the latest version and I started seeing this:

2022-04-10 15:04:41.691 | WARN  |       ResponseParser | Failed to parse JSON from upstream: Unrecognized token 'Request': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
 at [Source: (byte[])"Request Blocked. Contact Flux Team."; line: 1, column: 9]
2022-04-10 15:04:41.702 | WARN  |       ResponseParser | Failed to parse JSON from upstream: Unexpected character ('<' (code 60)): expected a valid value (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
 at [Source: (byte[])"<html>
<head><title>405 Not Allowed</title></head>
<body>
<center><h1>405 Not Allowed</h1></center>
<hr><center>nginx/1.21.6</center>
</body>
</html>
"; line: 1, column: 2]

Obviously the error is coming from one of the configured upstreams but I don't know which one just by looking at the logs.

I can figure it out with some testing but it would be nice if the ResponseParser could tell us which one is throwing the error. Based on the output of the "State of ETH" messages I think it's reporting the upstream at 0 in this case.

MysticRyuujin avatar Oct 04 '22 15:10 MysticRyuujin

Good point. Will add it.

Previous it wasn't logged at all, so with the new version I've improved the handling and logging of upstream errors so now you can see them like this. And you're right, it definitely needs to specify the upstream id

splix avatar Oct 04 '22 17:10 splix