[Solved] ERROR: for plex "host" network_mode is incompatible with port_bindings

Found an issue with YAMS? Post is here! (Not for troubleshooting!)
Post Reply
eradan
Posts: 2
Joined: Sun Nov 12, 2023 2:27 am
Italy

[Solved] ERROR: for plex "host" network_mode is incompatible with port_bindings

Post by eradan »

No VPN, custom media folder. The error is in the log.

Code: Select all

====================================================
                 ___           ___           ___
     ___        /  /\         /__/\         /  /\
    /__/|      /  /::\       |  |::\       /  /:/_
   |  |:|     /  /:/\:\      |  |:|:\     /  /:/ /\
   |  |:|    /  /:/~/::\   __|__|:|\:\   /  /:/ /::\
 __|__|:|   /__/:/ /:/\:\ /__/::::| \:\ /__/:/ /:/\:\
/__/::::\   \  \:\/:/__\/ \  \:\~~\__\/ \  \:\/:/~/:/
   ~\~~\:\   \  \::/       \  \:\        \  \::/ /:/
     \  \:\   \  \:\        \  \:\        \__\/ /:/
      \__\/    \  \:\        \  \:\         /__/:/
                \__\/         \__\/         \__\/
====================================================
Welcome to YAMS (Yet Another Media Server)
Installation process should be really quick
We just need you to answer some questions
We are going to ask for your sudo password in the end
To finish the installation of the CLI
====================================================

Checking prerequisites...
docker exists ✅
docker-compose exists ✅
Where do you want to install the docker-compose file? [/opt/yams]:
What's the user that is going to own the media server files? [eradan]:
Please, input your media directory [/srv/media]: /media
Are you sure your media directory is "/media"? [y/N]: y



Time to choose your media service.
Your media service is responsible for serving your files to your network.
By default, YAMS supports 3 media services:
- jellyfin (recommended, easier)
- emby
- plex (advanced, always online)
Choose your media service [jellyfin]: plex

YAMS is going to install "plex" on port "32400"

Time to set up the VPN.
You can check the supported VPN list here: https://yams.media/advanced/vpn.
Do you want to configure a VPN? [Y/n]: n
Configuring the docker-compose file for the user "eradan" on "/opt/yams"...

Copying docker-compose.example.yaml to /opt/yams/docker-compose.yaml...
docker-compose.example.yaml was copied successfuly! ✅

Copying .env.example to /opt/yams/.env...
.env.example was copied successfuly! ✅

Copying docker-compose.custom.yaml to /opt/yams/docker-compose.custom.yaml...
docker-compose.custom.yaml was copied successfuly! ✅
Everything installed correctly! 🎉
Running the server...
This is going to take a while...
sonarr is up-to-date
watchtower is up-to-date
gluetun is up-to-date
readarr is up-to-date
qbittorrent is up-to-date
prowlarr is up-to-date
lidarr is up-to-date
portainer is up-to-date
bazarr is up-to-date
radarr is up-to-date
Creating plex ...

ERROR: for plex  "host" network_mode is incompatible with port_bindings

