Open shoutbomb opened 5 years ago
If you search the catalog/PowerPAC on your Polaris system are there any results for the keywords "Harry Potter"? If not then that would explain why no results are being returned.
I am also getting the same issue. When I try to use the search, I get NULL results, even though they do work fine in the PAC.
I also notice that I get an ERR_CONNECTION_RESET issue if I try any of the other examples. I can hit the API directly and use the Swagger instance, so I know the information is correct.
Not sure what I am doing wrong, any ideas on what to try?
@mpl-cwassen That's an odd one. I searched everywhere for that error message including in our codebase and in the Polaris API documentation. I don't see that error message listed anywhere. Are there any more details to the error message like an error code number?
It isn't giving any error numbers, unfortunately. I did turn on all PHP errors, and it doesn't display any either. I noticed that this repo uses guzzle. Is there any way to turn on any type of debugging with it?
I am using a WAMP box for development testing with PHP 7.3.1 if that makes any difference.
It looks like I was able to get an error to pop up. This is what I am getting: [27-Sep-2021 19:03:29 UTC] PHP Notice: Trying to get property 'AccessToken' of non-object in D:\wamp64\www\cody\browse\polaris-api\src\Request.php on line 203 [27-Sep-2021 19:03:29 UTC] PHP Stack trace: [27-Sep-2021 19:03:29 UTC] PHP 1. {main}() D:\wamp64\www\cody\browse\polaris-api\example.php:0 [27-Sep-2021 19:03:29 UTC] PHP 2. RCPL\Polaris\Entity\Patron->data() D:\wamp64\www\cody\browse\polaris-api\example.php:30 [27-Sep-2021 19:03:29 UTC] PHP 3. RCPL\Polaris\Entity\Patron->get() D:\wamp64\www\cody\browse\polaris-api\src\Entity\Patron.php:153 [27-Sep-2021 19:03:29 UTC] PHP 4. RCPL\Polaris\Request->staff() D:\wamp64\www\cody\browse\polaris-api\src\Entity\Patron.php:387
It sounds like the staff authentication piece isn't working. Can you verify that on lines 8-16 of example.php you've entered in the credentials for your Polaris instance?
Yes, I have all the information filled out in the example and I have tested it using the swagger interface, so I know it can connect.
I tried using the example on the front page and refilled it out, just to be sure, and I am still getting the same error.
What is also interesting is I don't see any traffic in the PAPI logs. I do when I use the Polaris PHP examples, but I don't see any using this repo. I have the HOST as my URL of 'my.library.com' - is this correct or should it be something else?
I have gotten a little further and I am now seeing the following errors:
[27-Sep-2021 19:03:33 UTC] PHP 3. RCPL\Polaris\Entity\Patron->get() D:\wamp64\www\cody\browse\polaris-api\src\Entity\Patron.php:153 [27-Sep-2021 19:03:33 UTC] PHP 4. RCPL\Polaris\Request->staff() D:\wamp64\www\cody\browse\polaris-api\src\Entity\Patron.php:387
@mpl-cwassen No, "my.library.com" wouldn't be your Polaris server. The HOST is the domain name or IP address that you're trying to connect to.
I was just using the my.library.com as an example. I am using our real host.
It appears to be an issue with Guzzler, I believe. It never sends the request to the host. I am trying to do some debugging to see why it fails to contact the host.
I found some additional information on why it isn't working.
Apparently, there is an issue with Guzzle and Windows 10. For some reason, it causes custom headers to not send. They have some information of a similar incident at https://github.com/guzzle/guzzle/issues/1413 that has to do when you enable debug mode. Looking at similar issues says that Windows 10 causes custom headers to not send and in return causes the tokens to not be included in the request. They said it could also possibly be an Apache issue or an issue with single threaded PHP requests. They were unable to replicate the issue, so it doesn't appear a solution was found.
I have created a VM with Debian and NIGIX, and I was able to get the code to work without issue. So at this time, it doesn't look like this will work on a Windows box.
I hope this helps.
I am a third party supporting a library. Using your example.php to validate some changes I would like to make. Providing all the 'client' parameters with the exception of the DEFAULT_PATRON_BRANCH_ID. The first test for a list of titles returned NULL.
1) Pulling a list of 25 titles w/ keyword "Harry Potter" using 'BibSearch'; $result = $client->bibliography->search('Harry Potter', ['bibsperpage' => 25]); Kint::dump($result);
Any suggestions to debug this issue?