diff --git a/oslo_messaging/_drivers/amqpdriver.py b/oslo_messaging/_drivers/amqpdriver.py index 44d97a99b..9fcc484e7 100644 --- a/oslo_messaging/_drivers/amqpdriver.py +++ b/oslo_messaging/_drivers/amqpdriver.py @@ -70,7 +70,13 @@ class QManager: # parse start time (in jiffies) since system boot # # https://www.man7.org/linux/man-pages//man5/proc_pid_stat.5.html - with open(f'/proc/{self.pg}/stat') as f: + # + # We fallback to process id here when process group id is 0, as /proc/0 + # does not exist. This is only hit in an edge case with the crun + # container runtime (default for podman), see issue for more details: + # https://github.com/containers/crun/issues/1642 + proc_id = self.pg if self.pg != 0 else os.getpid() + with open(f'/proc/{proc_id}/stat') as f: self.start_time = int(f.read().split()[21]) def get(self): diff --git a/releasenotes/notes/fix-queue-manager-with-podman-36078437037fa198.yaml b/releasenotes/notes/fix-queue-manager-with-podman-36078437037fa198.yaml new file mode 100644 index 000000000..6249d920c --- /dev/null +++ b/releasenotes/notes/fix-queue-manager-with-podman-36078437037fa198.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + Fixes a bug where calling some OpenStack utilites, such as ``nova-manage``, + within podman containers would fail when using Queue Manager. + `LP#2091703 `__