docker-partkeepr icon indicating copy to clipboard operation
docker-partkeepr copied to clipboard

octopart search not working

Open flashfingaz opened this issue 4 years ago • 2 comments

fresh install, added octopart api key and got error 500 when trying to fetch data (everything else works fine):

[2021-01-22 20:56:35] request.CRITICAL: Uncaught PHP Exception Guzzle\Http\Exception\ClientErrorResponseException: "Client error response [status code] 401 [reason phrase] Unauthorized [url] http://octopart.com/api/v3/parts/search?apikey=[MY-API-KEY-LIVES-HERE]&q=esp32&start=0&include%5B0%5D=short_description&include%5B1%5D=specs&include%5B2%5D=datasheets&limit=20" at /var/www/html/vendor/guzzle/guzzle/src/Guzzle/Http/Exception/BadResponseException.php line 43 {"exception":"[object] (Guzzle\Http\Exception\ClientErrorResponseException(code: 0): Client error response\n[status code] 401\n[reason phrase] Unauthorized\n[url] http://octopart.com/api/v3/parts/search?apikey=XXXXXXXXXXXXXX&q=esp32&start=0&include%5B0%5D=short_description&include%5B1%5D=specs&include%5B2%5D=datasheets&limit=20 at /var/www/html/vendor/guzzle/guzzle/src/Guzzle/Http/Exception/BadResponseException.php:43)"} []

turns out that:

  1. partkeepr release used by your docker image uses api v3
  2. octopart is not issuing v3 api keys anymore
  3. v4 api integration has been merged into master already: https://github.com/partkeepr/PartKeepr/pull/1150

in conclusion everyone that has not yet got an api key will not be able to use octoparts with the docker image

so my suggestion would be to build the docker image against git, or at least create a variant that would do so. would make me very happy :)

flashfingaz avatar Jan 22 '21 20:01 flashfingaz

For a short term fix, go into: "src/PartKeepr/OctoPartBundle/Services/OctoPartService.php" and change the "/v3/" to "/v4/rest".

This will allow you to use your v4 api key.

twilkie12 avatar May 15 '21 08:05 twilkie12

do you do this using the interactive shell on docker?

jumper385 avatar Dec 02 '22 00:12 jumper385