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 SRAT Catchment API Endpoint #3129

merged 1 commit into from Aug 5, 2019

Update SRAT Catchment API Endpoint #3129

merged 1 commit into from Aug 5, 2019


Copy link

rajadain commented Jul 24, 2019


Updates endpoint URL for the SRAT Catchment API, as instructed by Scott Haag.

Also updates the URL and the KEY in deployment configuration in the fileshare and on civicci.

Connects #3128




Currently the new API is failing with this message:

[2019-07-24 13:37:04,793: ERROR/ForkPoolWorker-1] Task f2aa3aa0-d6be-4014-8359-8b143062f843 run from job 29 raised exception: SRAT Catchment API returned malformed result: u'tploadrate_conc'
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/celery/app/", line 374, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/celery/app/", line 629, in __protected_call__
    return*args, **kwargs)
  File "/opt/app/apps/modeling/", line 407, in run_srat
    raise Exception('SRAT Catchment API returned malformed result: %s' % e)
Exception: SRAT Catchment API returned malformed result: u'tploadrate_conc'

Because the key that should be tploadrate_conc is reported as tploadate_conc. We are trying to get this fixed on the SRAT end.

This has been fixed in the API and it is now working correctly.

Testing Instructions

  • Check out this branch
  • vagrant ssh in to app and worker and update /etc/mmw.d/env/MMW_SRAT_CATCHMENT_API_URL and /etc/mmw.d/env/MMW_SRAT_CATCHMENT_API_KEY with values from civicci's /var/lib/jenkins/.aws/staging.yml
  • Restart mmw-app and celeryd services
  • Go to :8000/ and select a HUC-10 or HUC-8 boundary
  • Create a MapShed Model with the shape
  • Go to Water Quality tab and view subbasin results
    • Ensure they come through


  • All JavaScript tests pass ./scripts/
@rajadain rajadain force-pushed the tt/update-srat-endpoint branch from 1d5f3e5 to 05b85ae Aug 1, 2019
@rajadain rajadain marked this pull request as ready for review Aug 1, 2019
@rajadain rajadain added the NSF label Aug 2, 2019
@rajadain rajadain requested a review from caseycesari Aug 2, 2019
Copy link

caseycesari left a comment

Looking good!


@caseycesari caseycesari assigned rajadain and unassigned caseycesari Aug 5, 2019

This comment has been minimized.

Copy link
Member Author

rajadain commented Aug 5, 2019

Thanks for taking a look!

@rajadain rajadain merged commit e28ca64 into develop Aug 5, 2019
2 checks passed
2 checks passed
default Build finished.
model-my-watershed-pull-requests Build #4074 succeeded in 10 min
@rajadain rajadain deleted the tt/update-srat-endpoint branch Aug 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.