1

Now this is probably a long shot, but I have a question about a certain flask app called NeuroX, https://github.com/fdalvi/NeuroX. It is a flask app for analyzing neural networks. The details are not that important, but you run the app and enter paths to model and text files. When trying to run the app, I get the following error.

builtins.ValueError

ValueError: badly formed hexadecimal UUID string
Traceback (most recent call last)

    File "/home/anaconda3/envs/neurox-env/lib/python3.6/site-packages/flask/app.py", line 2309, in __call__

    return self.wsgi_app(environ, start_response)

    File "/home/anaconda3/envs/neurox-env/lib/python3.6/site-packages/flask/app.py", line 2295, in wsgi_app

    response = self.handle_exception(e)

    File "/home/anaconda3/envs/neurox-env/lib/python3.6/site-packages/flask/app.py", line 1741, in handle_exception

    reraise(exc_type, exc_value, tb)

    File "/home/anaconda3/envs/neurox-env/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise

    raise value

    File "/home/anaconda3/envs/neurox-env/lib/python3.6/site-packages/flask/app.py", line 2292, in wsgi_app

    response = self.full_dispatch_request()

    File "/home/anaconda3/envs/neurox-env/lib/python3.6/site-packages/flask/app.py", line 1815, in full_dispatch_request

    rv = self.handle_user_exception(e)

    File "/home/anaconda3/envs/neurox-env/lib/python3.6/site-packages/flask/app.py", line 1718, in handle_user_exception

    reraise(exc_type, exc_value, tb)

    File "/home/anaconda3/envs/neurox-env/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise

    raise value

    File "/home/anaconda3/envs/neurox-env/lib/python3.6/site-packages/flask/app.py", line 1813, in full_dispatch_request

    rv = self.dispatch_request()

    File "/home/anaconda3/envs/neurox-env/lib/python3.6/site-packages/flask/app.py", line 1799, in dispatch_request

    return self.view_functions[rule.endpoint](**req.view_args)

    File "/home/Desktop/neurox/NeuroX/src/app.py", line 235, in analyze

    project = database.Project.get(database.Project.id == uuid.UUID(project_id))

    File "/home/anaconda3/envs/neurox-env/lib/python3.6/uuid.py", line 140, in __init__

    raise ValueError('badly formed hexadecimal UUID string')

    ValueError: badly formed hexadecimal UUID string

Since I am not expecting anyone to go through this, my question is simply, does anyone have an idea what causes this? Is it because I am running Ubuntu?

thaumoctopus
  • 113
  • 1
  • 13
  • The error is telling you that the passed project id is not valid, as it does not correspond to a valid uuid encoded in hexa. See https://github.com/python/cpython/blob/3a1d50e7e573efb577714146bed5c03b9c95f466/Lib/uuid.py#L168-L169. What is the project id you are passing to `initializeProject `? – Sebastian Kreft Jul 08 '19 at 23:29
  • I have never done web development, so not sure where to look, the function looks like this ```@app.route("/initializeProject", methods=['POST']) def initialize_project(): project_id = request.json['project_id'] if project_id not in sessions: load_session_data(project_id) return jsonify({'success': True}) ``` – thaumoctopus Jul 08 '19 at 23:37
  • But how the original ```project_id``` is passed, I'm not sure. – thaumoctopus Jul 08 '19 at 23:39
  • You must be doing somehow a POST request to that endpoint. Either via a web interface, or via the command line. You can open up the developers console in your browser to see the requests that are being triggered. – Sebastian Kreft Jul 08 '19 at 23:50
  • These is a ```GET``` request with status code ```500 INTERNAL SERVER ERROR```. There is a "request" and "response" header, I am assuming I need to look at the request one? It says text ```Accept: /html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8``` and ```Accept encoding: gzip, deflate``` – thaumoctopus Jul 09 '19 at 00:03
  • 1
    `initializeProject` is a `POST`. See https://github.com/fdalvi/NeuroX/blob/master/src/app.py#L330. You would be better off asking directly to the team who is building the tool. – Sebastian Kreft Jul 09 '19 at 00:05
  • I tried, no answer. But thank you for the help! I know it's quite an ill-posed question. Yeah, no ```POST``` so it seems like the error happens before the initialization. – thaumoctopus Jul 09 '19 at 00:10

0 Answers0