ApolloAuto / apollo

An open autonomous driving platform
Apache License 2.0
24.98k stars 9.66k forks source link

can not connect to http://localhost:8887/ #22

Closed PikachuHy closed 7 years ago

PikachuHy commented 7 years ago

I do as follow

bash docker/scripts/install_docker.sh
docker ps  
bash docker/scripts/dev_start.sh
bash docker/scripts/dev_into.sh
bash scripts/hmi.sh

and then

...
[WARNING] Failed to find device with pattern "ttyUSB*" ...
...
[WARNING] Failed to find device with pattern "ram*" ...
...
...
Start roscore...
HMI ros node service running at localhost:8887
HMI running at http://localhost:8887

but I can not connect to can not connect to http://localhost:8887/

ycool commented 7 years ago

It seems you miss a step: bash apollo.sh build

bash docker/scripts/install_docker.sh docker ps
bash docker/scripts/dev_start.sh bash docker/scripts/dev_into.sh

bash apollo.sh build bash scripts/hmi.sh

s7ev3n commented 7 years ago

@ycool I have the same issue, and I dont miss the "bash apollo.sh build", which says [OK] Build passed! and when I typed bash scripts/hmi.sh, there is no warning, just Start roscore... HMI ros node service running at localhost:8887 HMI running at http://localhost:8887 And I cannot connect to http://localhost:8887/ Thanks in advance!

startcode commented 7 years ago

