Using collabora with nomad

We try to run collabora with nomad but we can’t get the container get running at all, as no new childs are spawn. We use the docker engine with nomad. If we use the same configuration directly on the docker engine with an compose file it works just fine.

job "collabora" {
  type       = "service"

  group "collabora" {
    count = 1

    network {
      port "office" {
        to = 9980
      }
    }
    task "collabora" {
      driver = "docker"
      config {
        image = "collabora/code"
        ports = ["office"]
      }

      service {
        name = "svc-nextcloud-01-oc-service"
        port = "office"
        provider = "nomad"
      }
    }
  }
}
frk-00028-00028 2024-11-05 16:11:06.503361 +0000 [ coolforkit-caps ] DBG  About to init Kit UnitBase with test []| kit/ForKit.cpp:766
frk-00028-00028 2024-11-05 16:11:06.503383 +0000 [ coolforkit-caps ] INF  Have capability cap_sys_chroot| kit/ForKit.cpp:242
frk-00028-00028 2024-11-05 16:11:06.503389 +0000 [ coolforkit-caps ] INF  Have capability cap_fowner| kit/ForKit.cpp:242
frk-00028-00028 2024-11-05 16:11:06.503392 +0000 [ coolforkit-caps ] INF  Have capability cap_chown| kit/ForKit.cpp:242
frk-00028-00028 2024-11-05 16:11:06.503448 +0000 [ coolforkit-caps ] TRC  dlopen(/opt/collaboraoffice/program/libmergedlo.so, RTLD_GLOBAL|RTLD_NOW)| kit/Kit.cpp:3834
Init vcl
preload: xsec_xmlsec xmlsecurity merged ucpchelp1 wpftwriter wpftcalc wpftimpress wpftdraw msforms cached1 vbaswobj swd sw ucppkg1 sm msword slideshow pdfimport sdui sd scriptframe protocolhandler dlgprov solver pricing date vbaobj scd sc ucpdav1 oox dbaxml pcr pdffilter ldapbe2 log embobj migrationoo2 sdd deploymentgui smd dbase animcore t602filter flash flat PresentationMinimizer invocation stocservices chartcore writerfilter io uuresolver bootstrap scn dba calc sdbt chartcontroller reflection cui dbpool2 scfilt introspection mysql_jdbc cairocanvas writer binaryurp LanguageTool bib storagefd namingservice emboleobj svgfilter graphicfilter ucpcmis1 analysis migrationoo3 invocadapt mozbootstrap hwp textconversiondlgs proxyfac
Disabled: cmdmail rptxml rptui rpt dbp dbu abp odbc sdbc2 
Preload textencodings
Allowlisted languages: de_DE en_GB en_US es_ES fr_FR it nl pt_BR pt_PT ru 
Preloading local dictionaries: de-DE en-US fr-FR it-IT nl-NL pt-BR wsd-00001-00001 2024-11-05 16:11:06.499952 +0000 [ coolwsd ] INF  Waiting for a new child for a max of 20000ms| wsd/COOLWSD.cpp:4433
wsd-00001-00001 2024-11-05 16:11:26.500959 +0000 [ coolwsd ] INF  Waiting for a new child for a max of 20000ms| wsd/COOLWSD.cpp:4433
wsd-00001-00001 2024-11-05 16:11:46.504897 +0000 [ coolwsd ] INF  Waiting for a new child for a max of 20000ms| wsd/COOLWSD.cpp:4433
wsd-00001-00001 2024-11-05 16:12:06.505021 +0000 [ coolwsd ] INF  Waiting for a new child for a max of 20000ms| wsd/COOLWSD.cpp:4433
wsd-00001-00027 2024-11-05 16:11:06.500284 +0000 [ prisoner_poll ] TRC  #15: setupPollFds getPollEvents: 0x1| net/Socket.hpp:975
wsd-00001-00027 2024-11-05 16:11:06.500289 +0000 [ prisoner_poll ] TRC  ppoll start, timeoutMicroS: 64000000 size 1| net/Socket.cpp:530
wsd-00001-00027 2024-11-05 16:12:10.564322 +0000 [ prisoner_poll ] TRC  Poll completed with 0 live polls max (64000000us)(timedout)| net/Socket.cpp:548
wsd-00001-00001 2024-11-05 16:12:26.505106 +0000 [ coolwsd ] INF  Waiting for a new child for a max of 20000ms| wsd/COOLWSD.cpp:4433
wsd-00001-00001 2024-11-05 16:12:46.505237 +0000 [ coolwsd ] INF  Waiting for a new child for a max of 20000ms| wsd/COOLWSD.cpp:4433
wsd-00001-00027 2024-11-05 16:12:10.564347 +0000 [ prisoner_poll ] TRC  #15: Handling poll events of prisoner_poll at index 0 (of 1): 0x0| net/Socket.cpp:705
wsd-00001-00027 2024-11-05 16:12:10.564351 +0000 [ prisoner_poll ] TRC  #15: setupPollFds getPollEvents: 0x1| net/Socket.hpp:975
wsd-00001-00027 2024-11-05 16:12:10.564354 +0000 [ prisoner_poll ] TRC  ppoll start, timeoutMicroS: 64000000 size 1| net/Socket.cpp:530
wsd-00001-00027 2024-11-05 16:13:14.627610 +0000 [ prisoner_poll ] TRC  Poll completed with 0 live polls max (64000000us)(timedout)| net/Socket.cpp:548
wsd-00001-00001 2024-11-05 16:13:06.505364 +0000 [ coolwsd ] INF  Waiting for a new child for a max of 20000ms| wsd/COOLWSD.cpp:4433
wsd-00001-00001 2024-11-05 16:13:26.505493 +0000 [ coolwsd ] INF  Waiting for a new child for a max of 20000ms| wsd/COOLWSD.cpp:4433
wsd-00001-00001 2024-11-05 16:13:46.505621 +0000 [ coolwsd ] INF  Waiting for a new child for a max of 20000ms| wsd/COOLWSD.cpp:4433
wsd-00001-00001 2024-11-05 16:14:06.505756 +0000 [ coolwsd ] INF  Waiting for a new child for a max of 20000ms| wsd/COOLWSD.cpp:4433
wsd-00001-00027 2024-11-05 16:13:14.627635 +0000 [ prisoner_poll ] TRC  #15: Handling poll events of prisoner_poll at index 0 (of 1): 0x0| net/Socket.cpp:705
wsd-00001-00027 2024-11-05 16:13:14.627639 +0000 [ prisoner_poll ] TRC  #15: setupPollFds getPollEvents: 0x1| net/Socket.hpp:975
wsd-00001-00027 2024-11-05 16:13:14.627641 +0000 [ prisoner_poll ] TRC  ppoll start, timeoutMicroS: 64000000 size 1| net/Socket.cpp:530
wsd-00001-00027 2024-11-05 16:14:18.690993 +0000 [ prisoner_poll ] TRC  Poll completed with 0 live polls max (64000000us)(timedout)| net/Socket.cpp:548
wsd-00001-00001 2024-11-05 16:14:26.505892 +0000 [ coolwsd ] INF  Waiting for a new child for a max of 20000ms| wsd/COOLWSD.cpp:4433
wsd-00001-00001 2024-11-05 16:14:46.506015 +0000 [ coolwsd ] INF  Waiting for a new child for a max of 20000ms| wsd/COOLWSD.cpp:4433
wsd-00001-00027 2024-11-05 16:14:18.691016 +0000 [ prisoner_poll ] TRC  #15: Handling poll events of prisoner_poll at index 0 (of 1): 0x0| net/Socket.cpp:705
wsd-00001-00027 2024-11-05 16:14:18.691020 +0000 [ prisoner_poll ] TRC  #15: setupPollFds getPollEvents: 0x1| net/Socket.hpp:975
wsd-00001-00027 2024-11-05 16:14:18.691022 +0000 [ prisoner_poll ] TRC  ppoll start, timeoutMicroS: 64000000 size 1| net/Socket.cpp:530
wsd-00001-00027 2024-11-05 16:15:22.754276 +0000 [ prisoner_poll ] TRC  Poll completed with 0 live polls max (64000000us)(timedout)| net/Socket.cpp:548
wsd-00001-00001 2024-11-05 16:15:06.506134 +0000 [ coolwsd ] INF  Waiting for a new child for a max of 20000ms| wsd/COOLWSD.cpp:4433
wsd-00001-00001 2024-11-05 16:15:26.506216 +0000 [ coolwsd ] INF  Waiting for a new child for a max of 20000ms| wsd/COOLWSD.cpp:4433

