cityofaustin / atd-data-tech

Austin Transportation Data & Technology Services
17 stars 2 forks source link

"Download CR3" Button is not loading #7954

Closed atdservicebot closed 2 years ago

atdservicebot commented 2 years ago

What application are you using?

Vision Zero (Editor)

Describe the problem.

The "Download CR3" Button for the following crash is not loading. I am getting an "Error >>> Failed to load PDF document"

Website Address

https://visionzero.austin.gov/editor/#/crashes/18635010

Internet Browser: Chrome

Requested By Xavier A.

Request ID: DTS21-103145

mateoclarke commented 2 years ago

Two things going on here:

  1. Our download button should be inactive when there isn't a good PDF stored. We should enhance our CR3 PDF retriever to make sure it doesn't have 'mime_type' = 'text/html' or "file_size": 0 in the cr3_file_metadata field so a bad PDF never gets added. We've discussed this and there may be a backlog issue. But we also know CRIS is updating a bulk CR3 download process so we should probably wait on major investment in our tech debt here.

  2. It looks we have a pattern of about 43 crashes with bad PDFs that were imported on 12/6. I went back to this issue as a reference for similar fixes we've done in the past. And from that we have some SQL code to manually purge CR3 file metadata for crashes with bad PDFs. That way, the next time Frank runs the PDF retrieval script (tomorrow), we'll try again to get those PDFs. Running that script now and will follow up to see if they get a better PDF in the next day or two.

Query 1 OK: UPDATE 48, 48 rows affected

mateoclarke commented 2 years ago

After Frank downloaded CR3s for the day, I'm seeing that the reported crash now has a PDF and the diagram and narrative extraction should happen within the next 24 hours.

Here are the 4 remaining crashes with bad PDFs. They are all older and likely do not have a PDF record in CRIS. crash_id crash_date
123 2019-07-17
14683802 2015-10-08
180290542 2018-01-29
16529633 2018-07-20