poor juju find output

Bug #1924195 reported by Ian Booth
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
High
Simon Richardson

Bug Description

$ juju version
2.9-rc11-ubuntu-amd64

$ juju find
ERROR unexpected content-type from server "text/html"

From the controller logs:

controller-0: 11:13:59 ERROR juju.apiserver.charmhub.client Response HTTP/1.1 500 INTERNAL SERVER ERROR
Content-Length: 291
Content-Type: text/html
Date: Thu, 15 Apr 2021 01:13:59 GMT
Server: gunicorn/19.7.1
X-Request-Id: CA4150913CB30A324F3001BB607793550C29
X-Vcs-Revision: 8eeb8e4

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>500 Internal Server Error</title>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>

Ian Booth (wallyworld)
description: updated
Revision history for this message
John A Meinel (jameinel) wrote :

When there is an outage from charmhub, it can return a 500 error rather than the expected content. we should generate a nicer error indicating we could not get a good response from charmhub, rather than worrying about the file encoding of the response.

I'm a little surprised we aren't checking the status code before trying to read the body content.

Changed in juju:
milestone: 2.9-rc11 → 2.9-rc12
Changed in juju:
milestone: 2.9-rc12 → 2.9-rc13
Changed in juju:
assignee: nobody → Simon Richardson (simonrichardson)
Revision history for this message
Simon Richardson (simonrichardson) wrote :

PR to fix the error output https://github.com/juju/juju/pull/12922

Changed in juju:
status: Triaged → Fix Committed
Ian Booth (wallyworld)
Changed in juju:
milestone: 2.9-rc13 → 2.9.0
Changed in juju:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.