Hello @blicknix Welcome to collabora online forums.

Can you try following suggestions and let me know if Problem get solves or not? We can then see more logs and find solution together :wink:

  1. Ensure Sufficient Capabilities: Collabora requires specific capabilities (e.g., cap_sys_chroot, cap_fowner, cap_chown). Docker Compose may allow these by default, but with Nomad, you may need to specify them explicitly. You can add the following in the task config under config:

    capabilities = ["SYS_CHROOT", "FOWNER", "CHOWN"]
    
  2. Check Environment Variables: Sometimes, environment variables set in Docker Compose may not be passed in Nomad by default. Ensure you have included required environment variables like DONT_GEN_SSL_CERT, domain, etc., in the Nomad task configuration:

    env {
      DONT_GEN_SSL_CERT = "true"
      domain = "your.domain.com"
    }
    
  3. Review Resource Allocation: Make sure the Nomad configuration allocates enough resources, as Collabora may fail to start if memory or CPU resources are too low. You can adjust this in the task settings, e.g.,

    resources {
      cpu    = 500
      memory = 1024
    }
    
  4. Check Logs for Permissions or Mount Issues: The logs indicate that the child process spawner might be timing out. Ensure there are no permissions issues with any mounted directories (e.g., /tmp or /opt/collaboraoffice), as restrictive mounts or access issues could prevent child processes from starting.

  5. Network Configuration: Nomad’s network configuration may need adjustments. Ensure the network settings allow Collabora to communicate over port 9980.

  6. Enable Debug Logging: Increase the verbosity of Collabora logs to see if you can get more insights into the failure. You can do this by setting COOLWSD_DEBUG_LEVEL=trace in your environment variables.