Closed sentry-io[bot] closed 4 years ago
This recurred with the Metro dashboard. The staging database had a hundred some-odd OCD bills without a corresponding Councilmatic bill.
I believe this is because the dashboard scripts were missing the SHARED_DB
flag – I added this a couple of days ago, and it was brought in yesterday: https://github.com/datamade/la-metro-dashboard/commit/eb372757fc777f9157b9813bfca482dbe1624616. Same issue we had with Chicago in https://github.com/datamade/django-councilmatic/issues/257#issuecomment-556907007.
I checked the production database and confirmed that there were no OCD bills without Councilmatic bills, i.e., this is not a deeper problem with pupa et al. To resolve the existing data issue, I manually added Councilmatic bills to the OCD bills in the Metro staging database that didn’t have them.
sometimes, when an existing ocd bill is saved, there is not an associated councilmatic bill. note that each of these exceptions is associated with an ocd bill that no longer exists.
this begs the question, how is the save method being called on a bill that doesn't exist?
one thing that does not answer the question, but would solve the immediate problem, is to remove this defensive
else
statement:https://github.com/datamade/django-councilmatic/blob/0cde8a0d90835d9918154d832dd1e38cc4596324/councilmatic_core/signals/handlers.py#L64-L65
on the one hand, it's prudent. on the other, we don't do it in any of the other signals. i'd be more comfortable if we understood the deeper cause here, though.
Sentry Issue: SCRAPERS-US-MUNICIPAL-119