CiscoDevNet / yang-explorer

An open-source Yang Browser and RPC Builder Application
Apache License 2.0
438 stars 177 forks source link

can't login, error: server is not running #69

Open NickZengXL opened 7 years ago

NickZengXL commented 7 years ago

I want to run yang-exploer on my docker toolbox, following these steps:

  1. docker pull robertcsapo/yang-explorer
  2. docker run -d --name yangexploer -p 8088:8088 robertcsapo/yang-explorer Then i can access http://localhost:8088/static/YangExplorer.html, also can create new account. But i can't login with new account, neither with guest/guest. The error is : server is not running
NickZengXL commented 7 years ago

This is my docker info:

docker@default:~$ docker images
REPOSITORY                                              TAG                 IMAGE ID            CREATED             SIZE
robertcsapo/yang-explorer                               latest              241c5a9e8b12        6 weeks ago         2.257 GB

docker@default:~$ docker ps
CONTAINER ID        IMAGE                                 COMMAND                  CREATED             STATUS              PORTS                    NAMES
256d6cc92c08        robertcsapo/yang-explorer             "/bin/sh -c 'bash sta"   3 seconds ago       Up 2 seconds        0.0.0.0:8088->8088/tcp   yangexploer
robertcsapo commented 7 years ago

could you provide a screenshot of "server is not running" and docker logs --tail 20 yangexploer from your docker host?

NickZengXL commented 7 years ago

docker logs:

docker@default:~$ docker logs --tail 20 yangexploer
[05/Jun/2017 09:54:46]"GET /admin/auth/user/3/ HTTP/1.1" 200 14568
[05/Jun/2017 09:54:46]"GET /admin/jsi18n/ HTTP/1.1" 200 2372

Activating virtualenv ..
Starting YangExplorer server ..
Use http://256d6cc92c08:8088/static/YangExplorer.html

[05/Jun/2017 10:04:42]"GET /static/YangExplorer.html HTTP/1.1" 304 0

Activating virtualenv ..
Starting YangExplorer server ..
Use http://256d6cc92c08:8088/static/YangExplorer.html

[05/Jun/2017 10:15:37]"GET /static/YangExplorer.html HTTP/1.1" 304 0

Activating virtualenv ..
Starting YangExplorer server ..
Use http://256d6cc92c08:8088/static/YangExplorer.html

[05/Jun/2017 10:22:19]"GET /static/YangExplorer.html HTTP/1.1" 304 0
docker@default:~$
NickZengXL commented 7 years ago

use account guest/guest:

yangexploer

NickZengXL commented 7 years ago

yangexploer2

NickZengXL commented 7 years ago

change YangExplorer.html and start.sh to run with ip-address, also has same problem:

docker@default:~$ docker logs --tail 30 yangexploer

Activating virtualenv ..
Starting YangExplorer server ..
Use http://8baf4e7cb69f:8088/static/YangExplorer.html

Activating virtualenv ..
Starting YangExplorer server ..
Use http://172.17.0.3:8088/static/YangExplorer.html

[06/Jun/2017 08:16:37]"GET /static/YangExplorer.html HTTP/1.1" 200 6704
docker@default:~$
robertcsapo commented 7 years ago

Are you sure traffic is routed to your container? Because you should se more HTTP requests.

I've followed your steps and it works for me.

Output:

Activating virtualenv ..
Starting YangExplorer server ..
Use http://b6f2bf2bb929:8088/static/YangExplorer.html

[06/Jun/2017 09:15:43]"GET /static/YangExplorer.html HTTP/1.1" 200 6622
[06/Jun/2017 09:15:43]"GET /static/YangExplorer.html HTTP/1.1" 200 6622
[06/Jun/2017 09:15:47]"GET /explorer/session HTTP/1.1" 200 97
[06/Jun/2017 09:15:59]"POST /explorer/login HTTP/1.1" 200 343
[06/Jun/2017 09:15:59]"GET /explorer/userprofiles HTTP/1.1" 200 121
INFO:explorer.views:request_handler: Received Request: (get-collection-list)
INFO:explorer.views:Received admin request modulelist for user guest
[06/Jun/2017 09:15:59]"GET /explorer/netconf?mode=get%2Dcollection%2Dlist HTTP/1.1" 200 83
INFO:explorer.utils.admin:ModuleAdmin.get_modules: returning (5) modules .. exit
[06/Jun/2017 09:15:59]"GET /explorer/modules?node=root HTTP/1.1" 200 205
[06/Jun/2017 09:15:59]"GET /explorer/admin?action=modulelist HTTP/1.1" 200 326
NickZengXL commented 7 years ago

I ran continer yang-explorer in my docker toolbox on Windows 10. Then I can access yang-explorer web with chrome on my Windows 10, using http://docker-vm-ip:8088/static/YangExplorer.html not http://localhost:8088/static/YangExplorer.html Because docker toolbox will create a virtual machine in Vbox, and the network configuration is HOST and NAT mode. So, I can't use localhost to access yang-explorer web.

