sclorg / postgresql-container

PostgreSQL container images based on Red Hat Software Collections and intended for OpenShift and general usage. Users can choose between Red Hat Enterprise Linux, Fedora, and CentOS based images.
http://softwarecollections.org
Apache License 2.0
164 stars 216 forks source link

Error when starting CentOS images in podman #482

Closed johankok closed 1 year ago

johankok commented 1 year ago

When using podman to start the postgresql-container images based on CentOS, the container immediately with the error below. When running the images based on Fedora, the error does not occur and the image starts normally.

Output for failing image:

[johan@fedora1 ~]$ podman run -e POSTGRESQL_USER=user -e POSTGRESQL_PASSWORD=pass -e POSTGRESQL_DATABASE=db -p 5432:5432 quay.io/centos7/postgresql-13-centos7
Warning: Can't detect cpu quota from cgroups
Warning: Can't detect cpuset size from cgroups
Traceback (most recent call last):
  File "/usr/bin/cgroup-limits", line 143, in <module>
    "NUMBER_OF_CORES": get_number_of_cores()
  File "/usr/bin/cgroup-limits", line 76, in get_number_of_cores
    return min([l for l in limits if l])
ValueError: min() arg is an empty sequence

When trying to reproduce with all available images I found I reproduce this with all CentOS based images:

The Fedora ones (fedora/postgresql-11 fedora/postgresql-12 fedora/postgresql-13) start without any problem.

I've tried on a AlmaLinux 9 sytem with podman-4.2.0-7.el9_1.x86_64 and on a Fedora 37 system with podman-4.3.1-1.fc37.x86_64.

zmiklank commented 1 year ago

Thank you for creating the issue and for providing the detailed reproducer.

I have created PR, which should fix this issue: https://github.com/sclorg/container-common-scripts/pull/316

Note: the s2i-core, s2i-base and postgresql container images will need to be rebuild in order to propagate this change.

I did not manage to reproduce the error you mentioned when running the container as a root. We, in general, support run of our containers only when triggered by user with root privileges. Also our testsuite covers only this use-case (in addition to running containers in OpenShift).

johankok commented 1 year ago

Closing this issue, thanks for fixing this issue.