Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Could not connect to TraCI server using port 56213 #7

Open
KlaasTilman opened this issue Oct 5, 2021 · 3 comments
Open

Could not connect to TraCI server using port 56213 #7

KlaasTilman opened this issue Oct 5, 2021 · 3 comments

Comments

@KlaasTilman
Copy link

Hello!

I am currently trying to run your project via docker. The dockerfile also installs sumo in the environment.

However currently it isn't quite working because it is throwing the following two errors repeatedly:

FXApp::openDisplay: unable to open display :1

/usr/local/lib/python3.6/dist-packages/traci/main.py:175: UserWarning: Could not connect to TraCI server using port "some port x" (TraCI server already finished). Retrying with different port.

Would you know how to fix this issue ?

@suessmann
Copy link
Owner

suessmann commented Oct 5, 2021

Hi Klaas!

SUMo is not a very friendly tool tbh. As your question is not directly connected with the code I wrote, I suggest to try googling something on the topic of SUMo + Docker.

However, my assumption is that there's a problem with closed ports inside your docker container. As far as I remember, SUMo starts a server on your local machine, but it might be not accessible for some Docker-ish reasons. Since I never used SUMo in Docker, I can't really tell you more. My suggestion would be to try pre-configured docker with SUMo (https://github.com/bogaotory/docker-sumo maybe this is what you need).

@KlaasTilman
Copy link
Author

Thanks for the reply! We will further investigate.

@sjoukedv
Copy link

sjoukedv commented Oct 7, 2021

We managed to find a working solution.

Dockerfile

FROM ubuntu:bionic
....
RUN apt-get install -y \
    xserver-xorg-video-dummy \
    x11-apps
.....

docker-compose.yml

services:
  intelligent_traffic_lights:
    build: .
    volumes:
      ....
      - /tmp/.X11-unix/:/tmp/.X11-unix/
    environment:
      - DISPLAY=$DISPLAY

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants