Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Importing part from LCSC no longer possible with V1.14.5 #790

Open
mkne opened this issue Dec 6, 2024 · 1 comment · Fixed by #795
Open

Importing part from LCSC no longer possible with V1.14.5 #790

mkne opened this issue Dec 6, 2024 · 1 comment · Fixed by #795
Labels
bug Something isn't working

Comments

@mkne
Copy link
Contributor

mkne commented Dec 6, 2024

Describe the bug
After updating the docker image to V1.14.5 from V1.14.4 importing parts from Information Provider LCSC does no longer work and results in a Error 500 message. Deleting the cache with "sudo docker exec --user=www-data partdb php bin/console cache:clear" didn't help. This happens for different users and I made sure that we logged out and logged in after the update of Part-DB.

To Reproduce

Expected behavior
Results page with the parts found at LCSC.com

Screenshots
InternalServerError

Server Side

  • Part-DB Version: V1.14.5
  • PHP Version: 8.3.14
  • Symfony version: 6.4.16
  • Database Server SQLite

Desktop (please complete the following information):

  • OS: Windows 11
  • Browser: Chrome, Edge
  • Version Chrome 131.0.6778.109

Additional context
#0 /var/www/html/var/cache/docker/ContainerGsNYtPT/App_KernelDockerContainer.php(201): ContainerGsNYtPT\getAndroidSafetyNetAttestationStatementSupportService::do()
#1 /var/www/html/var/cache/docker/ContainerGsNYtPT/App_KernelDockerContainer.php(932): ContainerGsNYtPT\App_KernelDockerContainer->load()
#2 /var/www/html/var/cache/docker/ContainerGsNYtPT/App_KernelDockerContainer.php(2497): ContainerGsNYtPT\App_KernelDockerContainer::getAttestationStatementSupportManagerService()
#3 /var/www/html/var/cache/docker/ContainerGsNYtPT/App_KernelDockerContainer.php(1236): ContainerGsNYtPT\App_KernelDockerContainer::getSerializerService()
#4 /var/www/html/var/cache/docker/ContainerGsNYtPT/App_KernelDockerContainer.php(393): ContainerGsNYtPT\App_KernelDockerContainer::getApiPlatform_Listener_Request_DeserializeService()
#5 /var/www/html/vendor/symfony/event-dispatcher/EventDispatcher.php(257): ContainerGsNYtPT\App_KernelDockerContainer::ContainerGsNYtPT\{closure}()
#6 /var/www/html/vendor/symfony/event-dispatcher/EventDispatcher.php(220): Symfony\Component\EventDispatcher\EventDispatcher::Symfony\Component\EventDispatcher\{closure}()
#7 /var/www/html/vendor/symfony/event-dispatcher/EventDispatcher.php(56): Symfony\Component\EventDispatcher\EventDispatcher->callListeners()
#8 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(157): Symfony\Component\EventDispatcher\EventDispatcher->dispatch()
#9 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
#10 /var/www/html/vendor/symfony/http-kernel/Kernel.php(197): Symfony\Component\HttpKernel\HttpKernel->handle()
#11 /var/www/html/vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php(35): Symfony\Component\HttpKernel\Kernel->handle()
#12 /var/www/html/vendor/autoload_runtime.php(29): Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run()
#13 /var/www/html/public/index.php(5): require_once()
#14 {main}
"} {"token":{"authenticated":true,"roles":["ROLE_USER"],"user_identifier":"MyUser"},"url":"/de/tools/info_providers/search","ip":"x.x.x.x","http_method":"POST","server":"172.16.0.56","referrer":"http://172.16.0.56:8080/de/tools/info_providers/search"}
[2024-12-06T06:57:18.085624+00:00] cache.INFO: Lock acquired, now computing item "search_lcsc_C253558" {"key":"search_lcsc_C253558"} {"token":{"authenticated":true,"roles":["ROLE_USER"],"user_identifier":"MyUser"},"url":"/de/tools/info_providers/search","ip":"x.x.x.x","http_method":"POST","server":"172.16.0.56","referrer":"http://172.16.0.56:8080/de/tools/info_providers/search"}
[2024-12-06T06:57:18.086136+00:00] http_client.INFO: Request: "GET https://wmsc.lcsc.com/ftps/wm/search/global?keyword=C253558" [] {"token":{"authenticated":true,"roles":["ROLE_USER"],"user_identifier":"MyUser"},"url":"/de/tools/info_providers/search","ip":"x.x.x.x","http_method":"POST","server":"172.16.0.56","referrer":"http://172.16.0.56:8080/de/tools/info_providers/search"}
[2024-12-06T06:57:18.210381+00:00] http_client.INFO: Response: "200 https://wmsc.lcsc.com/ftps/wm/search/global?keyword=C253558" [] {"token":{"authenticated":true,"roles":["ROLE_USER"],"user_identifier":"MyUser"},"url":"/de/tools/info_providers/search","ip":"x.x.x.x","http_method":"POST","server":"172.16.0.56","referrer":"http://172.16.0.56:8080/de/tools/info_providers/search"}
[2024-12-06T06:57:18.210679+00:00] http_client.INFO: Request: "GET https://wmsc.lcsc.com/ftps/wm/product/detail?productCode=C253558" [] {"token":{"authenticated":true,"roles":["ROLE_USER"],"user_identifier":"MyUser"},"url":"/de/tools/info_providers/search","ip":"x.x.x.x","http_method":"POST","server":"172.16.0.56","referrer":"http://172.16.0.56:8080/de/tools/info_providers/search"}
[2024-12-06T06:57:18.310531+00:00] http_client.INFO: Response: "200 https://wmsc.lcsc.com/ftps/wm/product/detail?productCode=C253558" [] {"token":{"authenticated":true,"roles":["ROLE_USER"],"user_identifier":"MyUser"},"url":"/de/tools/info_providers/search","ip":"x.x.x.x","http_method":"POST","server":"172.16.0.56","referrer":"http://172.16.0.56:8080/de/tools/info_providers/search"}
[2024-12-06T06:57:18.310912+00:00] http_client.INFO: Request: "GET https://datasheet.lcsc.com/lcsc/2304140030_Analog-Devices-AD620ARZ-REEL_C253558.pdf" [] {"token":{"authenticated":true,"roles":["ROLE_USER"],"user_identifier":"MyUser"},"url":"/de/tools/info_providers/search","ip":"x.x.x.x","http_method":"POST","server":"172.16.0.56","referrer":"http://172.16.0.56:8080/de/tools/info_providers/search"}
[2024-12-06T06:57:18.476618+00:00] http_client.INFO: Response: "502 https://datasheet.lcsc.com/lcsc/2304140030_Analog-Devices-AD620ARZ-REEL_C253558.pdf" [] {"token":{"authenticated":true,"roles":["ROLE_USER"],"user_identifier":"MyUser"},"url":"/de/tools/info_providers/search","ip":"x.x.x.x","http_method":"POST","server":"172.16.0.56","referrer":"http://172.16.0.56:8080/de/tools/info_providers/search"}
[2024-12-06T06:57:18.477175+00:00] request.CRITICAL: Uncaught PHP Exception Symfony\Component\HttpClient\Exception\ServerException: "HTTP/2 502 returned for "https://datasheet.lcsc.com/lcsc/2304140030_Analog-Devices-AD620ARZ-REEL_C253558.pdf"." at CommonResponseTrait.php line 169 {"exception":"[object] (Symfony\Component\HttpClient\Exception\ServerException(code: 502): HTTP/2 502 returned for "https://datasheet.lcsc.com/lcsc/2304140030_Analog-Devices-AD620ARZ-REEL_C253558.pdf\". at /var/www/html/vendor/symfony/http-client/Response/CommonResponseTrait.php:169)
[stacktrace]
#0 /var/www/html/vendor/symfony/http-client/Response/CommonResponseTrait.php(47): Symfony\Component\HttpClient\Response\CurlResponse->checkStatusCode()
#1 /var/www/html/vendor/symfony/http-client/Response/CurlResponse.php(229): Symfony\Component\HttpClient\Response\CurlResponse->doGetContent()
#2 /var/www/html/src/Services/InfoProviderSystem/Providers/LCSCProvider.php(105): Symfony\Component\HttpClient\Response\CurlResponse->getContent()
#3 /var/www/html/src/Services/InfoProviderSystem/Providers/LCSCProvider.php(298): App\Services\InfoProviderSystem\Providers\LCSCProvider->getRealDatasheetUrl()
#4 /var/www/html/src/Services/InfoProviderSystem/Providers/LCSCProvider.php(212): App\Services\InfoProviderSystem\Providers\LCSCProvider->getProductDatasheets()
#5 /var/www/html/src/Services/InfoProviderSystem/Providers/LCSCProvider.php(90): App\Services\InfoProviderSystem\Providers\LCSCProvider->getPartDetail()
#6 /var/www/html/src/Services/InfoProviderSystem/Providers/LCSCProvider.php(143): App\Services\InfoProviderSystem\Providers\LCSCProvider->queryDetail()
#7 /var/www/html/src/Services/InfoProviderSystem/Providers/LCSCProvider.php(336): App\Services\InfoProviderSystem\Providers\LCSCProvider->queryByTerm()
#8 /var/www/html/src/Services/InfoProviderSystem/PartInfoRetriever.php(82): App\Services\InfoProviderSystem\Providers\LCSCProvider->searchByKeyword()
#9 /var/www/html/vendor/symfony/cache/LockRegistry.php(111): App\Services\InfoProviderSystem\PartInfoRetriever->App\Services\InfoProviderSystem\{closure}()
#10 /var/www/html/vendor/symfony/cache/Traits/ContractsTrait.php(102): Symfony\Component\Cache\LockRegistry::compute()
#11 /var/www/html/vendor/symfony/cache-contracts/CacheTrait.php(64): Symfony\Component\Cache\Adapter\AbstractAdapter->Symfony\Component\Cache\Traits\{closure}()
#12 /var/www/html/vendor/symfony/cache/Traits/ContractsTrait.php(85): Symfony\Component\Cache\Adapter\AbstractAdapter->contractsGet()
#13 /var/www/html/vendor/symfony/cache-contracts/CacheTrait.php(30): Symfony\Component\Cache\Adapter\AbstractAdapter->doGet()
#14 /var/www/html/src/Services/InfoProviderSystem/PartInfoRetriever.php(78): Symfony\Component\Cache\Adapter\AbstractAdapter->get()
#15 /var/www/html/src/Services/InfoProviderSystem/PartInfoRetriever.php(64): App\Services\InfoProviderSystem\PartInfoRetriever->searchInProvider()
#16 /var/www/html/src/Controller/InfoProviderController.php(83): App\Services\InfoProviderSystem\PartInfoRetriever->searchByKeyword()
#17 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(181): App\Controller\InfoProviderController->search()
#18 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
#19 /var/www/html/vendor/symfony/http-kernel/Kernel.php(197): Symfony\Component\HttpKernel\HttpKernel->handle()
#20 /var/www/html/vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php(35): Symfony\Component\HttpKernel\Kernel->handle()
#21 /var/www/html/vendor/autoload_runtime.php(29): Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run()
#22 /var/www/html/public/index.php(5): require_once('...')
#23 {main}
"} {"token":{"authenticated":true,"roles":["ROLE_USER"],"user_identifier":"MyUser"},"url":"/de/tools/info_providers/search","ip":"x.x.x.x","http_method":"POST","server":"172.16.0.56","referrer":"http://172.16.0.56:8080/de/tools/info_providers/search"}

@mkne mkne added the bug Something isn't working label Dec 6, 2024
@vvekic
Copy link
Contributor

vvekic commented Dec 8, 2024

It would seem LCSC responds with 502, regardless of request header.
Looking at the LCSC page, the datasheet URL differs from the one in the JSON returned by /ftps/wm/product/detail.

Example:

Maybe this simple rewrite can be implemented in the LCSCProvider.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants