[MODCR-57] Copyright filter in Courses App --> Reserves pane returns error message when value selected Created: 28/Jan/21  Updated: 23/Apr/21  Resolved: 23/Apr/21

Status: Closed
Project: mod-courses
Components: None
Affects versions: None
Fix versions: 1.2.1

Type: Bug Priority: P2
Reporter: Erin Nettifee Assignee: Kurt Nordstrom
Resolution: Done Votes: 0
Labels: bugfest_R1.2021, support
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original estimate: Not Specified

Attachments: PNG File image-2021-01-28-13-18-44-324.png     PNG File image-2021-04-22-08-11-41-834.png    
Issue links:
Blocks
is blocked by RMB-586 foreign key alias sub-field query cau... Closed
is blocked by RMB-830 foreign key non-alias sub-field query... Closed
Relates
relates to RMB-585 Invalid SQL generated for coursereser... Closed
Sprint:
Development Team: Thor
Release: R1 2021 Bug Fix

 Description   

Overview: When you are trying to filter the reserves list by any value in the drop-down (whether assigned to a reserve item or not,) an error message is received. See screenshot. Reproduced on FOLIO-Snapshot and Duke Test environment (Honeysuckle).

Steps to Reproduce:

  1. log into FOLIO environment with appropriate permissions to courses app
  2. create an item and add it to a Course either via full Inventory or fast-add functionality
  3. edit the item and add a copyright status value and save the item
  4. edit the reserve and set the copyright status filter to the value you just chose and saved to your item (so that at least that item should be returned in the search)

Expected Results: Item is displayed in the filtered reserve list
Actual Results: Error appears:

ERROR: in module @folio/courses, operation GET on resource 'reserves' failed, saying:
missing FROM-clause entry for table "copyrighttracking" 

See screenshot.

Additional Information:
URL:
Interested parties: Kelly Drake



 Comments   
Comment by Kelly Drake [ 28/Jan/21 ]

Error: in module @folio/courses, operation GET on resource 'reserves' failed, saying: missing FROM-clause entry for table "copyrighttracking"

Kurt Nordstrom is this one in your ballpark?

Comment by Kelly Drake [ 28/Jan/21 ]

Also - I'm checking on whether this needs to be a hotfix or can be included in Iris. (I'm guessing/hoping Iris)

Comment by Kelly Drake [ 28/Jan/21 ]

Erin Nettifee Does a p3 ranking, with release in Iris work for you?

Comment by Erin Nettifee [ 28/Jan/21 ]

Kelly Drake we can deal with it, since I know a hotfix at this point for Honeysuckle is probably not going to happen.

Comment by Anya [ 01/Mar/21 ]

Support sig: Kelly Drake will check in on this 

Comment by Kelly Drake [ 01/Mar/21 ]

Kurt Nordstrom - Can you remind me where we are on this?

Comment by Anya [ 08/Mar/21 ]

Support: Kurt Nordstrom could you give us an update on this. 

Comment by Anya [ 22/Mar/21 ]

Support: md331 any chance you could look at this? Thanks 

Comment by Erin Nettifee [ 22/Mar/21 ]

Anya we'd understood at Duke that Index Data was still doing bug fixing on Courses as they have capacity, so that's why I hadn't brought this to md331 to be addressed. Since this is a P3 (that is also backend,) I think it can stay where it is until we know if that arrangement has changed.

I certainly don't like this bug being in the app, but it's not a showstopper for Duke going live this summer w/Courses.

Comment by Anya [ 29/Mar/21 ]

Support: Kelly Drake please see Erin Nettifee' s comment above. 

Comment by Kelly Drake [ 30/Mar/21 ]

Mike Taylor  Could you take a quick look at this one?  Duke currently has it ranked as a P3 - so it doesn't need to be fixed, and I believe they are the only ones currently using the copyright field, but if it's a quick fix, it would be good to get cleaned up?

Comment by Mike Taylor [ 31/Mar/21 ]

Hi, Kelly Drake. I'm able to reproduct this at https://folio-snapshot.dev.folio.org/cr/reserves?sort=name and the error message is more detailed and informative than what's described above:

ERROR: in module @folio/courses, operation GET on resource 'reserves' failed, saying: { "message": "missing FROM-clause entry for table \"copyrighttracking\"", "severity": "ERROR", "code": "42P01", "internalPosition": "70", "internalQuery": "EXPLAIN SELECT * FROM diku_mod_courses.coursereserves_reserves WHERE copyrightTracking.copyrightStatusId='0a598dcc-237f-4d74-8444-9ac5a8f9d4a8'", "where": "PL/pgSQL function count_estimate_smart2(bigint,bigint,text) line 7 at FOR over EXECUTE statement\nPL/pgSQL function count_estimate(text) line 7 at assignment", "file": "parse_relation.c", "line": "3235", "routine": "errorMissingRTE" }

