Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad Request ("conflicting options: hostname and the network mode") #63

Closed
blackthroat opened this issue Mar 1, 2023 · 1 comment
Closed
Assignees
Labels
bug Something isn't working

Comments

@blackthroat
Copy link

2023-02-28 21:35:35 : ERROR : base : Job "Interval container update for unix://var/run/docker.sock (trigger: interval[1:00:00], next run at: 2023-02-28 22:34:12 CST)" raised an exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/docker/api/client.py", line 268, in _raise_for_status
    response.raise_for_status()
  File "/usr/local/lib/python3.10/site-packages/requests/models.py", line 960, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: http+docker://localhost/v1.41/containers/create?name=deluge
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/apscheduler/executors/base.py", line 125, in run_job
    retval = job.func(*job.args, **job.kwargs)
  File "/usr/local/lib/python3.10/site-packages/pyouroboros/dockerclient.py", line 369, in update
    new_container = self.recreate(container, latest_image)
  File "/usr/local/lib/python3.10/site-packages/pyouroboros/dockerclient.py", line 139, in recreate
    created = self.client.api.create_container(**new_config)
  File "/usr/local/lib/python3.10/site-packages/docker/api/container.py", line 428, in create_container
    return self.create_container_from_config(config, name)
  File "/usr/local/lib/python3.10/site-packages/docker/api/container.py", line 439, in create_container_from_config
    return self._result(res, True)
  File "/usr/local/lib/python3.10/site-packages/docker/api/client.py", line 274, in _result
    self._raise_for_status(response)
  File "/usr/local/lib/python3.10/site-packages/docker/api/client.py", line 270, in _raise_for_status
    raise create_api_error_from_http_exception(e)
  File "/usr/local/lib/python3.10/site-packages/docker/errors.py", line 31, in create_api_error_from_http_exception
    raise cls(e, response=response, explanation=explanation)
docker.errors.APIError: 400 Client Error for http+docker://localhost/v1.41/containers/create?name=deluge: Bad Request ("conflicting options: hostname and the network mode")

I'm not setting the hostname Docker compose file:

  deluge:
    container_name: deluge
    image: linuxserver/deluge:latest
    restart: unless-stopped
    network_mode: service:vpn # run on the vpn network
    environment:
      - PUID=1026
      - PGID=100
      - TZ=America/Chicago
    volumes:
      - /volume1/downloads:/downloads
      - /volume1/config/deluge:/config
    depends_on:
      - vpn
    logging:
      driver: gelf
      options:
        gelf-address: "tcp://nas01.lan:12201"

Seems to be related to similar Watchtower issue:
containrrr/watchtower#188
containrrr/watchtower@fde6e73

@gmt2001
Copy link
Owner

gmt2001 commented Mar 1, 2023

Technically we are just copy-pasting the config info that you would get from docker container inspect, but I guess it is returning an auto-generated hostname even though it is an invalid option for the container network mode. Will have to add in a validator to catch this network mode and remove the invalid options explicitly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants