[bind10-dev] change of data format

Naoki Kambe kambe at jprs.co.jp
Mon Jul 26 02:11:13 UTC 2010


Hi Jelte-san,

I noticed you a very minor problem. I think it might be related to
this thread. If you have already known, please ignore. :)

If b10-config.db file is left old format, cfgmgr process can't
startup. I got following verbose messages which bind10 process
produced.

  Traceback (most recent call last):
    File "/usr/local/lib/python3.1/site-packages/isc/config/cfgmgr.py", line 70, in read_from_file
      file_config = json.loads(file.read())
    File "/usr/local/lib/python3.1/json/__init__.py", line 291, in loads
      return _default_decoder.decode(s)
    File "/usr/local/lib/python3.1/json/decoder.py", line 325, in decode
      obj, end = self.raw_decode(s, idx=_w(s, 0).end())
    File "/usr/local/lib/python3.1/json/decoder.py", line 341, in raw_decode
      obj, end = self.scan_once(s, idx)
  ValueError: Expecting property name: line 1 column 1 (char 1)

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "/usr/local/libexec/bind10-devel/b10-cfgmgr", line 61, in <module>
      main()
    File "/usr/local/libexec/bind10-devel/b10-cfgmgr", line 49, in main
      cm.read_config()
    File "/usr/local/lib/python3.1/site-packages/isc/config/cfgmgr.py", line 210, in read_config
      self.config = ConfigManagerData.read_from_file(self.data_path)
    File "/usr/local/lib/python3.1/site-packages/isc/config/cfgmgr.py", line 81, in read_from_file
      raise ConfigManagerDataReadError("Config file unreadable")
  isc.config.cfgmgr.ConfigManagerDataReadError: Config file unreadable

This is because b10-config.db file is old format like this,

  $ cat /var/bind10-devel/b10-config.db
  {'version': 1}

To fix this problem, we need to convert this file to strict JSON
format. Example for we need to manually replace single quotes with
double quotes in this file like this,

  $ cat /var/bind10-devel/b10-config.db
  {"version": 1}

Even if we reinstall bind10 from the newest trunk codes, this file
can't be replaced with a correct file.

Thanks,

Noaki Kambe

From: Jelte Jansen <jelte at isc.org>
Subject: [bind10-dev] change of data format
Date: Thu, 22 Jul 2010 10:06:32 +0200

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> 
> Hi,
> 
> as the final part of the convert-to-json effort, i've updated the specfile and
> config file parsers to use python's json module.
> 
> That one is a bit more strict about JSON than our own, and JSON is a little bit
> different than straight python format (which these used to use); it wants
> true/false instead of True and False, strings must be quoted with double quotes
> instead of single quotes, and lists and dicts may not have a comma after their
> last element.
> 
> Now I've updated all files in the tree, but there is another one; the stored
> configuration. If you update and get a JSON error, the easiest workaround is to
> remove the b10-config.db file (and lose your config). A less easy one is to edit
> it and change the specific contents as described above.
> 
> I can add backwards compatibility though, which we should definitley have if we
> later make a change like this. But at this point I'm not so sure about it, and
> I've decided against it (do we want backwards compatibility for
> development-releases?). If the rest disagrees, I'll add it :)
> 
> Jelte
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
> 
> iEYEARECAAYFAkxH/AgACgkQ4nZCKsdOncWfrgCg2NNXeAlwJ/IhaiBIahQSLlAt
> fNgAoKW6FVZO2/QnL6JU/zDFzlmXebxV
> =B8Sr
> -----END PGP SIGNATURE-----
> _______________________________________________
> bind10-dev mailing list
> bind10-dev at lists.isc.org
> https://lists.isc.org/mailman/listinfo/bind10-dev
> 



More information about the bind10-dev mailing list