Skip to content

[17.0] server_environment crash on docker hardened images #268

Description

@madecsmile

server_environment

Describe the bug

On Linux, get_server_environment() in system_info.py unconditionally calls lsb_release -a via _get_output().

_get_output() uses subprocess.Popen(..., shell=True), which requires a shell (/bin/sh). On minimal container images (e.g. Docker Hardened Images / distroless images), /bin/sh is often absent. The call then raises an exception

To Reproduce

17.0.1.1.1 (and likely earlier versions with the same code)

Steps to reproduce the behavior:
Run Odoo with the server_environment module installed on a minimal Linux container image without /bin/sh (e.g. a DHI / distroless image).
Start Odoo or open the server configuration view that loads system info.
Observe a crash when get_server_environment() tries to run lsb_release -a.

Expected behavior
The module should degrade gracefully when lsb_release is unavailable or cannot be executed (same as on non-Linux systems, where lsbinfo = "not lsb compliant" is already used).

Additional context
Docker image hdi python 3.12 debian 12

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions