sul-dlss / course_reserves

rails app used by patrons looking up course reserve info and lib staff entering course reserve info
1 stars 1 forks source link

[course_reserves/prod] Psych::DisallowedClass: Tried to load unspecified class: ActionController::Parameters #413

Closed cbeer closed 2 years ago

cbeer commented 2 years ago

Backtrace

line 95 of [PROJECT_ROOT]/app/controllers/reserves_controller.rb: dup
line 95 of [PROJECT_ROOT]/app/controllers/reserves_controller.rb: clone

View full backtrace and more info at honeybadger.io

corylown commented 2 years ago

Reserve 8018 seems strange to me? Seems like maybe bad data in the sent_item_list field (with all the !ruby/object:ActionController::Parameters). The other records I've spot-checked all have the same data in item_list and sent_item_list fields.

[8018,
 "HISTORY-193",
 "01",
 "Late Imperial China",
 "GREEN-RESV",
 0,
 "Spring 2018",
 "HISTORY-193,msommer",
 "",
 "MATTHEW SOMMER",
 "6508431028",
 "msommer@stanford.edu",
 "Sommer, Matthew H.",
 "msommer",
 "choi97, dannag",
 "---\n- !ruby/hash:ActiveSupport::HashWithIndifferentAccess\n  title: 'China : a new history / John King Fairbank and Merle Goldman.'\n  ckey: '3933192'\n  comment: \"36105023045250 -1- Green\\r\\n36105000100946 -2- Green\\r\\n\\r\\n2/26/18 EC\\r\\n3/14/2018\n    EM\"\n  copies: '2'\n  media: \n  loan_period: 1 day\n  online: true\n  imprint: 'Enl. ed. - Cambridge, Mass. : Belknap Press of Harvard University Press,\n    1998.'\n- !ruby/hash:ActiveSupport::HashWithIndifferentAccess\n  title: Six records of a floating life / Shen Fu ; translated with an introduction\n    and notes by Leonard Pratt and Chiang Su-hui.\n  ckey: '1526202'\n  comment: \"36105039558833 -1- Green -on resv- hold placed\\r\\n36105002537434 -2-Green\\r\\n\\r\\nB\n    2/26/18 EC, 3/26/2018 EM\\r\\n\\r\\n\"\n  copies: '2'\n  media: \n  loan_period: 1 day\n  online: true\n  imprint: 'New York : Penguin, 1983.'\n- !ruby/hash:ActiveSupport::HashWithIndifferentAccess\n  title: The death of Woman Wang / Jonathan D. Spence.\n  ckey: '2793386'\n  comment: \"36105004511239 -1-Green\\r\\n36105004511197 -1-Green\\r\\n\\r\\n2/26/18 EC\\r\\n3/14/2018\n    EM\"\n  copies: '2'\n  media: \n  loan_period: 1 day\n  online: false\n  imprint: 'New York : Penguin Books, 1979, c1978.'\n- !ruby/hash:ActiveSupport::HashWithIndifferentAccess\n  title: Emperor of China; self portrait of K'ang Hsi, 1654-1722, by Jonathan D. Spence.\n  ckey: '920407'\n  comment: \"36105000116884 -1- Green\\r\\n36105000093547 -2- Green\\r\\n\\r\\n2/26/18 EC\\r\\n3/14/2018\n    EM\"\n  copies: '2'\n  media: \n  loan_period: 1 day\n  online: true\n  imprint: \"[1st ed.] - New York, Knopf, 1974.\"\n- !ruby/hash:ActiveSupport::HashWithIndifferentAccess\n  title: 'The gate of heavenly peace : the Chinese and their revolution, 1895-1980\n    / Jonathan D. Spence.'\n  ckey: '1480223'\n  comment: \"36105027076020 -1-Green\\r\\n36105039209486 -1-Green\\r\\n\\r\\n2/26/18 EC\\r\\n3/14/2018\n    EM\"\n  copies: '2'\n  media: \n  loan_period: 1 day\n  online: false\n  imprint: 'New York : Viking Press, 1981.'\n- !ruby/hash:ActiveSupport::HashWithIndifferentAccess\n  title: 'The Peony Pavilion : Mudan ting / Tang Xianzu ; translated with a new preface\n    by Cyril Birch ; introduction to the second edition by Catherine Swatek.'\n  ckey: '4757208'\n  comment: \"36105110420606\\r\\n36105214677986\\r\\n\\r\\n2/26/18 EC\\r\\n3/14/2018 EM\"\n  copies: '2'\n  media: \n  loan_period: 1 day\n  online: true\n  imprint: '2nd ed. - Bloomington : Indiana University Press, 2002.'\n- !ruby/hash:ActiveSupport::HashWithIndifferentAccess\n  title: Flowers in the mirror, by Li Ju-chen. Translated and edited by Lin Tai-yi.\n  ckey: '147091'\n  comment: \"36105034025606 -1-\\r\\n\\r\\n\\r\\n2/26/18 EC\\r\\n3/14/2018 EM\"\n  copies: '1'\n  media: \n  loan_period: 2 hours\n  online: true\n  imprint: Berkeley, University of California Press, 1965.\n- !ruby/hash:ActiveSupport::HashWithIndifferentAccess\n  title: 'Chinese civilization : a sourcebook / edited by Patricia Buckley Ebrey.'\n  ckey: '2911028'\n  comment: \"36105016345295 -1-\\r\\n3/26/2018 EM\\r\\n\"\n  copies: '1'\n  media: \n  loan_period: 2 hours\n  online: true\n  imprint: '2nd ed., rev. and expanded. - New York : Free Press, c1993.'\n- !ruby/hash:ActiveSupport::HashWithIndifferentAccess\n  title: 'The search for modern China : a documentary collection / edited by Pei-kai\n    Cheng, Michael Lestz, with Jonathan D. Spence.'\n  ckey: '4072731'\n  comment: \"36105021922799  -1-\\r\\n\\r\\n2/26/18 EC\\r\\n3/14/2018 EM\"\n  copies: '1'\n  media: \n  loan_period: 2 hours\n  online: false\n  imprint: '1st ed. - New York : Norton, c1999.'\n- !ruby/hash:ActiveSupport::HashWithIndifferentAccess\n  title: 'China : a new history / John King Fairbank.'\n  ckey: '2212253'\n  comment: \"36105000100946  -1-\\r\\n\\r\\n2/26/18 EC\\r\\n3/14/2018 EM\\r\\n\"\n  copies: '1'\n  media: \n  loan_period: 1 day\n  online: true\n  imprint: 'Cambridge, Mass. : Belknap Press of Harvard University Press, 1992.'\n- !ruby/hash:ActiveSupport::HashWithIndifferentAccess\n  title: The death of woman Wang / Jonathan D. Spence.\n  ckey: '996406'\n  comment: \"36105037254153  -1-\\r\\n\\r\\n2/26/18 EC\\r\\n3/14/2018 EM\"\n  copies: '1'\n  media: \n  loan_period: 1 day\n  online: true\n  imprint: 'New York : Viking Press, 1978.'\n",
 1,
 nil,
 "02-01-2018 11:28am",
 "---\n- !ruby/object:ActionController::Parameters\n  parameters: !ruby/hash:ActiveSupport::HashWithIndifferentAccess\n    title: 'China : a new history / John King Fairbank and Merle Goldman.'\n    ckey: '3933192'\n    comment: \"36105023045250 C.01\\r\\n\\r\\nNumber 10:\\r\\nhttp://searchworks/view/2212253\"\n    copies: '2'\n    media: \n    loan_period: 1 day\n    online: true\n    imprint: 'Enl. ed. - Cambridge, Mass. : Belknap Press of Harvard University Press,\n      1998.'\n  permitted: false\n- !ruby/object:ActionController::Parameters\n  parameters: !ruby/hash:ActiveSupport::HashWithIndifferentAccess\n    title: Six records of a floating life / Shen Fu ; translated with an introduction\n      and notes by Leonard Pratt and Chiang Su-hui.\n    ckey: '1526202'\n    comment: \"36105039558833 C.01\\r\\n36105002537434 C.03\"\n    copies: '2'\n    media: \n    loan_period: 1 day\n    online: true\n    imprint: 'New York : Penguin, 1983.'\n  permitted: false\n- !ruby/object:ActionController::Parameters\n  parameters: !ruby/hash:ActiveSupport::HashWithIndifferentAccess\n    title: The death of Woman Wang / Jonathan D. Spence.\n    ckey: '2793386'\n    comment: \"36105004511239 C.01\\r\\n\\r\\nNumber 11:\\r\\nhttp://searchworks/view/996406\"\n    copies: '2'\n    media: \n    loan_period: 1 day\n    online: false\n    imprint: 'New York : Penguin Books, 1979, c1978.'\n  permitted: false\n- !ruby/object:ActionController::Parameters\n  parameters: !ruby/hash:ActiveSupport::HashWithIndifferentAccess\n    title: Emperor of China; self portrait of K'ang Hsi, 1654-1722, by Jonathan D.\n      Spence.\n    ckey: '920407'\n    comment: \"36105000116884 C.01\\r\\n36105000093547 C.02\"\n    copies: '2'\n    media: \n    loan_period: 1 day\n    online: true\n    imprint: \"[1st ed.] - New York, Knopf, 1974.\"\n  permitted: false\n- !ruby/object:ActionController::Parameters\n  parameters: !ruby/hash:ActiveSupport::HashWithIndifferentAccess\n    title: 'The gate of heavenly peace : the Chinese and their revolution, 1895-1980\n      / Jonathan D. Spence.'\n    ckey: '1480223'\n    comment: \"36105039209486 C.02\\r\\n36105000093281 C.03\"\n    copies: '2'\n    media: \n    loan_period: 1 day\n    online: false\n    imprint: 'New York : Viking Press, 1981.'\n  permitted: false\n- !ruby/object:ActionController::Parameters\n  parameters: !ruby/hash:ActiveSupport::HashWithIndifferentAccess\n    title: 'The Peony Pavilion : Mudan ting / Tang Xianzu ; translated with a new\n      preface by Cyril Birch ; introduction to the second edition by Catherine Swatek.'\n    ckey: '4757208'\n    comment: \"36105110420606 C.01\\r\\nORD?\"\n    copies: '2'\n    media: \n    loan_period: 1 day\n    online: true\n    imprint: '2nd ed. - Bloomington : Indiana University Press, 2002.'\n  permitted: false\n- !ruby/object:ActionController::Parameters\n  parameters: !ruby/hash:ActiveSupport::HashWithIndifferentAccess\n    title: Flowers in the mirror, by Li Ju-chen. Translated and edited by Lin Tai-yi.\n    ckey: '147091'\n    comment: \"36105034025606 C.01\\r\\n\"\n    copies: '1'\n    media: \n    loan_period: 2 hours\n    online: true\n    imprint: Berkeley, University of California Press, 1965.\n  permitted: false\n- !ruby/object:ActionController::Parameters\n  parameters: !ruby/hash:ActiveSupport::HashWithIndifferentAccess\n    title: 'Chinese civilization : a sourcebook / edited by Patricia Buckley Ebrey.'\n    ckey: '2911028'\n    comment: 36105016345295 C.01\n    copies: '1'\n    media: \n    loan_period: 2 hours\n    online: true\n    imprint: '2nd ed., rev. and expanded. - New York : Free Press, c1993.'\n  permitted: false\n- !ruby/object:ActionController::Parameters\n  parameters: !ruby/hash:ActiveSupport::HashWithIndifferentAccess\n    title: 'The search for modern China : a documentary collection / edited by Pei-kai\n      Cheng, Michael Lestz, with Jonathan D. Spence.'\n    ckey: '4072731'\n    comment: 36105021922799 C.01\n    copies: '1'\n    media: \n    loan_period: 2 hours\n    online: false\n    imprint: '1st ed. - New York : Norton, c1999.'\n  permitted: false\n- !ruby/object:ActionController::Parameters\n  parameters: !ruby/hash:ActiveSupport::HashWithIndifferentAccess\n    title: 'China : a new history / John King Fairbank.'\n    ckey: '2212253'\n    comment: 36105000100946 C.01\n    copies: '1'\n    media: \n    loan_period: 1 day\n    online: true\n    imprint: 'Cambridge, Mass. : Belknap Press of Harvard University Press, 1992.'\n  permitted: false\n- !ruby/object:ActionController::Parameters\n  parameters: !ruby/hash:ActiveSupport::HashWithIndifferentAccess\n    title: The death of woman Wang / Jonathan D. Spence.\n    ckey: '996406'\n    comment: 36105037254153 C.01\n    copies: '1'\n    media: \n    loan_period: 1 day\n    online: true\n    imprint: 'New York : Viking Press, 1978.'\n  permitted: false\n",
 2018-02-01 19:28:02 UTC,
 2020-07-20 18:27:15 UTC] 
