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

Land Analysis for Arizona HUCs Not Working on Staging #3209

Closed
rajadain opened this issue Dec 11, 2019 · 2 comments
Closed

Land Analysis for Arizona HUCs Not Working on Staging #3209

rajadain opened this issue Dec 11, 2019 · 2 comments
Assignees
Labels
bug OSI Funding Source: OSI
Milestone

Comments

@rajadain
Copy link
Member

rajadain commented Dec 11, 2019

Cave Creek HUC-10 results in an error on staging:

image

But success on production:

image

This is only seen for the Land Analysis

View details in Rollbar: https://rollbar.com/WikiWatershed/ModelMyWatershed/items/78/

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/celery/app/trace.py", line 374, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/celery/app/trace.py", line 629, in __protected_call__
    return self.run(*args, **kwargs)
  File "apps/geoprocessing_api/tasks.py", line 115, in analyze_nlcd
    raise Exception('[analyze_nlcd] {}'.format(result['error']))
Exception: [analyze_nlcd] Geoprocessing Error.
Details: java.util.NoSuchElementException: key not found: SpatialKey(64,130)
@rajadain rajadain added bug NSF Funding Source: National Science Foundation labels Dec 11, 2019
@rajadain rajadain changed the title Exception: [analyze_nlcd] Geoprocessing Error. Details: java.util.NoSuchElementException: key not found: SpatialKey(68,129) Arizona HUCs Not Working on Staging Dec 11, 2019
@rajadain rajadain changed the title Arizona HUCs Not Working on Staging Land Analysis for Arizona HUCs Not Working on Staging Dec 11, 2019
@rajadain rajadain added OSI Funding Source: OSI and removed NSF Funding Source: National Science Foundation labels Dec 11, 2019
@rajadain
Copy link
Member Author

This is possibly because NLCD analysis results on staging are tied to ARA data as of #3200, which may not have data throughout the Continental United States. Handling cases when that has NODATA should fix this.

@rajadain
Copy link
Member Author

The error is coming from the geoprocessing service. One option may be to update the geoprocessing service to return null instead of erroring out. The concerns with that approach are:

  • Returning an error may be the more "correct" thing to do, as a null may imply that the extent does cover it, but there is no data in that area
  • Updating the geoprocessing service requires its own deployment steps, although no special steps need to be taken during MMW's deployment, which would include the new service automatically
  • Still, touching an otherwise correctly part of the system introduces possibilities of errors

Another approach is to re-ingest the raster so that it has null values for the rest of the country. The concerns with this approach are:

  • Ingests are time-consuming processes
  • We have other datasets that are also limited in extent (Shippensburg Land Predictions, possibly more). Do we apply this only to the ARA raster, and be inconsistent? Or do we apply this to all the rasters to be consistent, and embark a potentially expensive and error prone process.

Another approach is to change the Celery workflow in Python to query for Land and ARA results separately. That way, if one errors out, the other can still complete. If returned correctly, the value can be included in the final result. The concern with this method is:

  • Firing off a request not knowing if it will succeed or fail introduces "expected" errors in the workflow, which is not great design. We should use exceptions as exceptions, not as if clauses
  • Having multiple geoprocessing calls introduces risk of celery_unlock floods in the workers

Whether a request will pass or fail is testable given information at design time and run time, namely the area of interest and the extent of the ARA raster. We can generate a perimeter of the ARA raster (a-la DRB or NHD or PA that already exist) and test the area of interest against it, querying for it only when it is available. Otherwise, the back-end can send an "out of extent" signal which can be used by the front-end to hide that line of information, when it is introduced in #3202.

@rajadain rajadain self-assigned this Dec 23, 2019
rajadain added a commit that referenced this issue Dec 30, 2019
Only run ARA Analysis if within ARA Perimeter

Connects #3209
@rajadain rajadain added this to the 1.27 milestone Jan 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug OSI Funding Source: OSI
Projects
None yet
Development

No branches or pull requests

2 participants