Skip to content

dataset info (/info/datastack/<datastack>) fails if NeuroglancerJsonServer is down #36

@perlman

Description

@perlman

Access to datastack details fails when nglstate is not responding. A better behavior would be to simply not generate the links. 🙃

DEBUG:urllib3.connectionpool:https://<global>:443 "GET /info/api/v2/datastack/full/<datastack> HTTP/1.1" 200 928
DEBUG:urllib3.connectionpool:https://<local>:443 "GET /segmentation/api/versions HTTP/1.1" 200 36
DEBUG:urllib3.connectionpool:https://<local>:443 "GET /segmentation/table/<datastack>/info HTTP/1.1" 200 976
DEBUG:urllib3.connectionpool:https://<global>:443 "POST /nglstate/api/v1/post HTTP/1.1" 502 157
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 2213, in __call__
    return self.wsgi_app(environ, start_response)
  File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 2193, in wsgi_app
    response = self.handle_exception(e)
  File "/usr/local/lib/python3.9/site-packages/flask_restx/api.py", line 672, in error_router
10.48.0.14 - - [08/Jan/2026:04:44:45 +0000] "GET /info/datastack/<datastack> HTTP/1.1" 502 559 "https://<global>/info/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36" ""
    return original_handler(e)
  File "/usr/local/lib/python3.9/site-packages/flask_cors/extension.py", line 176, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 2190, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1486, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.9/site-packages/flask_restx/api.py", line 672, in error_router
    return original_handler(e)
  File "/usr/local/lib/python3.9/site-packages/flask_cors/extension.py", line 176, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1484, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1469, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
  File "/usr/local/lib/python3.9/site-packages/middle_auth_client/decorators.py", line 376, in decorated_function
    return f(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/middle_auth_client/decorators.py", line 532, in decorated_function
    return f(*args, **kwargs)
  File "/app/./annotationinfoservice/datasets/views.py", line 174, in datastack_view
    state_id = client.state.upload_state_json(spelunker_state)
  File "/usr/local/lib/python3.9/site-packages/caveclient/jsonservice.py", line 168, in upload_state_json
    handle_response(response, as_json=False)
  File "/usr/local/lib/python3.9/site-packages/caveclient/base.py", line 81, in handle_response
    _raise_for_status(response, log_warning=log_warning)
  File "/usr/local/lib/python3.9/site-packages/caveclient/base.py", line 72, in _raise_for_status
    raise requests.HTTPError(http_error_msg, response=r)
requests.exceptions.HTTPError: 502 Server Error: Bad Gateway for url: https://<global>/nglstate/api/v1/post content:b'<html>\r\n<head><title>502 Bad Gateway</title></head>\r\n<body>\r\n<center><h1>502 Bad Gateway</h1></center>\r\n<hr><center>nginx/1.23.2</center>\r\n</body>\r\n</html>\r\n'
2026/01/08 04:44:45 [error] 14#14: *8676 upstream prematurely closed connection while reading response header from upstream, client: 10.48.0.14, server: , request: "GET /info/datastack/<datastack> HTTP/1.1", upstream: "uwsgi://unix:///tmp/uwsgi.sock:", host: "<global>", referrer: "https://<global>/info/"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions