Bug 33481

Summary: EBSCO ws return 415: Content type 'application/octet-stream' not supported
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: ERMAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Marcel de Rooy <m.de.rooy>
Severity: major    
Priority: P5 - low CC: jonathan.druart, jonathan.field, lucas, m.de.rooy, martin.renvoize, pedro.amorim
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.05.00,22.11.05
Bug Depends on: 32030    
Bug Blocks:    
Attachments: Bug 33481: Pass content-type when requesting EBSCO's webservice
Bug 33481: Pass content-type when requesting EBSCO's webservice
Bug 33481: Pass content-type when requesting EBSCO's webservice

Description Jonathan Druart 2023-04-11 11:36:53 UTC
ERROR - EBSCO API /vendors/19/packages/3816 returned 415 - Content type 'application/octet-stream' not supported
[ERROR] PATCH /api/v1/erm/eholdings/ebsco/packages/19-3816: unhandled exception (Mojo::Exception)<<ERROR requesting EBSCO API
/vendors/19/packages/3816
code 415: Content type 'application/octet-stream' not supported>>
Comment 1 Jonathan Druart 2023-04-11 11:37:32 UTC
Created attachment 149434 [details] [review]
Bug 33481: Pass content-type when requesting EBSCO's webservice
Comment 2 Pedro Amorim 2023-04-11 12:08:48 UTC
Created attachment 149436 [details] [review]
Bug 33481: Pass content-type when requesting EBSCO's webservice

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Comment 3 Pedro Amorim 2023-04-11 12:17:08 UTC
It appears that some update on EBSCO's end has started to cause this error (tighter validation?).
It also appears we should be sending the request header in the first place anyway, and we weren't.

https://developer.ebsco.com/knowledge-services/holdingsiq/code-samples

The patch fixes the "add packages to holdings" button bug, sample link to reproduce:
http://localhost:8081/cgi-bin/koha/erm/eholdings/ebsco/packages/186-3962361


However the same apparent issue is also happening on "add titles to holdings" but not sure yet if related to this or a different bug, logs and console are not showing anything at first glance:
http://localhost:8081/cgi-bin/koha/erm/eholdings/ebsco/resources/19-2691705-28038201
Comment 4 Jonathan Druart 2023-04-11 12:30:50 UTC
(In reply to Pedro Amorim from comment #3)
> However the same apparent issue is also happening on "add titles to
> holdings" but not sure yet if related to this or a different bug, logs and
> console are not showing anything at first glance:
> http://localhost:8081/cgi-bin/koha/erm/eholdings/ebsco/resources/19-2691705-
> 28038201

It works for me on other resources, for instance
/cgi-bin/koha/erm/eholdings/ebsco/resources/19-3754-560226
Comment 5 Pedro Amorim 2023-04-11 17:17:52 UTC
It seems bug 33485 has fixed the EBSCO titles issue.
Comment 6 Marcel de Rooy 2023-04-14 06:22:32 UTC
Created attachment 149634 [details] [review]
Bug 33481: Pass content-type when requesting EBSCO's webservice

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 7 Tomás Cohen Arazi 2023-04-14 14:20:22 UTC
Pushed to master for 23.05.

Nice work everyone, thanks!
Comment 8 Matt Blenkinsop 2023-04-18 12:06:19 UTC
Nice work everyone!

Pushed to stable for 22.11.x