corylown commented 2 years ago

IDs of all the impacted records:

Reserve.all.order(created_at: :asc).each do |reserve|
  begin
    reserve['sent_item_list']
  rescue Psych::DisallowedClass => e
    puts reserve.id
  end
end

827
1251
2834
3866
3876
3877
3931
3951
3982
4014
4122
4180
4299
4522
4774
5011
5013
5014
5017
5020
5026
5028
5054
5056
5061
5063
5064
5065
5066
5067
5068
5082
5088
5089
5090
5093
5115
5172
5575
5584
5597
5608
5903
5944
6165
6375
6455
6521
6628
6634
6661
6673
6712
6734
6744
6842
6847
6852
6856
6928
6964
6986
7043
7097
7107
7118
7233
7265
7284
7303
7308
7324
7325
7335
7336
7367
7383
7385
7404
7438
7440
7451
7462
7466
7468
7470
7472
7473
7475
7477
7478
7480
7484
7488
7489
7542
7636
7709
7769
7777
7783
7785
7846
7889
7925
7941
7965
7996
8018
8020
8022
8023
8027
8031
8036
8041
8042
8047
8048
8054
8060
8062
8078
8081
8083
8086
8089
8092
8094
8100
8101
8104
8131
8155
8173
8174
8315
8318
8319
8411
8472
8785
8956
8996
9315
9324
9992
corylown commented 2 years ago

I remediated the bad data on prod & stage by copying the good values from reserves.item_list to reserves.sent_item_list for the impacted records.