← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1483049] Re: File name not logged when there is an error loading a metadef file

 

** Changed in: glance
       Status: Fix Committed => Fix Released

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

Title:
  File name not logged when there is an error loading a metadef file

Status in Glance:
  Fix Released

Bug description:
  New image metadata can be added by creating a new json file in the
  directory glance/etc/metadefs (this metadata shows up in the image
  metadata UI on Horizon dashboard). If the file is loaded successfully,
  a log message like the following is printed:

  2015-08-09 11:48:34.713 INFO glance.db.sqlalchemy.metadata [-] File
  /etc/glance/metadefs/operating-system.json loaded to database.

  However, if there is an error loading the file, we get a log message
  like:

  2015-08-09 11:48:34.875 ERROR glance.db.sqlalchemy.metadata [-]
  Expecting , delimiter: line 15 column 9 (char 579)

  In other words, the file name is not printed. The UI silently ignores
  files that failed to load. This makes it very hard to know why the new
  metadata properties are not showing up in the UI. Printing the file
  name in the error message will make it easier to debug since the
  developer can now search the log for the new file name.

  REPRO:
  	1) Add a new json file, say data-security.json,  containing some error in the glance/etc/metadefs directory. Sample file: http://paste.openstack.org/show/uq3OdbnC4oxJOv5SRpQG/. Note that it is missing a comma at the end of line 14.
  	2) Run devstack by typing ./stack.sh. Examine the devstack log printed to the screen after it is done (you need to scroll up quite a bit).

  
  EXPECTED:
  Devstack log contains the file name along with error message.

  2015-08-09 11:48:34.875 ERROR glance.db.sqlalchemy.metadata [-] File
  /etc/glance/metadefs/data-security.json:  Expecting , delimiter: line
  15 column 9 (char 579)

  ACTUAL:
  Devstack log does NOT contain the file name, only the error message.

  2015-08-09 11:48:34.875 ERROR glance.db.sqlalchemy.metadata [-]
  Expecting , delimiter: line 15 column 9 (char 579)

To manage notifications about this bug go to:
https://bugs.launchpad.net/glance/+bug/1483049/+subscriptions


References