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

Internal server error if user specifies a valid start token from a different query #1721

Open
jtherrmann opened this issue Jul 19, 2023 · 0 comments
Labels
Jira Bug Create a Jira Bug for this issue

Comments

@jtherrmann
Copy link
Contributor

jtherrmann commented Jul 19, 2023

Jira: https://asfdaac.atlassian.net/browse/TOOL-2079

Per @asjohnston-asf, if given a valid start token from a different query, the /jobs endpoint returns a 500 error:

https://hyp3-api.asf.alaska.edu/jobs?user_id=asjohnston&start_token=eyJqb2JfaWQiOiAiNDI4YTVmNzgtY2NiMi00NTJmLThkNmEtZDQ2NGQ1N2I3NTU2IiwgInVzZXJfaWQiOiAid2FuZ3d4MjAiLCAicmVxdWVzdF90aW1lIjogIjIwMjMtMDYtMDZUMDI6NDY6NDArMDA6MDAifQ%3D%3D

Traceback (most recent call last):
  File "/var/task/flask/app.py", line 2529, in wsgi_app
    response = self.full_dispatch_request()
  File "/var/task/flask/app.py", line 1825, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/var/task/flask_cors/extension.py", line 165, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File "/var/task/flask/app.py", line 1823, in full_dispatch_request
    rv = self.dispatch_request()
  File "/var/task/flask/app.py", line 1799, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
  File "/var/task/flask/views.py", line 107, in view
    return current_app.ensure_sync(self.dispatch_request)(**kwargs)
  File "/var/task/openapi_core/contrib/flask/views.py", line 26, in dispatch_request
    return decorator(super(FlaskOpenAPIView, self).dispatch_request)(
  File "/var/task/openapi_core/validation/decorators.py", line 33, in decorated
    response = self._handle_request_view(
  File "/var/task/openapi_core/contrib/flask/decorators.py", line 31, in _handle_request_view
    return super(FlaskOpenAPIViewDecorator, self)._handle_request_view(
  File "/var/task/openapi_core/validation/decorators.py", line 47, in _handle_request_view
    return view(*args, **kwargs)
  File "/var/task/flask/views.py", line 188, in dispatch_request
    return current_app.ensure_sync(meth)(**kwargs)
  File "/var/task/hyp3_api/routes.py", line 148, in get
    return jsonify(handlers.get_jobs(
  File "/var/task/hyp3_api/handlers.py", line 58, in get_jobs
    jobs, last_evaluated_key = dynamo.jobs.query_jobs(user, start, end, status_code, name, job_type, start_key,
  File "/var/task/dynamo/jobs.py", line 128, in query_jobs
    response = table.query(**params)
  File "/var/task/boto3/resources/factory.py", line 580, in do_action
    response = action(self, *args, **kwargs)
  File "/var/task/boto3/resources/action.py", line 88, in __call__
    response = getattr(parent.meta.client, operation_name)(*args, **params)
  File "/var/task/botocore/client.py", line 530, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/var/task/botocore/client.py", line 964, in _make_api_call
    raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (ValidationException) when calling the Query operation: The provided starting key is outside query boundaries based on provided conditions
@jtherrmann jtherrmann added the Jira Bug Create a Jira Bug for this issue label Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Jira Bug Create a Jira Bug for this issue
Projects
None yet
Development

No branches or pull requests

1 participant