posit-dev / publisher

MIT License
5 stars 0 forks source link

Improving the error message "Unexpected Response" from server. #1257

Open sagerb opened 6 months ago

sagerb commented 6 months ago

I see this error when I first attempt to deploy to one of my YETI servers in the morning, if I do not bounce the particular docker image. I believe nginx is responding with some type of error, but since we don't capture anything in the logs, I don't know what is being received.

I believe this error can occur in the field, outside of our YETI test environment. Can we improve the logging and perhaps the error message returned back into the UX?

Can the backend capture the failure and turn it into a more specific connection failed error messages?

To reproduce this, I attempted to deploy w/ credential for a server which was not responding (I hadn't bounced the particular Connect instance within YETI yet for the day since my Mac had gone to sleep).

Publisher agent log:

time=2024-04-01T11:43:08.337-07:00 level=INFO msg="Starting deployment to server" local_id=zgJt-GZJhJKHSdEG server=https://connect.localtest.me/rsc/dev-password
time=2024-04-01T11:43:08.337-07:00 level=INFO msg="Checking configuration against server capabilities" local_id=zgJt-GZJhJKHSdEG event_op=publish/checkCapabilities
time=2024-04-01T11:43:08.337-07:00 level=INFO msg="Testing authentication" local_id=zgJt-GZJhJKHSdEG event_op=publish/checkCapabilities method="No saved credentials" url=https://connect.localtest.me/rsc/dev-password
time=2024-04-01T11:43:08.445-07:00 level=ERROR msg="Deployment failed" local_id=zgJt-GZJhJKHSdEG error="unexpected response from the server"

Posit Publisher Log view:

Image

mmarchetti commented 6 months ago

If you hover over the "unexpected response" log message, there are additional details such as the URL being accessed and the HTTP status code. We should probably display more of that information, based on the error code.