← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1876323] Re: `cloud-init analyze` fails to produce useful output on Amazon Linux 2 due to log format configuration

 

This bug is believed to be fixed in cloud-init in version 20.3. If this
is still a problem for you, please make a comment and set the state back
to New

Thank you.

** Changed in: cloud-init
       Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to cloud-init.
https://bugs.launchpad.net/bugs/1876323

Title:
  `cloud-init analyze` fails to produce useful output on Amazon Linux 2
  due to log format configuration

Status in cloud-init:
  Fix Released

Bug description:
  When running `cloud-init analyze show` against a log file from an
  Amazon Linux 2 instance (e.g. https://pastebin.com/uhJNysgm), no
  useful output is produced:

  $ cloud-init analyze show -i ~/Downloads/uhJNysgm.txt
  -- Boot Record 01 --
  The total time elapsed since completing an event is printed after the "@" character.
  The time the event takes is printed after the "+" character.

  Total Time: 0.00000 seconds

  1 boot records analyzed

  This is because the log configuration on Amazon Linux 2
  (https://pastebin.com/x6NZ4NFJ) configures this for arg0Formatter:

    format=%(asctime)s cloud-init[%(process)d]:
  %(filename)s[%(levelname)s]: %(message)s

  which differs from the upstream definition:

    format=%(asctime)s - %(filename)s[%(levelname)s]: %(message)s

  This is a problem, because the `cloud-init analyze` commands depend on
  the " - " part of the line's presence as a separator (see
  https://github.com/canonical/cloud-
  init/blob/master/cloudinit/analyze/dump.py#L78), so when we run
  analyze against an Amazon Linux 2 log file, we incorrectly fail to
  identify any of the lines in it as being cloud-init log lines.

  (As an aside, this is the only non-whitespace difference between the
  two configuration files.)

To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-init/+bug/1876323/+subscriptions


References