$ 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>
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.