dcos/dcos-e2e

OSX: minidcos docker create fails

jkoelker opened this issue · 1 comments

With #1544 create fails on docker for mac when starting the public-agent container:

$ minidcos docker create ./dcos_generate_config.sh --agents 0
Traceback (most recent call last):
  File "/usr/local/Cellar/minidcos/2018.12.01.1/libexec/lib/python3.7/site-packages/docker/api/client.py", line 229, in _raise_for_status
    response.raise_for_status()
  File "/usr/local/Cellar/minidcos/2018.12.01.1/libexec/lib/python3.7/site-packages/requests/models.py", line 940, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: http+docker://localhost/v1.39/containers/e0985d02b57fa02142cc35aedbd36fcf6ec7375058d817d7873eab45fbdeda8f/start

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/minidcos", line 11, in <module>
    load_entry_point('DCOS-E2E==2018.12.1.1', 'console_scripts', 'minidcos')()
  File "/usr/local/Cellar/minidcos/2018.12.01.1/libexec/lib/python3.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/Cellar/minidcos/2018.12.01.1/libexec/lib/python3.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/local/Cellar/minidcos/2018.12.01.1/libexec/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/Cellar/minidcos/2018.12.01.1/libexec/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/Cellar/minidcos/2018.12.01.1/libexec/lib/python3.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/Cellar/minidcos/2018.12.01.1/libexec/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/Cellar/minidcos/2018.12.01.1/libexec/lib/python3.7/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/local/Cellar/minidcos/2018.12.01.1/libexec/lib/python3.7/site-packages/dcos_e2e_cli/dcos_docker/commands/create.py", line 491, in create
    doctor_command=doctor,
  File "/usr/local/Cellar/minidcos/2018.12.01.1/libexec/lib/python3.7/site-packages/dcos_e2e_cli/common/create.py", line 40, in create_cluster
    public_agents=public_agents,
  File "/usr/local/Cellar/minidcos/2018.12.01.1/libexec/lib/python3.7/site-packages/dcos_e2e/cluster.py", line 94, in __init__
    cluster_backend=cluster_backend,
  File "/usr/local/Cellar/minidcos/2018.12.01.1/libexec/lib/python3.7/site-packages/dcos_e2e/backends/_docker/__init__.py", line 455, in __init__
    network=cluster_backend.network,
  File "/usr/local/Cellar/minidcos/2018.12.01.1/libexec/lib/python3.7/site-packages/dcos_e2e/backends/_docker/_containers.py", line 140, in start_dcos_container
    container.start()
  File "/usr/local/Cellar/minidcos/2018.12.01.1/libexec/lib/python3.7/site-packages/docker/models/containers.py", line 374, in start
    return self.client.api.start(self.id, **kwargs)
  File "/usr/local/Cellar/minidcos/2018.12.01.1/libexec/lib/python3.7/site-packages/docker/utils/decorators.py", line 19, in wrapped
    return f(self, resource_id, *args, **kwargs)
  File "/usr/local/Cellar/minidcos/2018.12.01.1/libexec/lib/python3.7/site-packages/docker/api/container.py", line 1066, in start
    self._raise_for_status(res)
  File "/usr/local/Cellar/minidcos/2018.12.01.1/libexec/lib/python3.7/site-packages/docker/api/client.py", line 231, in _raise_for_status
    raise create_api_error_from_http_exception(e)
  File "/usr/local/Cellar/minidcos/2018.12.01.1/libexec/lib/python3.7/site-packages/docker/errors.py", line 31, in create_api_error_from_http_exception
    raise cls(e, response=response, explanation=explanation)
docker.errors.APIError: 500 Server Error: Internal Server Error ("OCI runtime create failed: container_linux.go:348: starting container process caused "process_linux.go:402: container init caused \"invalid argument\"": unknown")

This is due to the VM docker for mac runs does not support hostnames longer than 64 chars and with the cluster name in the the container its pushed over the limit by default.

A workaround is to specify the cluster-id to be no more than 3 characters:

minidcos docker create ./dcos_generate_config.sh --agents 0 --cluster-id def

Thank you @jkoelker - this has been fixed in a recent release, so if you update this issue should go away. We still have an undocumented limit of ~30 characters for the Cluster ID but I will follow up on that.