orthanc-server/orthanc-builder

image `osimis/orthanc:23.11.1` Startup error

Closed this issue · 3 comments

Based on the project korthweb, using helm chart to deploy orthanc with the image osimis/orthanc:23.11.1,but startup failed, while the default image osimis/orthanc:22.11.3 in chart can run successfully, error message:

/docker-entrypoint.sh: line 24: /etc/hostid: Permission denied
Generating random hostid in /etc/hostid: 3677f410
11

Is the container running as "root" ?. If not, that might explain that the startup script is not allowed to write to this file.

However, you might want to test setting this variable to disable hostid generation (GENERATE_HOST_ID_IF_MISSING=false).
Extract from the release notes:

22.9.1 :  - 2 new environment variables to force the hostid or disable generation of a random one if it is missing.
            DCMTK calls gethostid() when generating DICOM UIDs (used, e.g, in modifications/anonymizations).
            When /etc/hostid is missing, the system tries to generate it from the IP of the system.
            On some system, in particular circumstances, we have observed that the system performs a DNS query
            to get the IP of the system.  This DNS can timeout (after multiple with retries) and, in particular cases,
            we have observed a delay of 40 seconds to generate a single DICOM UID in Orthanc.
            Therefore, if /etc/hostid is missing, we now generate it with a random number (default behaviour).  
            This behaviour can still be deactivated by defining GENERATE_HOST_ID_IF_MISSING=false.  
            The host id can also be forced by defining FORCE_HOST_ID.

Thank you for response.

Yes, the container is running as "root" ,I set the podSecurityContext to runAsUser: 0 and runAsGroup: 0

Based on your reply,I set the variable (GENERATE_HOST_ID_IF_MISSING: false), got error:

ERROR: failed to install libOrthancGdcm.so file: [Errno 1] Operation not permitted: '/usr/share/orthanc/plugins-available/libOrthancGdcm.so' -> '/usr/share/orthanc/plugins/libOrthancGdcm.so'

I set the variables (GENERATE_HOST_ID_IF_MISSING: false and FORCE_HOST_ID: "3677f410",got error:

Forcing hostid in /etc/hostid: 3677f410
/docker-entrypoint.sh: line 19: /etc/hostid: Permission denied

Comment out the container's securityContext configuration in values.yaml, which looks like it worked, with the following comment:

securityContext:
  # capabilities:
  #   drop:
  #   - ALL
  # allowPrivilegeEscalation: false