Server 500 errrors from knife environment show


#1

I’ve noticed occasional messages like the following when running commands
like “knife environment show”:

ERROR: Server returned error 500 for
https://myserver:14443/organizations/ibm/environments/test-env, retrying
1/5 in 4s

The command completes after this retry, but it was run from a tool that
uses the command to capture the output and process it as JSON file. The
error is logged to stdout, and thus appears in the JSON file. The error is
not frequent - I might see it once before tearing the system down and
reinstalling chef-server for another round of testing.

I started seeing these after we moved to chef server 12.0.5 from chef
server 11.

Given that the retry is successful, should this should be logged to the
console? Does this reflect a problem that needs fixing - either in chef,
or something in our environments?

John M
IBM


#2

On Wednesday, April 22, 2015 at 9:36 AM, John McMeeking wrote:

I’ve noticed occasional messages like the following when running commands like “knife environment show”:

ERROR: Server returned error 500 for https://myserver:14443/organizations/ibm/environments/test-env, retrying 1/5 in 4s

The command completes after this retry, but it was run from a tool that uses the command to capture the output and process it as JSON file. The error is logged to stdout, and thus appears in the JSON file. The error is not frequent - I might see it once before tearing the system down and reinstalling chef-server for another round of testing.

I started seeing these after we moved to chef server 12.0.5 from chef server 11.

Given that the retry is successful, should this should be logged to the console? Does this reflect a problem that needs fixing - either in chef, or something in our environments?

John M
IBM

The source of this problem is that the logger is configured with the same defaults for both chef-client and knife, but users have different expectations of how these tools behave in terms of what output goes where. It’s probably a good idea for knife to configure the logger to use stderr by default. In the short term, you can use the log location setting in your knife config file to send log output like this to stderr.


Daniel DeLeo


#3

We’ll change knife.rb to log to STDERR.

It unclear to me whether these messages indicate a problem or perhaps just
more logging by chef. But as long as the commands aren’t failing, we can
live with that.

John M
IBM

From: Daniel DeLeo dan@kallistec.com
To: chef@lists.opscode.com
Date: 04/22/2015 12:36 PM
Subject: [chef] Re: Server 500 errrors from knife environment show
Sent by: Daniel DeLeo ddeleo@kallistec.com

On Wednesday, April 22, 2015 at 9:36 AM, John McMeeking wrote:

I’ve noticed occasional messages like the following when running commands
like “knife environment show”:

ERROR: Server returned error 500 for
https://myserver:14443/organizations/ibm/environments/test-env, retrying
1/5 in 4s

The command completes after this retry, but it was run from a tool that
uses the command to capture the output and process it as JSON file. The
error is logged to stdout, and thus appears in the JSON file. The error is
not frequent - I might see it once before tearing the system down and
reinstalling chef-server for another round of testing.

I started seeing these after we moved to chef server 12.0.5 from chef
server 11.

Given that the retry is successful, should this should be logged to the
console? Does this reflect a problem that needs fixing - either in chef, or
something in our environments?

John M
IBM

The source of this problem is that the logger is configured with the same
defaults for both chef-client and knife, but users have different
expectations of how these tools behave in terms of what output goes where.
It’s probably a good idea for knife to configure the logger to use stderr
by default. In the short term, you can use the log location setting in your
knife config file to send log output like this to stderr.


Daniel DeLeo


#4

On Wednesday, April 22, 2015 at 12:28 PM, John McMeeking wrote:

We’ll change knife.rb to log to STDERR.

It unclear to me whether these messages indicate a problem or perhaps just more logging by chef. But as long as the commands aren’t failing, we can live with that.

John M
IBM

A 500 error might be repeatable (server misconfiguration) or it might be transient (temporarily out of DB connections due to high load). In either case, chef-client/knife use an exponential retry mechanism with splay (same general idea as ethernet collisions), going through all 5 retries will take at least a minute (usually longer). So it’s not usually an issue, but it’s something the user should be made aware of, so they don’t need to wait 1-2 minutes for feedback in the case of a persistent error.


Daniel DeLeo