0.10 web UI gives connection refused error when drilling into cookbooks


#1

Hoepfully, this is the last 0.10 upgrade problem I encounter. The web
UI seems to work for every function except for drilling into a
specific cookbook. It can list the cookbooks, nodes, data bags etc.
And it can drill into any item that isn’t a cookbook (node/data
bag/role etc.). However, when I click on any cookbook’s version link
in the cookbook listing I get this error after a long wait time:

“Connection refused - Connection refused connecting to localhost:4000
for /cookbooks/apache2/0.99.3/files/c66fdf0bd066835aeb4de9eb8d10915f,
giving up”

I’ve checked the webui.pem file on the server and that seems to be
working since every other part of the web UI is functional. Also, I
can connect on the server to localhost:4000. So I’m a bit confused as
to what’s going on. The webui and server logs aren’t very helpful.

-J


#2

Seems to work if I run “chef-server-webui -l debug” manually instead
of using the init.d script.

On Tue, May 17, 2011 at 2:38 PM, Jason J. W. Williams
jasonjwwilliams@gmail.com wrote:

Hoepfully, this is the last 0.10 upgrade problem I encounter. The web
UI seems to work for every function except for drilling into a
specific cookbook. It can list the cookbooks, nodes, data bags etc.
And it can drill into any item that isn’t a cookbook (node/data
bag/role etc.). However, when I click on any cookbook’s version link
in the cookbook listing I get this error after a long wait time:

“Connection refused - Connection refused connecting to localhost:4000
for /cookbooks/apache2/0.99.3/files/c66fdf0bd066835aeb4de9eb8d10915f,
giving up”

I’ve checked the webui.pem file on the server and that seems to be
working since every other part of the web UI is functional. Also, I
can connect on the server to localhost:4000. So I’m a bit confused as
to what’s going on. The webui and server logs aren’t very helpful.

-J


#3

The problem is restrictive permissions on /tmp, causing
chef-server-webui to be unable to write temporary files containing the
syntax highlighted versions of recipe files. The error the web UI
shows " “Connection refused - Connection refused connecting to
localhost:4000” is misleading…it’s not a connection issue it’s a
writing temp files issue.

-J

On Tue, May 17, 2011 at 2:38 PM, Jason J. W. Williams
jasonjwwilliams@gmail.com wrote:

Hoepfully, this is the last 0.10 upgrade problem I encounter. The web
UI seems to work for every function except for drilling into a
specific cookbook. It can list the cookbooks, nodes, data bags etc.
And it can drill into any item that isn’t a cookbook (node/data
bag/role etc.). However, when I click on any cookbook’s version link
in the cookbook listing I get this error after a long wait time:

“Connection refused - Connection refused connecting to localhost:4000
for /cookbooks/apache2/0.99.3/files/c66fdf0bd066835aeb4de9eb8d10915f,
giving up”

I’ve checked the webui.pem file on the server and that seems to be
working since every other part of the web UI is functional. Also, I
can connect on the server to localhost:4000. So I’m a bit confused as
to what’s going on. The webui and server logs aren’t very helpful.

-J


#4

On Tuesday, May 17, 2011 at 2:17 PM, Jason J. W. Williams wrote:

The problem is restrictive permissions on /tmp, causing
chef-server-webui to be unable to write temporary files containing the
syntax highlighted versions of recipe files. The error the web UI
shows " “Connection refused - Connection refused connecting to
localhost:4000” is misleading…it’s not a connection issue it’s a
writing temp files issue.

-J

There is a bug in net/http in the version/patchlevel of ruby you’re using where it sets a variable to nil and then calls closed? on it. In the vast majority of cases (but not all, as you’ve encountered), this bug is triggered by connection refused, so Chef covers up the NoMethodError with connection refused. That is:

  1. An exception is raised inside a code block where chef is reading the body (or attempting to read) of the http response.
  2. The net/http library calls nil.closed? inside its error handling/cleanup logic. This hides the error raised in step 1.
  3. Chef sees the NoMethodError caused by this bug, but doesn’t know what the error from step 1 was. So it raises connection refused which is usually the cause of this behavior. Chef matches very specifically on the exception class and message so other errors are no “rewritten” in this way.

I’m not happy with this behavior, but it’s an improvement over the previous behavior. Of course, both improvements to Chef’s workaround, and efforts to get the patch for this bug accepted to upstreams are welcome.

http://redmine.ruby-lang.org/issues/show/2708

http://redmine.ruby-lang.org/issues/show/2758


Dan DeLeo

On Tue, May 17, 2011 at 2:38 PM, Jason J. W. Williams
<jasonjwwilliams@gmail.com (mailto:jasonjwwilliams@gmail.com)> wrote:

Hoepfully, this is the last 0.10 upgrade problem I encounter. The web
UI seems to work for every function except for drilling into a
specific cookbook. It can list the cookbooks, nodes, data bags etc.
And it can drill into any item that isn’t a cookbook (node/data
bag/role etc.). However, when I click on any cookbook’s version link
in the cookbook listing I get this error after a long wait time:

“Connection refused - Connection refused connecting to localhost:4000
for /cookbooks/apache2/0.99.3/files/c66fdf0bd066835aeb4de9eb8d10915f,
giving up”

I’ve checked the webui.pem file on the server and that seems to be
working since every other part of the web UI is functional. Also, I
can connect on the server to localhost:4000. So I’m a bit confused as
to what’s going on. The webui and server logs aren’t very helpful.

-J