@s7ev3n can you share your log here by this command: cat data/log/* Thank you.

zhiwango commented 7 years ago

I also have the same problem as @s7ev3n

wangzhi@wang:/apollo$ bash scripts/hmi.sh
Start roscore...
HMI ros node service running at localhost:8887
HMI running at http://localhost:8887
wangzhi@wang:/apollo$ cat data/log/*
Import grpc:No module named gevent.socket
Traceback (most recent call last):
  File "modules/hmi/web/hmi_main.py", line 23, in <module>
    import handlers
  File "/apollo/modules/hmi/web/handlers.py", line 27, in <module>
    import config
  File "/apollo/modules/hmi/web/config.py", line 26, in <module>
    import modules.hmi.proto.config_pb2 as config_pb2
  File "/apollo/bazel-genfiles/modules/hmi/proto/config_pb2.py", line 208, in <module>
    from grpc.beta import implementations as beta_implementations
ImportError: No module named beta
Log file created at: 2017/07/06 13:21:09
Running on machine: wang
Log line format: [IWEF]mmdd hh:mm:ss.uuuuuu threadid file:line] msg
I0706 13:21:09.068434  4349 ros_node_service.cc:63] [INFO] Server listening on 127.0.0.1:8897
Log file created at: 2017/07/06 13:11:53
Running on machine: wang
Log line format: [IWEF]mmdd hh:mm:ss.uuuuuu threadid file:line] msg
I0706 13:11:53.689415  8240 ros_node_service.cc:63] [INFO] Server listening on 127.0.0.1:8897
Log file created at: 2017/07/06 13:21:09
Running on machine: wang
Log line format: [IWEF]mmdd hh:mm:ss.uuuuuu threadid file:line] msg
I0706 13:21:09.068434  4349 ros_node_service.cc:63] [INFO] Server listening on 127.0.0.1:8897
startcode commented 7 years ago

@wz18 @s7ev3n Can you try to install the missing packages with the following commands, and see if it solves the problem

#inside dev docker
 sudo apt-get install python-gevent
 sudo pip install grpcio
 sudo pip install -r modules/tools/py27_requirements.txt

It looks like a bug, and we will fix it soon. Thank you for reporting this problem.

zhiwango commented 7 years ago

@startcode Thank you for your help, it has worked.

startcode commented 7 years ago

The build docker env is updated. Please try the following commands again

bash docker/scripts/dev_start.sh #pull latest build docker env.
bash docker/scripts/dev_into.sh
bash apollo.sh build
bash scripts/hmi.sh

Thank you.

yangyifeng01 commented 7 years ago

oh, I missed bash apollo.sh build too

s7ev3n commented 7 years ago

@startcode I tried to pull the lasted code and run the scripts, and the cat data/log/* shows:

smartcar@in_dev_docker:/apollo$ bash scripts/hmi.sh
Start roscore...
HMI ros node service running at localhost:8887
HMI running at http://localhost:8887
smartcar@in_dev_docker:/apollo$ cat data/log/*
Traceback (most recent call last):
  File "modules/hmi/web/hmi_main.py", line 20, in <module>
    import gflags
ImportError: No module named gflags
Log file created at: 2017/07/06 13:49:43
Running on machine: in_dev_docker
Log line format: [IWEF]mmdd hh:mm:ss.uuuuuu threadid file:line] msg
I0706 13:49:43.709799  4676 ros_node_service.cc:63] [INFO] Server listening on 127.0.0.1:8897
Log file created at: 2017/07/06 13:49:43
Running on machine: in_dev_docker
Log line format: [IWEF]mmdd hh:mm:ss.uuuuuu threadid file:line] msg
I0706 13:49:43.709799  4676 ros_node_service.cc:63] [INFO] Server listening on 127.0.0.1:8897

It seems that it misses gflags, I will try install one.

startcode commented 7 years ago

@s7ev3n can you install python-gflags by the following command and try again?

sudo pip install python-gflags

Thank you.

s7ev3n commented 7 years ago

@startcode I try to install using sudo pip install python-gflags inside in_dev_docker, and it was actually already installed, unfortunately it still reported gflags missing. I am new to docker, is it the sudo pip install python-gflags install in docker container or in local computer?

ycool commented 7 years ago

@s7ev3n can you run the following command to update dev docker image?

$ bash docker/scripts/dev_start.sh #pull latest dev docker image

$ docker images 
# double check the dev docker image version
# apolloauto/apollo   dev-latest              6a0a38d980e3

Thanks.

s7ev3n commented 7 years ago

I updated dev docker image, it give a warning[WARNING] Failed to find device with pattern "ram*" ... . Yes, I am pretty sure the dev docker image ID is 6a0a38d980e3.

startcode commented 7 years ago

@s7ev3n can you show your $PYTHONPATH inside dev docker by command:

echo $PYTHONPATH

Thank you.

s7ev3n commented 7 years ago

@startcode /apollo/bazel-genfiles:/apollo/bazel-apollo/external/ros/lib/python2.7/dist-packages:/apollo/third_party/ros_x86_64/lib/python2.7/dist-packages

startcode commented 7 years ago

Feels like an environment issue. I created one dev docker env from fresh, and the

$PYTHONPATH=/apollo/bazel-genfiles:/apollo/bazel-apollo/external/ros/lib/python2.7/dist-packages

I suggest you try to exit Docker first, run

bash apollo.sh clean #to clean the generated files
rm -rf data third_party/ros third_party/ros_* # clean history ros files

Then run the following commands to start docker -> enter docker -> build

bash docker/scripts/dev_start.sh
bash docker/scripts/dev_into.sh
bash apollo.sh build
bash scripts/hmi.sh
s7ev3n commented 7 years ago

@startcode Thanks so much. However, the problem is still the same, now PYTHONPATH is /apollo/bazel-genfiles:/apollo/bazel-apollo/external/ros/lib/python2.7/dist-packages, and the cat data/log/* still shows ImportError: No module named gflags, and python-gflags is installed.

startcode commented 7 years ago

@s7ev3n Sorry that did not work out. thanks for your patience. We will keep investigating this issue.

qiankunzhu commented 7 years ago

Could you try pip list | grep gflags in the dev docker and show the info? Or you can try clean and build again as the upper said: ./apollo.sh clean, ./apollo.sh build . To get more clear logs, you can remove the logs in data/log/ first. Or stop and start the docker again with: docker stop $(docker ps -q) in host machine(out of docker terminal), and start with the readme guide. Hope to help u.

startcode commented 7 years ago

@s7ev3n If you pull the latest code, you can run the following command to get your environment

bash scripts/env.sh >& env.txt

It will help us a lot if you can share the contents of env.txt. Thank you.

s7ev3n commented 7 years ago

@startcode I installed release, and it successfully opened HMI on localhost:8887! Here is the env.txt:

deepserver
Outside docker
+ uname -a
Linux deepserver 4.4.0-83-generic #106-Ubuntu SMP Mon Jun 26 17:54:43 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
+ docker --version
Docker version 17.05.0-ce, build 89658be
+ docker images
+ grep apollo
apolloauto/apollo   release-latest      ad38ec5a84dd        43 hours ago        3.2GB
apolloauto/apollo   dev-latest          6a0a38d980e3        43 hours ago        9.23GB
+ echo -----------env---------------
-----------env---------------
+ env
LC_PAPER=zh_CN.UTF-8
XDG_VTNR=7
XDG_SESSION_ID=c7
LC_ADDRESS=zh_CN.UTF-8
CLUTTER_IM_MODULE=xim
LC_MONETARY=zh_CN.UTF-8
XDG_GREETER_DATA_DIR=/var/lib/lightdm-data/smartcar
SESSION=ubuntu
GPG_AGENT_INFO=/home/smartcar/.gnupg/S.gpg-agent:0:1
SHELL=/bin/bash
VTE_VERSION=4205
TERM=xterm-256color
QT_LINUX_ACCESSIBILITY_ALWAYS_ON=1
LC_NUMERIC=zh_CN.UTF-8
WINDOWID=79694161
GNOME_KEYRING_CONTROL=
UPSTART_SESSION=unix:abstract=/com/ubuntu/upstart-session/1000/7180
GTK_MODULES=gail:atk-bridge:unity-gtk-module
CUDA_HOME=/usr/local/cuda-8.0
USER=smartcar
LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64:
QT_ACCESSIBILITY=1
LC_TELEPHONE=zh_CN.UTF-8
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:
XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session1
XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
SSH_AUTH_SOCK=/run/user/1000/keyring/ssh
DEFAULTS_PATH=/usr/share/gconf/ubuntu.default.path
XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/usr/share/upstart/xdg:/etc/xdg
PATH=/home/smartcar/anaconda2/bin:/usr/local/cuda-8.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
DESKTOP_SESSION=ubuntu
QT_QPA_PLATFORMTHEME=appmenu-qt5
QT_IM_MODULE=fcitx
LC_IDENTIFICATION=zh_CN.UTF-8
JOB=unity-settings-daemon
PWD=/home/smartcar/wwf/projects/apollo
XDG_SESSION_TYPE=x11
XMODIFIERS=@im=fcitx
LANG=en_US.UTF-8
GNOME_KEYRING_PID=
MANDATORY_PATH=/usr/share/gconf/ubuntu.mandatory.path
GDM_LANG=en_US
LC_MEASUREMENT=zh_CN.UTF-8
IM_CONFIG_PHASE=1
COMPIZ_CONFIG_PROFILE=ubuntu
GDMSESSION=ubuntu
GTK2_MODULES=overlay-scrollbar
SESSIONTYPE=gnome-session
XDG_SEAT=seat0
HOME=/home/smartcar
SHLVL=2
LANGUAGE=en_US
GNOME_DESKTOP_SESSION_ID=this-is-deprecated
UPSTART_INSTANCE=
LOGNAME=smartcar
XDG_SESSION_DESKTOP=ubuntu
UPSTART_EVENTS=xsession started
COMPIZ_BIN_PATH=/usr/bin/
QT4_IM_MODULE=fcitx
XDG_DATA_DIRS=/usr/share/ubuntu:/usr/share/gnome:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-cOdfbeUMJv
APOLLO_HOME=/home/smartcar/wwf/projects/apollo
PKG_CONFIG_PATH=:/usr/local/lib/pkgconfig
LESSOPEN=| /usr/bin/lesspipe %s
UPSTART_JOB=unity7
INSTANCE=
DISPLAY=:0
XDG_RUNTIME_DIR=/run/user/1000
GTK_IM_MODULE=fcitx
XDG_CURRENT_DESKTOP=Unity
LC_TIME=zh_CN.UTF-8
LESSCLOSE=/usr/bin/lesspipe %s %s
XAUTHORITY=/home/smartcar/.Xauthority
LC_NAME=zh_CN.UTF-8
_=/usr/bin/env
startcode commented 7 years ago

@s7ev3n You said " it successfully opened HMI on localhost:8887!", is your problem solved? If so, I will close the issue.

s7ev3n commented 7 years ago

@startcode I uninstall gflags and reinstall it, it passed missing gflag error, but when still couldnt work. I looked into the log, it seems missing many packages, and I install one by one: google.apputils, Flask-RESTful, Flask-SocketIO, glog, and I stuck here:

Import grpc:No module named coros
Traceback (most recent call last):
  File "modules/hmi/web/hmi_main.py", line 23, in <module>
    import handlers
  File "/apollo/modules/hmi/web/handlers.py", line 27, in <module>
    import config
  File "/apollo/modules/hmi/web/config.py", line 26, in <module>
    import modules.hmi.proto.config_pb2 as config_pb2
  File "/apollo/bazel-genfiles/modules/hmi/proto/config_pb2.py", line 208, in <module>
    from grpc.beta import implementations as beta_implementations
ImportError: No module named beta
s7ev3n commented 7 years ago

@startcode I successfully opened HMI on release docker not on dev docker.

startcode commented 7 years ago

@s7ev3n Now you come across the same problem we addressed before in this thread. The following commands may work.

#inside dev docker
 sudo apt-get install python-gevent
 sudo pip install grpcio
 sudo pip install -r modules/tools/py27_requirements.txt
s7ev3n commented 7 years ago

@startcode I tried to install what you said, but the import error is still the same...what is this coros? How can I install it?

s7ev3n commented 7 years ago

I reinstalled grpcio, and it worked! Thanks so much ,you can close this issue now!

startcode commented 7 years ago

@s7ev3n Thank you for your patience, and thanks for your help of improving Apollo.