But then I can't logged in with any account.

================ amendment: I use 8088, not 8080. Here is a typing error.

robertcsapo commented 7 years ago

Your starting this container on port 8088 and not port 8080 Based on your output

docker@default:~$ docker ps
CONTAINER ID        IMAGE                                 COMMAND                  CREATED             STATUS              PORTS                    NAMES
256d6cc92c08        robertcsapo/yang-explorer             "/bin/sh -c 'bash sta"   3 seconds ago       Up 2 seconds        0.0.0.0:8088->8088/tcp   yangexploer

If you can access port 8080. Then it's not in the same Docker Host.

Try if you can reach the container by it's ip-address docker inspect yangexploer | grep -i ipaddress

rustogi commented 7 years ago

@NickZengXL based on your earlier responses, I am assuming that chrome is running natively but docker is running in virtual box, if so can you indicate how many nics do you have in vbox vm. Also assuming you have just 1 Nic and that is doing NAT, you would need to add a port forwarding rule in virtual box so traffic to port 8088 is delivered into the guest.

screen shot 2017-06-07 at 1 17 28 pm

sandstonewater commented 6 years ago

Hi, i have the same issue, i can load the yang-explorer ui on:

http://127.0.0.1:8088/static/YangExplorer.html

However when trying to login it says: "Server is not running"

I built my own docker container for this (docker for mac), and also pulled robertcsapo/yang-explorer but both containers give me the same error message.

On the yang-explorer server, the only messages i see are:

Quit the server with CONTROL-C. [17/Oct/2017 14:13:52]"GET /static/YangExplorer.html HTTP/1.1" 304 0 [17/Oct/2017 14:14:11]"GET /static/YangExplorer.html HTTP/1.1" 304 0 [17/Oct/2017 14:14:34] WARNING [django.request] Not Found: /favicon.ico WARNING:django.request:Not Found: /favicon.ico [17/Oct/2017 14:14:34]"GET /favicon.ico HTTP/1.1" 404 2546 [17/Oct/2017 14:14:34] WARNING [django.request] Not Found: /favicon.ico WARNING:django.request:Not Found: /favicon.ico [17/Oct/2017 14:14:34]"GET /favicon.ico HTTP/1.1" 404 2546 [17/Oct/2017 14:14:34] WARNING [django.request] Not Found: /favicon.ico WARNING:django.request:Not Found: /favicon.ico

Much appreciate your help!

robertcsapo commented 6 years ago

@sandstonewater could you try http://localhost:8088 ? If that doesn't work. Please post full debug

like this

Activating virtualenv ..
Starting YangExplorer server ..
Use http://b7f4fe8eba04:8088/static/YangExplorer.html

Performing system checks...

System check identified no issues (0 silenced).
October 17, 2017 - 06:38:16
Django version 1.8.3, using settings 'server.settings'
Starting development server at http://b7f4fe8eba04:8088/
Quit the server with CONTROL-C.
sandstonewater commented 6 years ago

Hi, thanks for your quick reponse. I tried http://localhost:8088 but still doesnt work, same error message. When the webui loads up, there is always a spinning clock, it never changes to a pointer. Below is the full debug.

root@9f31311605c0:~/yang-explorer# ./start.sh

Starting YangExplorer server .. Use http://172.17.0.2:8088/static/YangExplorer.html

Performing system checks...

System check identified no issues (0 silenced). October 17, 2017 - 20:59:38 Django version 1.8.3, using settings 'server.settings' Starting development server at http://172.17.0.2:8088/ Quit the server with CONTROL-C. [17/Oct/2017 21:00:55]"GET /static/YangExplorer.html HTTP/1.1" 200 6704 [17/Oct/2017 21:00:55]"GET /static/history/history.css HTTP/1.1" 304 0 [17/Oct/2017 21:00:55]"GET /static/swfobject.js HTTP/1.1" 304 0 [17/Oct/2017 21:00:55]"GET /static/history/history.js HTTP/1.1" 304 0 [17/Oct/2017 21:00:55] WARNING [django.request] Not Found: /favicon.ico WARNING:django.request:Not Found: /favicon.ico [17/Oct/2017 21:00:55]"GET /favicon.ico HTTP/1.1" 404 2546 [17/Oct/2017 21:00:56]"GET /static/YangExplorer000800.swf HTTP/1.1" 304 0 [17/Oct/2017 21:00:56] WARNING [django.request] Not Found: /favicon.ico WARNING:django.request:Not Found: /favicon.ico [17/Oct/2017 21:00:56]"GET /favicon.ico HTTP/1.1" 404 2546

robertcsapo commented 6 years ago

@sandstonewater As your receiving HTTP Code 304, could you verify with another browser or clear cache?