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

Update HiTIDE to internally request calls to use POST instead of GET to avoid 413 error #58

Open
jamesfwood opened this issue Mar 13, 2024 · 6 comments
Assignees

Comments

@jamesfwood
Copy link

From Stepheny:
While testing the data subscriber harmony integration, I ran into a “413 request entity too large” error when submitting too many granule ID’s in my GET request to Harmony. I asked the Harmony team about this and they suggested I use a POST request instead of a GET request, which won’t have that issue and is what EDSC uses when submitting Harmony jobs. I figured I’d let you know, as this should impact HiTIDE as well if a user selects a large number of granules

@jamesfwood
Copy link
Author

@davidcolemanjpl Please test this in UAT. You may need to do a large # of granules download to really test it.
Thanks!

@davidcolemanjpl
Copy link

Harmony UAT v0.0.1043
l2ss-py v2.10.0rc8

SWOT collection Under test:
SWOT_L2_LR_SSH_BASIC_2.0: (C1261072645-POCLOUD)

TEST FAILED


Harmony API Requests:

GET API Request: (3 granules): FAILED
https://harmony.uat.earthdata.nasa.gov/C1261072645-POCLOUD/ogc-api-coverages/1.0.0/collections/all/coverage/rangeset?forceAsync=true&subset=lat(34.84931:35.83342)&subset=lon(-125.57812:-124.73438)&subset=time("2023-11-15T18:00:00%2B00:00":"2023-11-18T07:00:00%2B00:00")&skipPreview=true
job status: https://harmony.uat.earthdata.nasa.gov/jobs/d5a20dc9-0a9c-473c-a68b-d97edb48fd55

POST API Request:
Did not work: FAILED
{
"code": "harmony.ServerError",
"description": "Error: Internal server error"
}


CURL requests:

CURL GET request:
(11 granules) - FAILED
% curl --location --request GET 'https://harmony.uat.earthdata.nasa.gov/C1261072645-POCLOUD/ogc-api-coverages/1.0.0/collections/all/coverage/rangeset?forceAsync=true&subset=lat(34.84931:35.83342)&subset=lon(-125.57812:-124.73438)&subset=time("2023-01-01T18:00:00%2B00:00":"2024-12-21T07:00:00%2B00:00")&skipPreview=true' --header "Authorization: Bearer [Token]"
See Job status: https://harmony.uat.earthdata.nasa.gov/jobs/5bb13edc-de78-495b-bff3-0ef895be6a6f

curl POST cli request: FAILED
curl --location --request POST 'https://harmony.uat.earthdata.nasa.gov/C1261072645-POCLOUD/ogc-api-coverages/1.0.0/collections/all/coverage/rangeset?forceAsync=true&subset=lat(34.84931:35.83342)&subset=lon(-125.57812:-124.73438)&subset=time("2023-01-01T18:00:00%2B00:00":"2024-12-21T07:00:00%2B00:00")&skipPreview=true' --header "Authorization: Bearer [Token]"
{"code":"harmony.ServerError","description":"Error: Internal server error"}


Other CURL commands utilized:

CURL GET request: FAILED
curl --location --request GET 'https://harmony.uat.earthdata.nasa.gov/C1261072645-POCLOUD/ogc-api-coverages/1.0.0/collections/all/coverage/rangeset?subset=lat(-30:20)&subset=lon(120:160)&subset=time("2023-05-01T00:00:00":"2024-12-21T23:59:59.999999")&maxResults=10'
--header "Authorization: Bearer $TOKEN"
--form 'granuleId="G1261389668-POCLOUD"'
--form 'granuleId="G1261389667-POCLOUD"'
--form 'granuleId="G1261389658-POCLOUD"'
--form 'granuleId="G1261389660-POCLOUD"'

Results:
error - 1

CURL using POST : FAILED
curl --location --request POST 'https://harmony.uat.earthdata.nasa.gov/C1261072645-POCLOUD/ogc-api-coverages/1.0.0/collections/all/coverage/rangeset?subset=lat(-30:20)&subset=lon(120:160)&subset=time("2023-05-01T00:00:00":"2024-12-21T23:59:59.999999")&maxResults=10'
--header "Authorization: Bearer $TOKEN"
--form 'granuleId="G1261389668-POCLOUD"'
--form 'granuleId="G1261389667-POCLOUD"'
--form 'granuleId="G1261389658-POCLOUD"'
--form 'granuleId="G1261389660-POCLOUD"'

Results:
{"code":"harmony.NotFoundError","description":"Error: The requested POST page was not found."}

@davidcolemanjpl
Copy link

davidcolemanjpl commented Jun 12, 2024

