Skip to content

Installation Issues on xUbuntu 24.04 #224

@Humble-Helper-96

Description

@Humble-Helper-96

I have been running a tak.gov and mediamtx server locally for about a year now. I am not sure exactly how but I stumbled into OpenTAKServer. Thank you for the work in putting all this together.

Today I tried to do an install and ran into a few errors. I was able to work through the errors with the help of....gasp...ChatGPT!

This is running on a Lenovo M715Q Ryzen5 2400GE with a fresh and updated install of xUbuntu 24.04

Here is a Summary Provided by ChatGPT:

OpenTAKServer Install: Issues Encountered & Fixes Applied

Date: 2025-12-23
Host: MMTX02 (xUbuntu 24.04)
Goal: Fresh install of OpenTAKServer stack and cleanup of install-time errors/warnings.

This write-up focuses only on OpenTAKServer-related components (OpenTAKServer service, nginx, RabbitMQ, MediaMTX).
It intentionally excludes unrelated rebuild items (e.g., ZeroTier/No-IP).


What was installed / running

Observed services after install:

  • opentakserver.service
  • nginx.service
  • rabbitmq-server.service
  • mediamtx.service

Issue 1 — opentakserver.service logs: “Failed to add dependency … Invalid argument”

Symptom

systemctl status opentakserver / journal included repeated warnings like:

  • Failed to add dependency on eud_handler, ignoring: Invalid argument
  • Failed to add dependency on eud_handler_ssl, ignoring: Invalid argument
  • Failed to add dependency on cot_parser, ignoring: Invalid argument

Likely cause

The unit file had a dependency line referencing units that systemd did not consider valid unit names (e.g., missing .service suffix or non-existent units). Example pattern:

  • Requires=eud_handler eud_handler_ssl cot_parser

Systemd warns and ignores invalid dependencies.

Fix applied (recommended approach: systemd drop-in override)

Instead of editing the “original” unit (which can be overwritten by reinstall/updates), we created an override to clear invalid dependency lines and set sane ones:

sudo systemctl edit opentakserver

Drop-in content:

[Unit]
Requires=
Wants=
After=

Wants=network-online.target rabbitmq-server.service nginx.service
After=network-online.target rabbitmq-server.service nginx.service

Apply:

sudo systemctl daemon-reload
sudo systemctl restart opentakserver
sudo journalctl -u opentakserver -n 50 --no-pager -l

Result

  • OpenTAKServer continued to run normally.
  • The dependency warnings were eliminated.

Issue 2 — mediamtx.service exited and became inactive/dead

Symptom

mediamtx.service would start and then become inactive (dead) shortly afterward, even though running MediaMTX manually stayed up.

Cause

The original mediamtx.service unit was too minimal and did not define robust service behavior. When the process exited for any reason (even cleanly), systemd would not keep it running.

Fix applied: replace the unit with a stable definition

sudo tee /etc/systemd/system/mediamtx.service >/dev/null <<'EOF'
[Unit]
Description=MediaMTX
After=network.target
Wants=network.target

[Service]
Type=simple
User=takadmin
Group=takadmin
WorkingDirectory=/home/takadmin/ots/mediamtx
ExecStart=/home/takadmin/ots/mediamtx/mediamtx /home/takadmin/ots/mediamtx/mediamtx.yml
Restart=on-failure
RestartSec=2
LimitNOFILE=1048576

[Install]
WantedBy=multi-user.target
EOF

sudo systemctl daemon-reload
sudo systemctl enable --now mediamtx
sudo systemctl status mediamtx --no-pager

Result

  • MediaMTX remained active (running) reliably under systemd.

Issue 3 — MediaMTX warnings: deprecated mediamtx.yml keys

Symptom

MediaMTX logged warnings similar to:

  • parameter 'protocols' is deprecated and has been replaced with 'rtspTransports'
  • parameter 'encryption' is deprecated and has been replaced with 'rtspEncryption'
  • parameter 'serverCert' is deprecated and has been replaced with 'rtspServerCert'
  • parameter 'serverKey' is deprecated and has been replaced with 'rtspServerKey'
  • parameter 'playback' is deprecated and has no effect

Fix applied: rename keys + remove playback (preserving comments/format)

Backup and in-place edit:

cp -a /home/takadmin/ots/mediamtx/mediamtx.yml   /home/takadmin/ots/mediamtx/mediamtx.yml.bak.$(date +%F_%H%M%S)

perl -0777 -i -pe '
s/^(\s*)protocols\s*:/\1rtspTransports:/mg;
s/^(\s*)encryption\s*:/\1rtspEncryption:/mg;
s/^(\s*)serverCert\s*:/\1rtspServerCert:/mg;
s/^(\s*)serverKey\s*:/\1rtspServerKey:/mg;
s/^\s*playback\s*:.*\n//mg;
' /home/takadmin/ots/mediamtx/mediamtx.yml

sudo systemctl restart mediamtx

Verification:

grep -nE '^\s*(protocols|encryption|serverCert|serverKey|playback)\s*:'   /home/takadmin/ots/mediamtx/mediamtx.yml || echo "No deprecated keys found"

sudo journalctl -u mediamtx --since "now-2min" --no-pager -l

Result

  • Current runs no longer emit the deprecation warnings.
  • Note: older warnings can remain visible in journalctl history unless filtering by --since.

Issue 4 — nginx warning: proxy_headers_hash sizing

Symptom

nginx logged warnings like:

  • could not build optimal proxy_headers_hash... increase proxy_headers_hash_max_size or proxy_headers_hash_bucket_size

Cause

Default hash sizing was insufficient for the configured proxy headers set.

Fix applied: add directives inside http { } in /etc/nginx/nginx.conf

Command used to insert settings safely + reload:

sudo cp -a /etc/nginx/nginx.conf /etc/nginx/nginx.conf.bak.$(date +%F_%H%M%S) && sudo awk '
  BEGIN{done=0}
  {
    print
    if (!done && $0 ~ /^[[:space:]]*http[[:space:]]*\{/ ) {
      print "    proxy_headers_hash_max_size 1024;"
      print "    proxy_headers_hash_bucket_size 128;"
      done=1
    }
  }
' /etc/nginx/nginx.conf | sudo tee /etc/nginx/nginx.conf >/dev/null && sudo nginx -t && sudo systemctl reload nginx

Verify (and check only recent logs):

sudo grep -n "proxy_headers_hash_" /etc/nginx/nginx.conf
sudo journalctl -u nginx --since "now-5min" --no-pager -l

Result

  • nginx -t passed, nginx reloaded cleanly, no new warnings after the change.

Suggested improvements for the installer / defaults (optional)

If helpful upstream, consider:

  1. OpenTAKServer unit file: ensure Requires= dependencies reference valid unit names (with .service) or remove if optional.
  2. MediaMTX unit file: ship a robust Type=simple + Restart=on-failure unit by default.
  3. MediaMTX config template: update deprecated keys to current names to avoid warning noise.
  4. nginx config: include proxy_headers_hash_* sizing defaults appropriate for the generated proxy headers.

Quick “clean run” checks

systemctl status opentakserver nginx rabbitmq-server mediamtx --no-pager
journalctl -u opentakserver --since "now-10min" --no-pager -l
journalctl -u mediamtx      --since "now-10min" --no-pager -l
journalctl -u nginx         --since "now-10min" --no-pager -l

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions