fpdcc / ccfp-asset-dashboard

CCFP Asset Dashboard
0 stars 1 forks source link

Users unable to delete assets #252

Closed hallj89 closed 1 year ago

hallj89 commented 1 year ago

https://ccfp-asset-dashboard-prod.herokuapp.com/projects/76/

Duplicate assets added accidentally and can't be removed. Delete button doesn't respond, or after refresh gives internal server error then successful delete message while not actually removing anything.

smcalilly commented 1 year ago

from the logs:

2023-08-02T21:42:50.572576+00:00 heroku[router]: at=info method=DELETE path="/local-assets/402" host=ccfp-asset-dashboard-prod.herokuapp.com request_id=e49c009b-f755-4437-b97c-879b32fbd83d fwd="158.120.137.32" dyno=web.1 connect=1ms service=3ms status=301 bytes=267 protocol=https
2023-08-02T21:42:50.569782+00:00 app[web.1]: [2023-08-02 21:42:50 +0000] [16] [DEBUG] DELETE /local-assets/402
2023-08-02T21:42:50.634888+00:00 app[web.1]: [2023-08-02 21:42:50 +0000] [16] [DEBUG] DELETE /local-assets/402/
2023-08-02T21:42:50.000000+00:00 app[postgres.4707]: [GRAY] [722-1]  sql_error_code = 00000 time_ms = "2023-08-02 21:42:50.926 UTC" pid="4" proc_start_time="2023-06-27 19:06:35 UTC" session_id="649b333b.4" vtid="" tid="0" log_line="870" LOG:  server process (PID 599038) was terminated by signal 11: Segmentation fault
2023-08-02T21:42:50.000000+00:00 app[postgres.4707]: [GRAY] [722-2]  sql_error_code = 00000 time_ms = "2023-08-02 21:42:50.926 UTC" pid="4" proc_start_time="2023-06-27 19:06:35 UTC" session_id="649b333b.4" vtid="" tid="0" log_line="871" DETAIL:  Failed process was running: SELECT "asset_dashboard_commissionerdistrict"."id", "asset_dashboard_commissionerdistrict"."name", "asset_dashboard_commissionerdistrict"."boundary"::bytea FROM "asset_dashboard_commissionerdistrict" WHERE ST_Intersects("asset_dashboard_commissionerdistrict"."boundary",
2023-08-02T21:42:50.000000+00:00 app[postgres.4707]: [GRAY] [722-3]  ST_GeomFromEWKB('\x01070000206b0d0000010000000106000000060000000103000000010000001500000092be9f52ab3531410377be1f2d093d41618b6c1fae353141950c022b2d093d4129022be7ad353141c09543e357093d410f819513cf35314155fed4c858093d41cbc64b1fd0353141848b6cf728093d41002506f119363141c43f35062b093d41585c8fca19363141fd4b37d128093d41d8f1d22525363141fd4b37d128093d41227f6aa42636314157871661fe083d414685eb511f36314157871661fe083d414885eb511f363141883333b3de083d41e2490caa063631417c58394cdf083d416ae17ac40536314157b29ddfff083d41658b6cc7023631416ab29ddfff083d4105a69b54023631418808ac140b093d418c3bdfcfd23531418060e5080a093d41e59f1a8fd335314128fa7e3ad7083d417439b430b13531410a77bec7d6083d41f3f7537baf353141f5c420c81b093d41be9bc498ab3531418c6210b81b093d4192be9f52ab3531410377be1
2023-08-02T21:42:50.000000+00:00 app[postgres.4707]: [GRAY] [723-1]  sql_error_code = 00000 time_ms = "2023-08-02 21:42:50.926 UTC" pid="4" proc_start_time="2023-06-27 19:06:35 UTC" session_id="649b333b.4" vtid="" tid="0" log_line="872" LOG:  terminating any other active server processes
2023-08-02T21:42:50.000000+00:00 app[postgres.1375160]: [GRAY] [724-1]  sql_error_code = 57P02 time_ms = "2023-08-02 21:42:50.926 UTC" pid="598763" proc_start_time="2023-08-02 21:24:02 UTC" session_id="64cac972.922eb" vtid="6/0" tid="0" log_line="3" database="d4eldtmpsish87" connection_source="[local]" user="ufo4m4ajhhkrku" application_name="Heroku Postgres - Automation - 52.73.131.14:62122" WARNING:  terminating connection because of crash of another server process
2023-08-02T21:42:50.000000+00:00 app[postgres.1375160]: [GRAY] [724-2]  sql_error_code = 57P02 time_ms = "2023-08-02 21:42:50.926 UTC" pid="598763" proc_start_time="2023-08-02 21:24:02 UTC" session_id="64cac972.922eb" vtid="6/0" tid="0" log_line="4" database="d4eldtmpsish87" connection_source="[local]" user="ufo4m4ajhhkrku" application_name="Heroku Postgres - Automation - 52.73.131.14:62122" DETAIL:  The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory.
2023-08-02T21:42:50.000000+00:00 app[postgres.1375160]: [GRAY] [724-3]  sql_error_code = 57P02 time_ms = "2023-08-02 21:42:50.926 UTC" pid="598763" proc_start_time="2023-08-02 21:24:02 UTC" session_id="64cac972.922eb" vtid="6/0" tid="0" log_line="5" database="d4eldtmpsish87" connection_source="[local]" user="ufo4m4ajhhkrku" application_name="Heroku Postgres - Automation - 52.73.131.14:62122" HINT:  In a moment you should be able to reconnect to the database and repeat your command.
2023-08-02T21:42:51.044867+00:00 heroku[router]: at=info method=DELETE path="/local-assets/402/" host=ccfp-asset-dashboard-prod.herokuapp.com request_id=80122293-f955-4324-a068-08e910d1aea1 fwd="158.120.137.32" dyno=web.1 connect=1ms service=410ms status=500 bytes=3784 protocol=https
2023-08-02T21:42:51.044123+00:00 app[web.1]: Internal Server Error: /local-assets/402/
2023-08-02T21:42:51.044142+00:00 app[web.1]: Traceback (most recent call last):
2023-08-02T21:42:51.044143+00:00 app[web.1]: File "/usr/local/lib/python3.8/site-packages/django/db/backends/utils.py", line 84, in _execute
2023-08-02T21:42:51.044143+00:00 app[web.1]: return self.cursor.execute(sql, params)
2023-08-02T21:42:51.044147+00:00 app[web.1]: psycopg2.OperationalError: SSL SYSCALL error: EOF detected

it's the segmentation fault again.

smcalilly commented 1 year ago

This is the same problem we had in #224

The GEOS version in Heroku's postgres version creates the segmentation fault (at least this is the working theory, see https://trac.osgeo.org/postgis/ticket/4894).

@fgregg you mentioned this https://github.com/heroku/heroku-geo-buildpack as a potential fix (re this comment). We set it aside because we're going to move to CCFP's servers, but I'm not sure where that's at with their staff changes. Should we go ahead and try that buildpack?

fgregg commented 1 year ago

yes, i think the webpack makes sense.

smcalilly commented 1 year ago

i tried the buildpack but that didn't work. i can't find any other way to upgrade geos — we have no apparent way to upgrade the postgres servers dependencies. i opened a support ticket with heroku to do it: https://help.heroku.com/tickets/1282669

that ticket also has more information about what i've tried to fix this.

smcalilly commented 1 year ago

I'm going to setup a very cheap Postgres instance on AWS RDS to see if this will work as the primary database for the app. It must have postgis with a GEOS > 3.8.0-CAPI-1.13.1.