Unable to parse xxx: Error type 'xxx' is not exported by type library

Software environment

  • Operating system: Debian 12
  • Architecture: amd64
  • kernel version: Linux 6.1.140-1
  • libvirt version: 9.0.0
  • Hypervisor and version: qemu 7.2+dfsg-7+deb12u13

Description of problem

Hi, I'm experiencing a rather obscure and difficult-to-pinpoint bug.

Every few months, when updating the configuration of an existing VM on one of our hundreds of KVM hosts via virDomainDefineXMLFlags, it consecutively fails with Unable to parse RNG /usr/share/libvirt/schemas/domain.rng: Error type 'dateTime' is not exported by type library 'http://www.w3.org/2001/XMLSchema-datatypes' or other data types as string or unsignedInt. The XML is definitely correct, as it is generated and verified using our custom tooling. It also happens when trying to save some changes via virsh edit.

I cannot yet confirm whether saving other domain configurations works in this state, but restarting the libvirtd service resolves the issue.

I haven't yet been able to activate debug logging because this issue is quite rare. However, I hope that someone else has encountered this issue before, or that someone will find it on Google and be able to provide information.

I can rule out any library mismatches caused by updates, as we only update the system immediately before restarting it. These systems have an uptime of less than 24 hours most of the time. I have seen one instance after just seven minutes of uptime.

Steps to reproduce

  1. have working libvirtd
  2. ???
  3. try to edit some domain XML via API or virsh edit
  4. Unable to parse RNG /usr/share/libvirt/schemas/domain.rng: Error type 'dateTime' is not exported by type library 'http://www.w3.org/2001/XMLSchema-datatypes'