Comment by Mike Taylor [ 31/Mar/21 ]

I've verified that the query being sent by UI is good.

When you use the Location filter to select "Main Library", the query is

copiedItem.permanentLocationId=="fcd64ce1-6995-48f0-840e-89ffa2288371"

whereas when you use the Copyright status filter to select "CC By", the query is

copyrightTracking.copyrightStatusId=="0a598dcc-237f-4d74-8444-9ac5a8f9d4a8"

which is structurally correct.

Not only that, but this same query did work in the past — when I committed it to master — so evidently what's happened here is a regression in the backend such that it no longer supports the copyrightTracking.copyrightStatusId index.

Comment by Mike Taylor [ 31/Mar/21 ]

Based on the detailed error message (and thank you, back-end module, for being so informative!), the SQL query that's generated for this is:

EXPLAIN SELECT * FROM diku_mod_courses.coursereserves_reserves WHERE copyrightTracking.copyrightStatusId='0a598dcc-237f-4d74-8444-9ac5a8f9d4a8'

which looks superficially OK to me. (But then I am not an SQL expert and don't even know what the EXPLAIN means, so we will really need a back-ender on this.)

At any rate, I don't think there's any inherent reason why this query should result in being told "missing FROM-clause entry" — the FROM clause it right there — so something subtler is going on.

Kurt Nordstrom Is this in your wheelhouse, or is it down in the low-level PostgreSQL code such that we'd need someone like Julian Ladisch?

Comment by Kelly Drake [ 05/Apr/21 ]

Kurt Nordstrom - Do you think this could be fixed this week? ie during bugfest?

Comment by Anya [ 05/Apr/21 ]

Support: This was found in bugfest as well, Kelly Drake is working on this. 

Comment by Kurt Nordstrom [ 06/Apr/21 ]

This appears to be a regression of RMB-585

Comment by Mike Taylor [ 07/Apr/21 ]

That's bad: it means that we will get a fix in the Courses app only when:

  • The bug is re-fixed in RMB
  • A new RMB is released
  • mod-courses can be updated to depend on that new RMB
  • mod-courses is released.

I don't know whether that can be done during the bugfest period.

Comment by Julian Ladisch [ 07/Apr/21 ]

This can be done during bugfest period if it has higher priority than P3.

Comment by Kelly Drake [ 08/Apr/21 ]

Julian Ladisch If it can be done, I popped it up to a P2.  That was it's original priority. We have two libraries using the CR app that have a high need for this.  There is a current, but laborious workaround. 

Comment by Anya [ 12/Apr/21 ]

Kelly Drake / Julian Ladisch : support comment: should this be moved out of blocked into something else - it appears this issue is in RMB... 

Comment by Kelly Drake [ 19/Apr/21 ]

Hi Kurt Nordstrom,

Capacity Planning is putting this back to you - probably should also be xfered to mod-cr?

RMB-586 Closed is in progress

Comment by Jakub Skoczen [ 21/Apr/21 ]

Kurt Nordstrom RMB-586 Closed is resolved and Adam will release RMB 32.2.1 momentarily.

Comment by Kelly Drake [ 21/Apr/21 ]

Thank you Jakub SkoczenKurt Nordstrom - let me know if/when I should test!

Comment by Kelly Drake [ 22/Apr/21 ]

Kurt Nordstrom  - I just tested in snapshot.dev.folio and got the following error:

 

Am I testing in the right place?  (this error message seems new)

Comment by Julian Ladisch [ 23/Apr/21 ]

Kelly, you are right, the fix is not sufficient. Second fix is on the way: RMB-830 Closed

Comment by Julian Ladisch [ 23/Apr/21 ]

Pull request ready but blocked by release of RMB 32.2.2: https://github.com/folio-org/mod-courses/pull/119

Comment by Kelly Drake [ 23/Apr/21 ]

Julian Ladisch - Thanks for the update!

 

Comment by Julian Ladisch [ 23/Apr/21 ]

Kurt Nordstrom and Thor team: Please code review, merge, and release!

RMB 32.2.2 has been released, the pull request builds and all checks succeed.

Generated at Fri Feb 09 00:27:38 UTC 2024 using Jira 1001.0.0-SNAPSHOT#100246-sha1:7a5c50119eb0633d306e14180817ddef5e80c75d.