Error "want to read 4 bytes from Storage, but only 3 remaining" when running example stabilizing_the_ring.py

623 views Asked by At

I am already install flow0.5, sumo 1.1, RLlib and Stable Baseline. I didn't know how to use sumo_binaries folder automatically downloaded with flow, so I installed sumo 1.1 from source.

The example python examples/sumo/sugiyama.py runs well.

But when I try running python examples/stable_baselines/stabilizing_the_ring.py error occurs like

Error: tcpip::Storage::readIsSafe: want to read 4 bytes from Storage, but only 3 remaining
Quitting (on error).
Error during start: Traceback (most recent call last):
  File "/home/elizabeth/0MA/flow/flow/core/kernel/simulation/traci.py", line 159, in start_simulation
    traci_connection.simulationStep()
  File "/home/elizabeth/anaconda3/envs/MultiAgent/lib/python3.6/site-packages/traci/connection.py", line 323, in simulationStep
    result = self._sendExact()
  File "/home/elizabeth/anaconda3/envs/MultiAgent/lib/python3.6/site-packages/traci/connection.py", line 99, in _sendExact
    raise FatalTraCIError("connection closed by SUMO")
traci.exceptions.FatalTraCIError: connection closed by SUMO

I wonder what exactly the problem is. I am not sure if it is because of my sumo version doesn't match traci version. But I don't know how to check the traci version and match them.

Is there anyone meet the same problem? Could you please tell me more info about this issue?

Many thanks!

2

There are 2 answers

0
Elizabeth On

I just figure it out myself.

Sumo don't need to be installed independently when using flow. scripts/setup_sumo_ubuntu1604.sh this line is installing sumo which flow use.

I fixed this by simply change path in bashrc back to sumo_binaries which automatically downloaded under flow folder. If it can't work after adding path to bachrc and source it, try reboot your pc.

Just posting for anyone in need.

Wish you all good luck!

2
jaykobbiejnr On

You can also get this error when you try to run flow experiments from a different environment other than flow, that is if you have multiple versions of SUMO installed.