Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web server will not start #26

Closed
syloktools opened this issue Jan 2, 2018 · 7 comments
Closed

Web server will not start #26

syloktools opened this issue Jan 2, 2018 · 7 comments
Assignees
Labels

Comments

@syloktools
Copy link

When I run server.py it hangs and does nothing.

If I try as sudo I get:
Traceback (most recent call last):
File "./zmq_subscriber.py", line 13, in
configfile = os.path.join(os.environ['DASH_CONFIG'], 'config.cfg')
File "/usr/lib/python3.5/os.py", line 725, in getitem
raise KeyError(key) from None
KeyError: 'DASH_CONFIG'

Using Ubuntu Server 16. Also have to point to a config file when starting redis and have to be in the virtual environment to it to see the .data directory. Instructions do not state this.

@adulau
Copy link
Member

adulau commented Jan 3, 2018

You need to activate the virtualenv as mentioned in the README:

Activate your virtualenv . ./DASHENV/bin/activate

I hope this helps.

@adulau adulau added the support label Jan 3, 2018
@syloktools
Copy link
Author

syloktools commented Jan 5, 2018 via email

@SteveClement
Copy link
Member

Dear @robertnixon2003

You do not need to run it as root. Normal privileges are fine.

Just before running ./server.py do a:

echo $DASH_HOME

What does that return?

More debug? Do this:

export FLASK_DEBUG=1
export FLASK_APP=server.py
flask run --host=0.0.0.0 --port=8001 # <- Be careful here, this exposes it on ALL ip addresses. Ideally if run locally --host=127.0.0.1

Let us know what it gives.

I tried a fresh install and it worked on 16.04

Sincerely,

Steve

@SteveClement SteveClement self-assigned this Jan 6, 2018
@adulau
Copy link
Member

adulau commented Jan 7, 2018

@robertnixon2003 could you run the latest version? @SteveClement did some additional clean-up to make the debugging easier 0fa7140 Thank you

@syloktools
Copy link
Author

I just installed the newest version. Had to run it in debug to get it to show up. It was refusing the connection when attempting to view in a browser on my host machine. That is configure able somewhere I guess.

Getting this error now when after publishing an event to ZMQ in MISP.

(DASHENV) test@ubuntu:~/misp-dashboard$ flask run --host=0.0.0.0 --port=8001 #

  • Serving Flask app "server"
  • Forcing debug mode on
  • Running on http://0.0.0.0:8001/ (Press CTRL+C to quit)
  • Restarting with stat
  • Debugger is active!
  • Debugger PIN: 300-809-022
    Traceback (most recent call last):
    File "./zmq_dispatcher.py", line 281, in
    main(args.sleeptime)
    File "./zmq_dispatcher.py", line 257, in main
    process_log(zmqName, content)
    File "./zmq_dispatcher.py", line 239, in process_log
    dico_action[topic](zmq_name, jsonevent)
    File "./zmq_dispatcher.py", line 85, in handler_dispatcher
    handler_event(zmq_name, jsonObj)
    File "./zmq_dispatcher.py", line 167, in handler_event
    handler_attribute(zmq_name, jsoncopy)
    File "./zmq_dispatcher.py", line 213, in handler_attribute
    geo_helper.getCoordFromIpAndPublish(jsonattr['value'], jsonattr['category'])
    File "/home/test/misp-dashboard/helpers/geo_helper.py", line 106, in getCoordFromIpAndPublish
    self.push_to_redis_geo(self.keyCategRad, coord['lon'], coord['lat'], json.dumps(ordDic))
    File "/home/test/misp-dashboard/helpers/geo_helper.py", line 166, in push_to_redis_geo
    self.serv_redis_db.geoadd(keyname, lon, lat, content)
    File "/home/test/misp-dashboard/DASHENV/lib/python3.5/site-packages/redis/client.py", line 2121, in geoadd
    return self.execute_command('GEOADD', name, *values)
    File "/home/test/misp-dashboard/DASHENV/lib/python3.5/site-packages/redis/client.py", line 668, in execute_command
    return self.parse_response(connection, command_name, **options)
    File "/home/test/misp-dashboard/DASHENV/lib/python3.5/site-packages/redis/client.py", line 680, in parse_response
    response = connection.read_response()
    File "/home/test/misp-dashboard/DASHENV/lib/python3.5/site-packages/redis/connection.py", line 629, in read_response
    raise response
    redis.exceptions.ResponseError: unknown command 'GEOADD'

@syloktools
Copy link
Author

Ubuntu redis package is old for 16.04.03. I had to download it from the source and use that one. All is working now. Also saw in the config file where to change the host to allow remote access.

@yixiangbo
Copy link

亲爱的@ robertnixon2003

您无需以超级用户身份运行它。普通特权是可以的。

在运行./server.py之前,请执行以下操作:

回声$ DASH_HOME

那会返回什么?

更多调试?做这个:

export FLASK_DEBUG = 1
export FLASK_APP = server.py
flask run --host = 0.0.0.0 --port = 8001#<-注意,在所有IP地址上都将其公开。理想情况下,如果在本地运行--host = 127.0.0.1

让我们知道它能带来什么。

我尝试重新安装,但它在16.04上有效

真挚地,

史蒂夫
I have an error when running flask. Can you help me fix it
image

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

No branches or pull requests

4 participants