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

HyP3 API Internal Server Error if you specify the same granule twice for a burst job #2015

Open
jtherrmann opened this issue Jan 12, 2024 · 1 comment
Labels
Jira Bug Create a Jira Bug for this issue

Comments

@jtherrmann
Copy link
Contributor

jtherrmann commented Jan 12, 2024

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

Note: The above link is accessible only to members of ASF.


I noticed that if you specify the same granule twice for an InSAR Burst job, HyP3 returns an Internal Server Error, e.g:

{
  "jobs": [
    {
      "job_parameters": {
        "apply_water_mask": false,
        "granules": [
          "S1_000693_IW1_20230620T183239_VV_F644-BURST",
          "S1_000693_IW1_20230620T183239_VV_F644-BURST"
        ],
        "looks": "20x4"
      },
      "job_type": "INSAR_ISCE_BURST",
      "name": "Job Name"
    }
  ],
  "validate_only": true
}

Results in:

<!doctype html>
<html lang=en>
<title>500 Internal Server Error</title>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>

We should determine if this applies to other job types, determine the cause of the error, and instead return a 400 Bad Request.

@jtherrmann jtherrmann added the Jira Bug Create a Jira Bug for this issue label Jan 12, 2024
@asjohnston-asf
Copy link
Member

Traceback suggests the problem is specific to the check_valid_polarizations validator used for INSAR_ISCE_TEST jobs. It assumes two granule metadata results from CMR; when the reference and secondary bursts are identical there's only one metadata entry.

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 176, 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/openapi_core/contrib/flask/decorators.py", line 55, in decorated
    response = self.handle_request(
  File "/var/task/openapi_core/unmarshalling/processors.py", line 43, in handle_request
    return valid_handler(request_unmarshal_result)
  File "/var/task/openapi_core/contrib/flask/handlers.py", line 74, in __call__
    rv = self.view(*self.view_args, **self.view_kwargs)
  File "/var/task/hyp3_api/routes.py", line 117, in jobs_post
    return jsonify(handlers.post_jobs(request.get_json(), g.user))
  File "/var/task/hyp3_api/handlers.py", line 38, in post_jobs
    validate_jobs(body['jobs'])
  File "/var/task/hyp3_api/validation.py", line 131, in validate_jobs
    validator(job_granule_metadata)
  File "/var/task/hyp3_api/validation.py", line 87, in check_valid_polarizations
    ref_polarization, sec_polarization = [granule['name'].split('_')[4] for granule in granule_metadata]
ValueError: not enough values to unpack (expected 2, got 1)

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

2 participants