ERROR: for plex  "host" network_mode is incompatible with port_bindings
Traceback (most recent call last):
  File "/usr/bin/docker-compose", line 33, in <module>
    sys.exit(load_entry_point('docker-compose==1.29.2', 'console_scripts', 'docker-compose')())
  File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 81, in main
    command_func()
  File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 203, in perform_command
    handler(command, command_options)
  File "/usr/lib/python3/dist-packages/compose/metrics/decorator.py", line 18, in wrapper
    result = fn(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 1186, in up
    to_attach = up(False)
  File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 1166, in up
    return self.project.up(
  File "/usr/lib/python3/dist-packages/compose/project.py", line 697, in up
    results, errors = parallel.parallel_execute(
  File "/usr/lib/python3/dist-packages/compose/parallel.py", line 108, in parallel_execute
    raise error_to_reraise
  File "/usr/lib/python3/dist-packages/compose/parallel.py", line 206, in producer
    result = func(obj)
  File "/usr/lib/python3/dist-packages/compose/project.py", line 679, in do
    return service.execute_convergence_plan(
  File "/usr/lib/python3/dist-packages/compose/service.py", line 559, in execute_convergence_plan
    return self._execute_convergence_create(
  File "/usr/lib/python3/dist-packages/compose/service.py", line 473, in _execute_convergence_create
    containers, errors = parallel_execute(
  File "/usr/lib/python3/dist-packages/compose/parallel.py", line 108, in parallel_execute
    raise error_to_reraise
  File "/usr/lib/python3/dist-packages/compose/parallel.py", line 206, in producer
    result = func(obj)
  File "/usr/lib/python3/dist-packages/compose/service.py", line 478, in <lambda>
    lambda service_name: create_and_start(self, service_name.number),
  File "/usr/lib/python3/dist-packages/compose/service.py", line 457, in create_and_start
    container = service.create_container(number=n, quiet=True)
  File "/usr/lib/python3/dist-packages/compose/service.py", line 330, in create_container
    container_options = self._get_container_create_options(
  File "/usr/lib/python3/dist-packages/compose/service.py", line 939, in _get_container_create_options
    container_options['host_config'] = self._get_container_host_config(
  File "/usr/lib/python3/dist-packages/compose/service.py", line 1014, in _get_container_host_config
    return self.client.create_host_config(
  File "/usr/lib/python3/dist-packages/docker/api/container.py", line 596, in create_host_config
    return HostConfig(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/docker/types/containers.py", line 336, in __init__
    raise host_config_incompatible_error(
docker.errors.InvalidArgument: "host" network_mode is incompatible with port_bindings
User avatar
rogs
Site Admin
Posts: 131
Joined: Mon Oct 23, 2023 12:53 pm
Location: Montevideo, Uruguay
Gender:
Contact:
Uruguay

Re: ERROR: for plex "host" network_mode is incompatible with port_bindings

Post by rogs »

Hi @eradan!

Thank you for the report, I'm looking into this right now. I might know what's happening: Before, if you left the ports with the "network_mode" configuration, docker would ignore the port. It looks like now removing it it's required. I'll let you know my testing results!

YAMS Creator

E: roger (at) rogs.me. Fuck you, email bots.
W: https://rogs.me
gpg: curl -sL https://rogs.me/rogs.txt | gpg --import
fingerprint: ADDF BCB7 8B86 8D93 FC4E 3224 C7EC E9C6 C36E C2E6


Also, I love cats :mrgreen:

Pirate jet, pirate jet
User avatar
rogs
Site Admin
Posts: 131
Joined: Mon Oct 23, 2023 12:53 pm
Location: Montevideo, Uruguay
Gender:
Contact:
Uruguay

Re: ERROR: for plex "host" network_mode is incompatible with port_bindings

Post by rogs »

Hmmm, I wasn't able to reproduce the issue. It looks like your docker and docker-compose versions aren't compatible with this setting.

You should be seeing this, not the error you are getting:
Image

There are two ways to fix this:

  • First way: Modify the installer
    Before installing YAMS, edit the docker-compose.example.yaml file and remove the following 2 lines:

    Code: Select all

    # Lines 17-18
        ports:
          - 8096:8096

    After removing those two lines, try installing YAMS again. It should work without any issues

  • Second way: Start from zero
    Start from zero and install docker and docker-compose with YAMS

I would recommend you go with the first way, it's the easiest and the less destructive!

I will try and fix this issue completely soon. Here's the Gitlab issue: https://gitlab.com/rogs/yams/-/issues/27

Thank you for the report!

YAMS Creator

E: roger (at) rogs.me. Fuck you, email bots.
W: https://rogs.me
gpg: curl -sL https://rogs.me/rogs.txt | gpg --import
fingerprint: ADDF BCB7 8B86 8D93 FC4E 3224 C7EC E9C6 C36E C2E6


Also, I love cats :mrgreen:

Pirate jet, pirate jet
eradan
Posts: 2
Joined: Sun Nov 12, 2023 2:27 am
Italy

Re: ERROR: for plex "host" network_mode is incompatible with port_bindings

Post by eradan »

This solution works for plex (I tried Emby and it was fine too). Thanks!

User avatar
rogs
Site Admin
Posts: 131
Joined: Mon Oct 23, 2023 12:53 pm
Location: Montevideo, Uruguay
Gender:
Contact:
Uruguay

Re: ERROR: for plex "host" network_mode is incompatible with port_bindings

Post by rogs »

Perfect, that's great to know.

I'll mark the issue as resolved. Thank you for the bug report and for helping me debugging!

YAMS Creator

E: roger (at) rogs.me. Fuck you, email bots.
W: https://rogs.me
gpg: curl -sL https://rogs.me/rogs.txt | gpg --import
fingerprint: ADDF BCB7 8B86 8D93 FC4E 3224 C7EC E9C6 C36E C2E6


Also, I love cats :mrgreen:

Pirate jet, pirate jet
User avatar
rogs
Site Admin
Posts: 131
Joined: Mon Oct 23, 2023 12:53 pm
Location: Montevideo, Uruguay
Gender:
Contact:
Uruguay

Re: [Solved] ERROR: for plex "host" network_mode is incompatible with port_bindings

Post by rogs »

The issue was fixed! You can check everything here: https://gitlab.com/rogs/yams/-/issues/27

Thank you for the report and for helping me fixing this!

YAMS Creator

E: roger (at) rogs.me. Fuck you, email bots.
W: https://rogs.me
gpg: curl -sL https://rogs.me/rogs.txt | gpg --import
fingerprint: ADDF BCB7 8B86 8D93 FC4E 3224 C7EC E9C6 C36E C2E6


Also, I love cats :mrgreen:

Pirate jet, pirate jet
Post Reply