UCSCLibrary / dams_project_mgmt

DAMS purpose is to provide access to digitized and born-digital UCSC Special Collections content. This repository is used for project planning. It holds the task tickets and roadmap for the different projects under DAMS.
2 stars 0 forks source link

[1] Deleting a failed import isn't working #532

Closed snehagunduraoUL closed 1 year ago

snehagunduraoUL commented 2 years ago

If there is a foreign key constraint, an error message has to be displayed to the user.

Steps to reproduce:

  1. Log in as an admin user
  2. Click on Importers tab
  3. Delete an importer with a Failed status Screen Shot 2022-04-19 at 2 33 27 PM
snehagunduraoUL commented 2 years ago

Logs from sandbox: I, [2022-04-19T14:43:54.670437 #14929] INFO -- : [1ff338c1-82b4-4124-8693-425e2b8495ff] Completed 500 Internal Server Error in 20ms (ActiveRecord: 9.2ms) F, [2022-04-19T14:43:54.672958 #14929] FATAL -- : [1ff338c1-82b4-4124-8693-425e2b8495ff] F, [2022-04-19T14:43:54.673000 #14929] FATAL -- : [1ff338c1-82b4-4124-8693-425e2b8495ff] ActiveRecord::StatementInvalid (Mysql2::Error: Cannot delete or update a parent row: a foreign key constraint fails (sufia.bulkrax_pending_relationships, CONSTRAINT fk_rails_c6af228061 FOREIGN KEY (bulkrax_importer_run_id) REFERENCES bulkrax_importer_runs (id)): DELETE FROM bulkrax_importer_runs WHERE bulkrax_importer_runs.id = 80): F, [2022-04-19T14:43:54.673045 #14929] FATAL -- : [1ff338c1-82b4-4124-8693-425e2b8495ff] F, [2022-04-19T14:43:54.673173 #14929] FATAL -- : [1ff338c1-82b4-4124-8693-425e2b8495ff] mysql2 (0.5.3) lib/mysql2/client.rb:131:in _query' [1ff338c1-82b4-4124-8693-425e2b8495ff] mysql2 (0.5.3) lib/mysql2/client.rb:131:inblock in query' [1ff338c1-82b4-4124-8693-425e2b8495ff] mysql2 (0.5.3) lib/mysql2/client.rb:130:in handle_interrupt' [1ff338c1-82b4-4124-8693-425e2b8495ff] mysql2 (0.5.3) lib/mysql2/client.rb:130:inquery'

bkiahstroud commented 2 years ago

Should be fixed by https://github.com/UCSCLibrary/ucsc-library-digital-collections/pull/281, moving to Sandbox QA

rschwab commented 2 years ago

Hit this again today.

Log output: d1148] Bulkrax::Status Load (2.3ms) SELECTbulkrax_statuses.* FROMbulkrax_statusesWHEREbulkrax_statuses.statusable_id= 163 ANDbulkrax_statuses.statusable_type` = 'Bulkrax::Importer'

D, [2022-06-06T15:21:58.351202 #428] DEBUG -- : [ced9e494-eb0c-4caf-adb1-504a276d1148] Bulkrax::Status Destroy (0.2ms) DELETE FROM bulkrax_statuses WHERE bulkrax_statuses.id = 1957

D, [2022-06-06T15:21:58.351637 #428] DEBUG -- : [ced9e494-eb0c-4caf-adb1-504a276d1148] Bulkrax::Status Destroy (0.2ms) DELETE FROM bulkrax_statuses WHERE bulkrax_statuses.id = 1958

D, [2022-06-06T15:21:58.352397 #428] DEBUG -- : [ced9e494-eb0c-4caf-adb1-504a276d1148] Bulkrax::ImporterRun Load (0.3ms) SELECT bulkrax_importer_runs.* FROM bulkrax_importer_runs WHERE bulkrax_importer_runs.importer_id = 163

D, [2022-06-06T15:21:58.355304 #428] DEBUG -- : [ced9e494-eb0c-4caf-adb1-504a276d1148] Bulkrax::Status Load (2.2ms) SELECT bulkrax_statuses.* FROM bulkrax_statuses WHERE bulkrax_statuses.runnable_id = 173 AND bulkrax_statuses.runnable_type = 'Bulkrax::ImporterRun'

D, [2022-06-06T15:21:58.356224 #428] DEBUG -- : [ced9e494-eb0c-4caf-adb1-504a276d1148] Bulkrax::Status Destroy (0.2ms) DELETE FROM bulkrax_statuses WHERE bulkrax_statuses.id = 1951

D, [2022-06-06T15:21:58.356628 #428] DEBUG -- : [ced9e494-eb0c-4caf-adb1-504a276d1148] Bulkrax::Status Destroy (0.2ms) DELETE FROM bulkrax_statuses WHERE bulkrax_statuses.id = 1952

D, [2022-06-06T15:21:58.357049 #428] DEBUG -- : [ced9e494-eb0c-4caf-adb1-504a276d1148] Bulkrax::Status Destroy (0.2ms) DELETE FROM bulkrax_statuses WHERE bulkrax_statuses.id = 1953

D, [2022-06-06T15:21:58.357430 #428] DEBUG -- : [ced9e494-eb0c-4caf-adb1-504a276d1148] Bulkrax::Status Destroy (0.1ms) DELETE FROM bulkrax_statuses WHERE bulkrax_statuses.id = 1954

D, [2022-06-06T15:21:58.357803 #428] DEBUG -- : [ced9e494-eb0c-4caf-adb1-504a276d1148] Bulkrax::Status Destroy (0.1ms) DELETE FROM bulkrax_statuses WHERE bulkrax_statuses.id = 1955

D, [2022-06-06T15:21:58.358185 #428] DEBUG -- : [ced9e494-eb0c-4caf-adb1-504a276d1148] Bulkrax::Status Destroy (0.1ms) DELETE FROM bulkrax_statuses WHERE bulkrax_statuses.id = 1956

D, [2022-06-06T15:21:58.359220 #428] DEBUG -- : [ced9e494-eb0c-4caf-adb1-504a276d1148] Bulkrax::ImporterRun Destroy (0.7ms) DELETE FROM bulkrax_importer_runs WHERE bulkrax_importer_runs.id = 173

D, [2022-06-06T15:21:58.360514 #428] DEBUG -- : [ced9e494-eb0c-4caf-adb1-504a276d1148] (1.2ms) ROLLBACK

I, [2022-06-06T15:21:58.360839 #428] INFO -- : [ced9e494-eb0c-4caf-adb1-504a276d1148] Completed 500 Internal Server Error in 17ms (ActiveRecord: 8.7ms)

F, [2022-06-06T15:21:58.362782 #428] FATAL -- : [ced9e494-eb0c-4caf-adb1-504a276d1148]

F, [2022-06-06T15:21:58.362818 #428] FATAL -- : [ced9e494-eb0c-4caf-adb1-504a276d1148] ActiveRecord::StatementInvalid (Mysql2::Error: Cannot delete or update a parent row: a foreign key constraint fails (sufia.bulkrax_pending_relationships, CONSTRAINT fk_rails_c6af228061 FOREIGN KEY (bulkrax_importer_run_id) REFERENCES bulkrax_importer_runs (id)): DELETE FROM bulkrax_importer_runs WHERE bulkrax_importer_runs.id = 173):