question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Dashboard] OSError: [Errno 99] error while attempting to bind on address ('::1', 8265, 0, 0): cannot assign requested address

See original GitHub issue

What is the problem?

I am building a Docker image with my branch and am unable to start the dashboard. Node 13.x is installed. The issue appears to be a port conflict. Perhaps there is something already listening on 8265?

$ docker logs -f rl-actor
[ray] Forcing OMP_NUM_THREADS=1 to avoid performance degradation with many workers (issue #6998). You can override this by explicitly setting OMP_NUM_THREADS.
/opt/conda/lib/python3.6/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  from ._conv import register_converters as _register_converters
2020-02-07 15:50:54,893	WARNING services.py:592 -- setpgrp failed, processes may not be cleaned up properly: [Errno 1] Operation not permitted.
2020-02-07 15:50:54,894	INFO resource_spec.py:212 -- Starting Ray with 35.25 GiB memory available for workers and up to 17.64 GiB for objects. You can adjust these settings with ray.init(memory=<bytes>, object_store_memory=<bytes>).
2020-02-07 15:50:55,481	INFO services.py:1093 -- View the Ray dashboard at localhost:8265
2020-02-07 15:50:58,493	WARNING worker.py:1071 -- The dashboard on node c9ba97c06401 failed with the following error:
Traceback (most recent call last):
  File "/opt/conda/lib/python3.6/asyncio/base_events.py", line 1045, in create_server
    sock.bind(sa)
OSError: [Errno 99] Cannot assign requested address

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/ray/python/ray/dashboard/dashboard.py", line 760, in <module>
    dashboard.run()
  File "/ray/python/ray/dashboard/dashboard.py", line 335, in run
    aiohttp.web.run_app(self.app, host=self.host, port=self.port)
  File "/opt/conda/lib/python3.6/site-packages/aiohttp/web.py", line 433, in run_app
    reuse_port=reuse_port))
  File "/opt/conda/lib/python3.6/asyncio/base_events.py", line 468, in run_until_complete
    return future.result()
  File "/opt/conda/lib/python3.6/site-packages/aiohttp/web.py", line 359, in _run_app
    await site.start()
  File "/opt/conda/lib/python3.6/site-packages/aiohttp/web_runner.py", line 104, in start
    reuse_port=self._reuse_port)
  File "/opt/conda/lib/python3.6/asyncio/base_events.py", line 1049, in create_server
    % (sa, err.strerror.lower()))
OSError: [Errno 99] error while attempting to bind on address ('::1', 8265, 0, 0): cannot assign requested address

Reproduction (REQUIRED)

Here is the Dockerfile I’m using, which is based off base-deps:

FROM tensorflow/tensorflow:nightly-gpu-py3
# install ray dependencies
RUN apt-get update \
    && apt-get install -y \
        curl \
        tmux \
        screen \
        rsync \
        apt-transport-https \
        zlib1g-dev \
        libgl1-mesa-dev \
        git \
        wget \
        cmake \
        build-essential \
        curl \
        unzip \
    && apt-get clean \
    && echo 'export PATH=/opt/conda/bin:$PATH' > /etc/profile.d/conda.sh \
    && wget \
        --quiet 'https://repo.continuum.io/archive/Anaconda3-5.2.0-Linux-x86_64.sh' \
        -O /tmp/anaconda.sh \
    && /bin/bash /tmp/anaconda.sh -b -p /opt/conda \
    && rm /tmp/anaconda.sh \
    && /opt/conda/bin/conda install -y \
        libgcc \
    && /opt/conda/bin/conda clean -y --all \
    && /opt/conda/bin/pip install \
        flatbuffers \
        cython==0.29.0 \
        numpy==1.15.4
ENV PATH "/opt/conda/bin:$PATH"
RUN conda remove -y --force wrapt
RUN pip install -U pip
# To avoid the following error on Jenkins:
# AttributeError: 'numpy.ufunc' object has no attribute '__module__'
RUN /opt/conda/bin/pip uninstall -y dask
ENV PATH "/opt/conda/bin:$PATH"
# For Click
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8
RUN pip install gym[atari]==0.10.11 opencv-python-headless lz4 pytest-timeout smart_open torch torchvision
RUN pip install --upgrade bayesian-optimization
RUN pip install --upgrade hyperopt==0.1.2
RUN pip install ConfigSpace==0.4.10
RUN pip install --upgrade sigopt nevergrad scikit-optimize hpbandster lightgbm xgboost tensorboardX
RUN pip install -U mlflow
RUN pip install -U pytest-remotedata>=0.3.1

# install custom ray branch
RUN git clone --single-branch --branch warmstart2 https://github.com/thavlik/ray.git
RUN ray/ci/travis/install-bazel.sh
WORKDIR /ray/python
RUN pip install -U -e . --verbose
RUN python ray/setup-dev.py --yes

# install node and build dashboard
RUN curl -sL https://deb.nodesource.com/setup_13.x | bash -
RUN apt-get install -y nodejs
RUN cd ray/dashboard/client && npm ci && npm run build

# install dependencies for my python project
RUN pip install tqdm==4.41.1 \
    tensorflow-gpu==2.1.0 \
    tensorboard==2.1.0 \
    Keras==2.3.1 \
    absl-py==0.9.0 \
    boto3==1.11.1 \
    psutil==5.6.7 \
    gym==0.15.4 \
    GPUtil==1.4.0 \
    opencv-python==4.1.2.30 \
    lz4==3.0.2 \
    setproctitle==1.1.10 \
    tensorboardX==2.0

Running any tune experiment produces the warning.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:5
  • Comments:19 (9 by maintainers)

github_iconTop GitHub Comments

39reactions
semin-parkcommented, Feb 11, 2020

I had the exact same error. Solved it by adding

ray.init(webui_host='127.0.0.1') at the beginning of the python file.

It seems like hostname ‘::1’ or ‘localhost’ are sometimes not recognized.

5reactions
wuisawesomecommented, Feb 9, 2020

Does adding --webui-host 0.0.0.0 to ray start work to mitigate this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

socket.error:[errno 99] cannot assign requested address and ...
When you bind(), you are associating the socket with a local IP address and a port. So, as long as the address is...
Read more >
[Errno 99] error while attempting to bind on address ('::1', 8080 ...
However, I got the error [Errno 99] error while attempting to bind on address ('::1', 8080, 0, 0): cannot assign requested address.
Read more >
How I fixed Python OSError: [Errno 99] Cannot assign ...
Solution: In my case, the issue was that I was trying to bind the specific IP address 192.168.1.100 but the computer running the...
Read more >
OSError: [Errno 99] Cannot assign requested address - Medium
This error is seen when tornado tries to bind IP/port when Jupyter Enterprise Gateway starts. jupyter-enterprisegateway --ip=hostname.domain.com.
Read more >
MuZero | Kaggle
!python muzero.py chess # The error "OSError: [Errno 99] error while attempting to bind on address ('::1', 8265, 0, 0): cannot assign requested...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found