Test in Harmony OPS v0.0.1043: (6/12/24)
l2ss-py v2.10.0
concise:0.9.0

SWOT_L2_LR_SSH_BASIC_2.0 (C2799465428-POCLOUD)

API Requests:

  • API request using GET: (13 granules) - 3 of 13 steps failed (Partial PASS)

Job complete_with_errors

https://harmony.earthdata.nasa.gov/C2799465428-POCLOUD/ogc-api-coverages/1.0.0/collections/all/coverage/rangeset?forceAsync=true&subset=lat(34.84931:35.83342)&subset=lon(-125.57812:-124.73438)&subset=time("2024-01-01T18:00:00%2B00:00":"2024-02-21T07:00:00%2B00:00")&skipPreview=true
job status: https://harmony.earthdata.nasa.gov/jobs/cca03178-d520-472f-9097-03d5eecfd26b

  • API Request using POST: Did not work: FAILED

{
"code": "harmony.ServerError",
"description": "Error: Internal server error"
}



  • CURL Request using GET : FAILED

% curl --location --request GET 'https://harmony.earthdata.nasa.gov/C2799465428-POCLOUD/ogc-api-coverages/1.0.0/collections/all/coverage/rangeset?subset=lat(-30:20)&subset=lon(120:160)&subset=time("2023-05-01T00:00:00":"2024-12-21T23:59:59.999999")&maxResults=10'
--header "Authorization: Bearer $TOKEN"
--form 'granuleId="G2808365105-POCLOUD"'
--form 'granuleId="G2808365200-POCLOUD"'
--form 'granuleId="G2808366177-POCLOUD"'
--form 'granuleId="G2808366383-POCLOUD"'

Actual output Results:
curl fails uning GET-OPS-1

  • CURL Request using POST: PASSes 'awkwardly' in Harmony (OPS): (4 granules)

Actual output Results: (??)
{"code":"harmony.NotFoundError","description":"Error: The requested POST page was not found."}

see Harmony job statuses: https://harmony.earthdata.nasa.gov/jobs/f2ce8f65-1fb6-49ff-ab83-29cde1a5e061 or
https://harmony.earthdata.nasa.gov/jobs/5dede13d-91f2-4cae-b28e-bb299726c66a

@jamesfwood jamesfwood changed the title Update Harmony request calls to use POST instead of GET to avoid 413 error Update HiTIDE to internally request calls to use POST instead of GET to avoid 413 error Jun 17, 2024
@jamesfwood
Copy link
Author

@jbyrne6 Please update this with a test case for David. Specifically for testing HiTIDE with a large number of granules to exercise the POST. Maybe you could even define a test case in OPS that is failing (error 413) and David can test it in UAT and it should work.

@davidcolemanjpl
Copy link

HiTIDE-UI (UAT) v4.17.2-RC.9
concise:0.9.0rc5
HiTIDE Profile- v4.10.1-rc.13
l2ss-py:2.10.0rc8
podaac-app-services-uat-1858
Harmony UAT UI - v 0.0.1051

Used front-end UI to validate this POST functionality (in lieu of curl and/or API requests).
Verified that POST was utilized accordingly when sub-setting granules via HiTIDE UI.
Viewed the POST output details in the respective service-hitide-profile-uat-fargate cloud-watch log stream

UI Console Submit Output(POST):
submitinconsole-ui-header-1

  • Side Observation 1:

It appears that log stream 'submit' message output contents are null (when comparing to the service-hitide-profile-uat-fargate-worker to the ops-fargate-worker log streams.) Harmony subset request details NOT listed in log output as expected. Also, observed Harmony related errors in log stream output.

see log stream: service-hitide-profile-uat-fargate-worker/service-hitide-profile-uat-fargate-task/217d6d868d3f43fca44614f3f06b07b2

service-hitide-profile-uat-fargate-worker -UAT-message contents-null-1

errors observed in log stream:
Harmony errors in log-output-1

See Harmony-OPS-service-hitide-profile-ops-fargate-worker-SUBMIT-1 (that includes 'Harmony subset request details'):

Harmony-OPS-service-hitide-profile-ops-fargate-worker-SUBMIT-1

Log stream: service-hitide-profile-ops-fargate-worker/service-hitide-profile-ops-fargate-task/a1af291c5ed74a87b0f69e5a868d20d2

  • Side Observation 2:

Server Error displays in HiTIDE-UI if/when many granules are submitted for subsetting (UAT and OPS issue).
See PODAAC-6301

@jamesfwood
Copy link
Author

@jbyrne6 Where are we with this one?

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

No branches or pull requests

3 participants