scientist-softserv / britishlibrary

Other
3 stars 0 forks source link

Many collections makes the dashboard fail #473

Open cziaarm opened 1 year ago

cziaarm commented 1 year ago

When number of collections gets many (>310) a long string ids will cause a solr FATAL.

https://assaydepot.slack.com/archives/C0313NK2LJ0/p1695390919966129

Checks used to see if user can import/create works gathers all the collections in a repo runs a query to see if there are deposits associated with admin_sets... or something like that anyway.

The upshot is that the long string of all the ids gets too long and solr throws a fatal error. This issue is probably fixed in Hyrax 3

cziaarm commented 1 year ago

@grahamjevon, @NoraRamsey

Testing on staging difficult without adding 300+ collections to a repository.

Suggested acceptance criteria is that this change doesn't obviously break anything. An example of potential breaks might be not seeing then "import works" menu option on the dashboard when expecting to.

Real test will be whether this fixes current error for bl-demo on production.

NoraRamsey commented 1 year ago

Hi @cziaarm, Now able to open the demo website but receiving an error when trying to sign in.

cziaarm commented 1 year ago

The bl-demo repository is on the production environment and the fix is only on staging presently, hence Client QA.

See note above about difficulty in testing this fix on staging environment. Perhaps for client QA, just ensuring that there is no new unexpected behaviour while in the dashboard and collection pages on https://bl.bl-staging.notch8.cloud/ either that or create 300+ collections on the a staging repo...

grahamjevon commented 1 year ago

Hi @cziaarm I have imported 335 collections to staging and this seems to have triggered a similar error. I can open the main Dashboard page. But trying to open any other page within the Dashboard (e.g. "Collections" or "Works") results in a "Something went wrong error". This error also occurs when I try to open any of the 335 collections from the front end search results.

Image

cziaarm commented 1 year ago

Hi @grahamjevon ,

URL please, or ID in copy-able state

grahamjevon commented 1 year ago

This applies to every collection I have tried to open via the "View all collections" feed or the search results. Here are two examples:

Strangely, when I click on the links above, the collection pages successfully open. But when I try to open from the "View all collections" feed or search results page, the same collections have the "something went wrong error".

Here are two examples of a dashboard page with the error:

When I go click on Dashboard > Works (https://bl.bl-staging.notch8.cloud/dashboard/my/works) it actually opens the homepage.

cziaarm commented 1 year ago

Rightio, I'll need to come up with a better solution.

The error occurs whenever Hyrax needs to work out whether a user is allowed to create a work... it does this in an odd way that involves a solr query that uses a list of all the collection ids (hence the reason things start to break when there are lots of collections).

I suspect that the window you opened those links successfully on there was no logged in user and the code to work out whether a user can import or create a work was not run. This is issue is probably fixed Hyrax3.5, but there is a large amount of re-aligning to do to the customised code before we could switch BL over to that.

Bear with me, I'll head back to my dev and see if I can get this workaround going.

cziaarm commented 1 year ago

Switch blacklight config to default to :post Found some ActiveFedora or raw solr calls that sent all a user's collections as a bit old ID string and made them do the same query with a POST

https://github.com/scientist-softserv/britishlibrary/pull/479

cziaarm commented 1 year ago

related to #451 (PR should fix both)

grahamjevon commented 1 year ago

Just successfully imported 335 collections via BX. None of the previous problems were replicated.

grahamjevon commented 1 year ago

Hi @Rory, on bl-demo, if I go go to Dashboard > Collections, I get a "page does not exist error": https://bl-demo.iro.bl.uk/dashboard/my/collections

If I delete "/my" from the url, it successfully opens the Collections page (on the "All Collections" tab, but if I click on the "Your Collections" tab, I get the same error.

Not sure if this should be a new ticket or whether this means there is additional work for this ticket?

grahamjevon commented 1 year ago

Hi @cziaarm - I've also noticed that any new collections I add to bl-demo are not appearing in the "All Collections" tab in the Dashboard, even though they are appearing in the front end list of collections e.g. https://bl-demo.iro.bl.uk/collections/d75c9729-e325-4124-8350-092886e963a1