scientist-softserv / adventist_knapsack

Apache License 2.0
1 stars 0 forks source link

Need ability to change collection from private to public #638

Open jeremyf opened 1 year ago

jeremyf commented 1 year ago

Note There is a work around. The problem is related to the save process not finding an image. To work around, remove the image, save, change the visibility, save, then re-add the image, and save.

Given I have a private collection
When via the UI I change the collection to public and submit the form
Then the collection should now be public.

There is a details Slack thread that outlines some of the nuances of the below listed collection. tl;dr - It appears to be the uploaded Logo that is a problem.

Acceptance Criteria

The specific collection that requires updating is https://adl.b2.adventistdigitallibrary.org/collections/11aab197-b630-48c0-91cd-1578d42d9f53?locale=en

Notes

This behavior also exists in https://adl.b2.adventistdigitallibrary.org/collections/8216c9e8-fbe7-4271-a88c-da890a9eeb8c?locale=en

jeremyf commented 1 year ago

In testing it appears that there is something out of sorts with this particular collection.

I have checked for reported exceptions in Sentry (our exception tracker) and am not seeing anything reported.

I checked the system logs and for the request (see https://playbook-staging.notch8.com/en/dev/rails-logging-and-understanding-the-elements-of-a-line-in-the-logs for some of the details)

Log File of Failing Request ```log issue-150.log:I, [2022-11-18T14:38:31.172964 scientist-softserv/adventist-dl#1] INFO -- : [b34b78bf9c20007d0412dc57f1d1ba52] Started PATCH "/dashboard/collections/11aab197-b630-48c0-91cd-1578d42d9f53?locale=en" for 192.168.91.143 at 2022-11-18 14:38:31 +0000 issue-150.log:D, [2022-11-18T14:38:31.177131 scientist-softserv/adventist-dl#1] DEBUG -- : [b34b78bf9c20007d0412dc57f1d1ba52] Account Load (1.2ms) SELECT "public"."accounts".* FROM "public"."accounts" INNER JOIN "public"."domain_names" ON "public"."domain_names"."account_id" = "public"."accounts"."id" WHERE "domain_names"."is_active" = $1 AND "domain_names"."cname" = $2 LIMIT $3 [["is_active", true], ["cname", "adl.b2.adventistdigitallibrary.org"], ["LIMIT", 1]] issue-150.log:D, [2022-11-18T14:38:31.180572 scientist-softserv/adventist-dl#1] DEBUG -- : [b34b78bf9c20007d0412dc57f1d1ba52] Account Load (0.7ms) SELECT "public"."accounts".* FROM "public"."accounts" WHERE "public"."accounts"."tenant" = $1 LIMIT $2 [["tenant", "3929b765-8d25-48ab-986f-3ce4edf75a6b"], ["LIMIT", 1]] issue-150.log:D, [2022-11-18T14:38:31.182760 scientist-softserv/adventist-dl#1] DEBUG -- : [b34b78bf9c20007d0412dc57f1d1ba52] SolrEndpoint Load (0.7ms) SELECT "public"."endpoints".* FROM "public"."endpoints" WHERE "public"."endpoints"."type" IN ('SolrEndpoint') AND "public"."endpoints"."id" = $1 LIMIT $2 [["id", 7], ["LIMIT", 1]] issue-150.log:D, [2022-11-18T14:38:31.185123 scientist-softserv/adventist-dl#1] DEBUG -- : [b34b78bf9c20007d0412dc57f1d1ba52] FcrepoEndpoint Load (0.7ms) SELECT "public"."endpoints".* FROM "public"."endpoints" WHERE "public"."endpoints"."type" IN ('FcrepoEndpoint') AND "public"."endpoints"."id" = $1 LIMIT $2 [["id", 8], ["LIMIT", 1]] issue-150.log:D, [2022-11-18T14:38:31.187201 scientist-softserv/adventist-dl#1] DEBUG -- : [b34b78bf9c20007d0412dc57f1d1ba52] RedisEndpoint Load (0.7ms) SELECT "public"."endpoints".* FROM "public"."endpoints" WHERE "public"."endpoints"."type" IN ('RedisEndpoint') AND "public"."endpoints"."id" = $1 LIMIT $2 [["id", 9], ["LIMIT", 1]] issue-150.log:D, [2022-11-18T14:38:31.190195 scientist-softserv/adventist-dl#1] DEBUG -- : [b34b78bf9c20007d0412dc57f1d1ba52] Site Load (0.8ms) SELECT "sites".* FROM "sites" ORDER BY "sites"."id" ASC LIMIT $1 [["LIMIT", 1]] issue-150.log:D, [2022-11-18T14:38:31.192176 scientist-softserv/adventist-dl#1] DEBUG -- : [b34b78bf9c20007d0412dc57f1d1ba52] Account Load (0.7ms) SELECT "public"."accounts".* FROM "public"."accounts" WHERE "public"."accounts"."id" = $1 LIMIT $2 [["id", 3], ["LIMIT", 1]] issue-150.log:I, [2022-11-18T14:38:31.193478 scientist-softserv/adventist-dl#1] INFO -- : [b34b78bf9c20007d0412dc57f1d1ba52] Processing by Hyrax::Dashboard::CollectionsController#update as HTML issue-150.log:I, [2022-11-18T14:38:31.193665 scientist-softserv/adventist-dl#1] INFO -- : [b34b78bf9c20007d0412dc57f1d1ba52] Parameters: {"utf8"=>"✓", "authenticity_token"=>"lE/9WlYS5rItqKcGU+cukLZ3iqPhNhdlj5Q9gTJqPAIL5nrB1jany2U44kFfiaPD8Rn4ZHPJNtQ4yDy5/ptxaA==", "collection"=>{"title"=>["Grace Amadon Collection", ""], "description"=>["This collection contains Amadon’s research concerning chronologies and time prophecies of the Bible. The collection is divided into the following categories: 1) correspondence; 2) Amadon’s writings; 3) sources arranged by subject; 4) photostat sources. ", "Provenance:\r\nThe collection was originally given to the Seventh-day Adventist Seminary while still\r\nin Washington. It was donated at a later date to the Adventist Heritage Center after the\r\nSeminary moved to Berrien Springs, MI.", "Scope and Content:\r\nGrace Edith Amadon (1872-1945) received her education at Battle Creek College\r\nwhere she learned Greek and Latin. She was also proficient in music. In 1893 Miss\r\nAmadon was invited by the Mission Board to go to Cape Town, South Africa, to teach\r\nGreek, Latin, mathematics, and music at the Claremont Union College. After returning\r\nfrom the mission field in about 1899, Amadon was in charge of the Battle Creek church\r\nschool for two or three years. Between 1903 and 1912 she lived in Chicago where she\r\nserved as a bacteriologist and taught pathology and other science subjects in a\r\nChicago college.\r\nAfter spending more then twenty years caring for her elderly parents, Miss Amadon\r\nwas invited by the General Conference of the Seventh-day Adventist Church to join a\r\nspecially formed research committee in January 1939.\r\nGrace Amadon made a distinct contribution to astronomical science by confirming\r\nthe validity of the time prophecies of the Bible. She made contacts with associate\r\nastronomers of the United States Naval Observatory and several of her articles were\r\naccepted for publication by scholarly journals.\r\nThis collection contains Amadon’s research concerning chronologies and time\r\nprophecies of the Bible. The collection is divided into the following categories: 1)\r\ncorrespondence; 2) Amadon’s writings; 3) sources arranged by subject; 4) photostat\r\nsources.", "Arrangement:\r\nIn most parts, the present collection was arranged by the Adventist Heritage Center.\r\nThe headings of the subject file and source documents, however, were assigned by\r\nAmadon herself. The researcher should note that some of Amadon’s correspondence\r\nrelated to a particular subject are placed with the corresponding subject file. We have\r\nalso tried to match as much as possible the subject headings in part II (Amadon’s\r\nWritings), part III (Subject File and Source Documents), and part IV (Photostats). In\r\naddition, there are some oversized documents. These are in Box 22. The photostat\r\ndocuments are placed under subject headings without any particular order. The number\r\nof documents under each subject heading, however, is given. There is also a list of\r\nphotostats supplied by Amadon (Box8 Fld17).", ""], "thumbnail_id"=>"", "creator"=>["Amadon, Grace Edith, 1872-1945", ""], "contributor"=>[""], "keyword"=>["South Africa", "Correspondence", "Chicago", "University", "Time Prophecies of the Bible", "Claremont Union College", "Teacher", "Research Materials", "Professor", "Battle Creek College (BCC)", "College", ""], "license"=>[""], "publisher"=>[""], "date_created"=>"", "subject"=>["United States Naval Observatory", "Astronomy", "General Conference of Seventh-day Adventists", ""], "language"=>[""], "identifier"=>["Collection 154", ""], "based_near"=>[""], "related_url"=>["http://www.centerforadventistresearch.org/", ""], "resource_type"=>["", "Other"], "visibility"=>"open"}, "type"=>"", "stay_on_edit"=>"true", "collection_type_gid"=>"gid://hyku/hyrax-collectiontype/1", "logo_files"=>["/app/samvera/branding/11aab197-b630-48c0-91cd-1578d42d9f53/logo/cropped-centeradventist_au_v_blue_website-1.jpg"], "linkurl"=>[""], "alttext"=>[""], "permission_template"=>{"access_grants_attributes"=>{"0"=>{"agent_type"=>"group", "agent_id"=>"", "access"=>""}}}, "update_collection"=>"Save changes", "referer_anchor"=>"#discovery", "locale"=>"en", "id"=>"11aab197-b630-48c0-91cd-1578d42d9f53"} issue-150.log:D, [2022-11-18T14:38:31.196499 scientist-softserv/adventist-dl#1] DEBUG -- : [b34b78bf9c20007d0412dc57f1d1ba52] Account Load (0.9ms) SELECT "public"."accounts".* FROM "public"."accounts" INNER JOIN "public"."domain_names" ON "public"."domain_names"."account_id" = "public"."accounts"."id" WHERE "domain_names"."is_active" = $1 AND "domain_names"."cname" = $2 LIMIT $3 [["is_active", true], ["cname", "adl.b2.adventistdigitallibrary.org"], ["LIMIT", 1]] issue-150.log:D, [2022-11-18T14:38:31.197317 scientist-softserv/adventist-dl#1] DEBUG -- : [b34b78bf9c20007d0412dc57f1d1ba52] CACHE SolrEndpoint Load (0.0ms) SELECT "public"."endpoints".* FROM "public"."endpoints" WHERE "public"."endpoints"."type" IN ('SolrEndpoint') AND "public"."endpoints"."id" = $1 LIMIT $2 [["id", 7], ["LIMIT", 1]] issue-150.log:D, [2022-11-18T14:38:31.198169 scientist-softserv/adventist-dl#1] DEBUG -- : [b34b78bf9c20007d0412dc57f1d1ba52] CACHE FcrepoEndpoint Load (0.0ms) SELECT "public"."endpoints".* FROM "public"."endpoints" WHERE "public"."endpoints"."type" IN ('FcrepoEndpoint') AND "public"."endpoints"."id" = $1 LIMIT $2 [["id", 8], ["LIMIT", 1]] issue-150.log:D, [2022-11-18T14:38:31.198889 scientist-softserv/adventist-dl#1] DEBUG -- : [b34b78bf9c20007d0412dc57f1d1ba52] CACHE RedisEndpoint Load (0.0ms) SELECT "public"."endpoints".* FROM "public"."endpoints" WHERE "public"."endpoints"."type" IN ('RedisEndpoint') AND "public"."endpoints"."id" = $1 LIMIT $2 [["id", 9], ["LIMIT", 1]] issue-150.log:D, [2022-11-18T14:38:31.200128 scientist-softserv/adventist-dl#1] DEBUG -- : [b34b78bf9c20007d0412dc57f1d1ba52] CACHE Site Load (0.0ms) SELECT "sites".* FROM "sites" ORDER BY "sites"."id" ASC LIMIT $1 [["LIMIT", 1]] issue-150.log:D, [2022-11-18T14:38:31.200564 scientist-softserv/adventist-dl#1] DEBUG -- : [b34b78bf9c20007d0412dc57f1d1ba52] CACHE Account Load (0.0ms) SELECT "public"."accounts".* FROM "public"."accounts" WHERE "public"."accounts"."id" = $1 LIMIT $2 [["id", 3], ["LIMIT", 1]] issue-150.log:D, [2022-11-18T14:38:31.202975 scientist-softserv/adventist-dl#1] DEBUG -- : [b34b78bf9c20007d0412dc57f1d1ba52] User Load (0.8ms) SELECT "public"."users".* FROM "public"."users" WHERE "public"."users"."guest" = $1 AND "public"."users"."id" = $2 ORDER BY "public"."users"."id" ASC LIMIT $3 [["guest", false], ["id", 5], ["LIMIT", 1]] issue-150.log:I, [2022-11-18T14:38:31.221471 scientist-softserv/adventist-dl#1] INFO -- : [b34b78bf9c20007d0412dc57f1d1ba52] Attempted to init base path `3929b765-8d25-48ab-986f-3ce4edf75a6b`, but it already exists issue-150.log:D, [2022-11-18T14:38:31.238147 scientist-softserv/adventist-dl#1] DEBUG -- : [b34b78bf9c20007d0412dc57f1d1ba52] Load LDP (10.4ms) http://fcrepo.default.svc.cluster.local:8080/rest/3929b765-8d25-48ab-986f-3ce4edf75a6b/11/aa/b1/97/11aab197-b630-48c0-91cd-1578d42d9f53 Service: 637100 issue-150.log:D, [2022-11-18T14:38:31.260814 scientist-softserv/adventist-dl#1] DEBUG -- : [b34b78bf9c20007d0412dc57f1d1ba52] CACHE Site Load (0.0ms) SELECT "sites".* FROM "sites" ORDER BY "sites"."id" ASC LIMIT $1 [["LIMIT", 1]] issue-150.log:D, [2022-11-18T14:38:31.263493 scientist-softserv/adventist-dl#1] DEBUG -- : [b34b78bf9c20007d0412dc57f1d1ba52] Role Load (1.4ms) SELECT "roles".* FROM "roles" INNER JOIN "users_roles" ON "roles"."id" = "users_roles"."role_id" WHERE "users_roles"."user_id" = $1 AND ((((roles.name = 'admin') AND (roles.resource_type IS NULL) AND (roles.resource_id IS NULL)) OR ((roles.name = 'admin') AND (roles.resource_type = 'Site') AND (roles.resource_id IS NULL)) OR ((roles.name = 'admin') AND (roles.resource_type = 'Site') AND (roles.resource_id = 1)))) [["user_id", 5]] issue-150.log:D, [2022-11-18T14:38:31.264997 scientist-softserv/adventist-dl#1] DEBUG -- : [b34b78bf9c20007d0412dc57f1d1ba52]  (0.9ms) SELECT COUNT(*) FROM "roles" INNER JOIN "users_roles" ON "roles"."id" = "users_roles"."role_id" WHERE "users_roles"."user_id" = $1 [["user_id", 5]] issue-150.log:D, [2022-11-18T14:38:31.265113 scientist-softserv/adventist-dl#1] DEBUG -- : [b34b78bf9c20007d0412dc57f1d1ba52] Usergroups are ["public", "admin", "registered"] issue-150.log:D, [2022-11-18T14:38:31.266562 scientist-softserv/adventist-dl#1] DEBUG -- : [b34b78bf9c20007d0412dc57f1d1ba52] Role Load (0.8ms) SELECT "roles".* FROM "roles" INNER JOIN "users_roles" ON "roles"."id" = "users_roles"."role_id" WHERE "users_roles"."user_id" = $1 AND (((roles.name = 'superadmin') AND (roles.resource_type IS NULL) AND (roles.resource_id IS NULL))) [["user_id", 5]] issue-150.log:D, [2022-11-18T14:38:31.271900 scientist-softserv/adventist-dl#1] DEBUG -- : [b34b78bf9c20007d0412dc57f1d1ba52] Hyrax::Feature Load (0.7ms) SELECT "hyrax_features".* FROM "hyrax_features" WHERE "hyrax_features"."key" = $1 ORDER BY "hyrax_features"."id" ASC LIMIT $2 [["key", "transfer_works"], ["LIMIT", 1]] issue-150.log:D, [2022-11-18T14:38:31.273131 scientist-softserv/adventist-dl#1] DEBUG -- : [b34b78bf9c20007d0412dc57f1d1ba52] Hyrax::Feature Load (0.7ms) SELECT "hyrax_features".* FROM "hyrax_features" WHERE "hyrax_features"."key" = $1 ORDER BY "hyrax_features"."id" ASC LIMIT $2 [["key", "proxy_deposit"], ["LIMIT", 1]] issue-150.log:D, [2022-11-18T14:38:31.274150 scientist-softserv/adventist-dl#1] DEBUG -- : [b34b78bf9c20007d0412dc57f1d1ba52] CACHE Role Load (0.0ms) SELECT "roles".* FROM "roles" INNER JOIN "users_roles" ON "roles"."id" = "users_roles"."role_id" WHERE "users_roles"."user_id" = $1 AND (((roles.name = 'superadmin') AND (roles.resource_type IS NULL) AND (roles.resource_id IS NULL))) [["user_id", 5]] issue-150.log:D, [2022-11-18T14:38:31.275951 scientist-softserv/adventist-dl#1] DEBUG -- : [b34b78bf9c20007d0412dc57f1d1ba52] CollectionBrandingInfo Destroy (0.9ms) DELETE FROM "collection_branding_infos" WHERE "collection_branding_infos"."collection_id" = $1 AND "collection_branding_infos"."role" = $2 [["collection_id", "11aab197-b630-48c0-91cd-1578d42d9f53"], ["role", "banner"]] issue-150.log:D, [2022-11-18T14:38:31.277722 scientist-softserv/adventist-dl#1] DEBUG -- : [b34b78bf9c20007d0412dc57f1d1ba52] Hyrax::UploadedFile Load (0.8ms) SELECT "uploaded_files".* FROM "uploaded_files" WHERE "uploaded_files"."id" = $1 LIMIT $2 [["id", 0], ["LIMIT", 1]] issue-150.log:I, [2022-11-18T14:38:31.278174 scientist-softserv/adventist-dl#1] INFO -- : [b34b78bf9c20007d0412dc57f1d1ba52] Completed 404 Not Found in 84ms (ActiveRecord: 10.5ms) issue-150.log:D, [2022-11-18T14:38:31.281188 scientist-softserv/adventist-dl#1] DEBUG -- : [b34b78bf9c20007d0412dc57f1d1ba52] Account Load (0.7ms) SELECT "public"."accounts".* FROM "public"."accounts" WHERE "public"."accounts"."tenant" = $1 LIMIT $2 [["tenant", "public"], ["LIMIT", 1]] issue-150.log:D, [2022-11-18T14:38:31.281491 scientist-softserv/adventist-dl#1] DEBUG -- : [b34b78bf9c20007d0412dc57f1d1ba52] User excluded error: # issue-150.log:F, [2022-11-18T14:38:31.282079 scientist-softserv/adventist-dl#1] FATAL -- : [b34b78bf9c20007d0412dc57f1d1ba52] issue-150.log:F, [2022-11-18T14:38:31.282110 scientist-softserv/adventist-dl#1] FATAL -- : [b34b78bf9c20007d0412dc57f1d1ba52] ActiveRecord::RecordNotFound (Couldn't find Hyrax::UploadedFile with 'id'=/app/samvera/branding/11aab197-b630-48c0-91cd-1578d42d9f53/logo/cropped-centeradventist_au_v_blue_website-1.jpg): issue-150.log:F, [2022-11-18T14:38:31.282134 scientist-softserv/adventist-dl#1] FATAL -- : [b34b78bf9c20007d0412dc57f1d1ba52] issue-150.log:F, [2022-11-18T14:38:31.282165 scientist-softserv/adventist-dl#1] FATAL -- : [b34b78bf9c20007d0412dc57f1d1ba52] app/controllers/hyrax/dashboard/collections_controller.rb:273:in `uploaded_files' issue-150.log:[b34b78bf9c20007d0412dc57f1d1ba52] app/controllers/hyrax/dashboard/collections_controller.rb:322:in `create_logo_info' issue-150.log:[b34b78bf9c20007d0412dc57f1d1ba52] app/controllers/hyrax/dashboard/collections_controller.rb:353:in `block in process_logo_records' issue-150.log:[b34b78bf9c20007d0412dc57f1d1ba52] app/controllers/hyrax/dashboard/collections_controller.rb:348:in `each' issue-150.log:[b34b78bf9c20007d0412dc57f1d1ba52] app/controllers/hyrax/dashboard/collections_controller.rb:348:in `each_with_index' issue-150.log:[b34b78bf9c20007d0412dc57f1d1ba52] app/controllers/hyrax/dashboard/collections_controller.rb:348:in `process_logo_records' issue-150.log:[b34b78bf9c20007d0412dc57f1d1ba52] app/controllers/hyrax/dashboard/collections_controller.rb:369:in `process_logo_input' issue-150.log:[b34b78bf9c20007d0412dc57f1d1ba52] app/controllers/hyrax/dashboard/collections_controller.rb:161:in `update' issue-150.log:[b34b78bf9c20007d0412dc57f1d1ba52] app/middleware/no_cache_middleware.rb:13:in `call' ```
jeremyf commented 1 year ago

Note: I am not able to duplicate this error locally.

jeremyf commented 1 year ago

I moved this back to "No Status" as there is a known work around; this also lets us prioritize other work per @KatharineV's direction.

jeremyf commented 1 year ago

There may be a relation to scientist-softserv/adventist-dl#131

KatharineV commented 1 year ago

Just dropping in to add that all collections fail to update visibility settings if and only if there is a file uploaded as the logo.