401 Client Error: Unauthorized for Access token - Access token could not be verified #1
Closed
1 of 3 tasks
Labels
bug
Something isn't working
**I'm submitting a ... **
What is the current behavior?
Traceback (most recent call last):
File "...\virtualenvs\shopware-automation-OzY02_Lq-py3.10\lib\site-packages\lib_shopware6_api_base\lib_shopware6_api_base.py", line 753, in _request
response.raise_for_status()
File "...\Cache\virtualenvs\shopware-automation-OzY02_Lq-py3.10\lib\site-packages\requests\models.py", line 960, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: XXX/api/search/product-media
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "...\Cache\virtualenvs\shopware-automation-OzY02_Lq-py3.10\lib\site-packages\click\core.py", line 1055, in main
rv = self.invoke(ctx)
File "...\Cache\virtualenvs\shopware-automation-OzY02_Lq-py3.10\lib\site-packages\click\core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "...\Cache\virtualenvs\shopware-automation-OzY02_Lq-py3.10\lib\site-packages\click\core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "...\Cache\virtualenvs\shopware-automation-OzY02_Lq-py3.10\lib\site-packages\typer\main.py", line 500, in wrapper
return callback(**use_params) # type: ignore
File ".../shopware_automation/main.py", line 39, in main
product_media = api.product.search_product_medias(payload=filter)
File "...\Cache\virtualenvs\shopware-automation-OzY02_Lq-py3.10\lib\site-packages\lib_shopware6_api\sub_product.py", line 533, in search_product_medias
response_dict = self._admin_client.request_post_paginated("search/product-media", payload)
File "...\Cache\virtualenvs\shopware-automation-OzY02_Lq-py3.10\lib\site-packages\lib_shopware6_api_base\lib_shopware6_api_base.py", line 538, in request_post_paginated
response_dict = self._request_paginated(http_method="post", request_url=request_url, payload=payload, junk_size=junk_size)
File "...\Cache\virtualenvs\shopware-automation-OzY02_Lq-py3.10\lib\site-packages\lib_shopware6_api_base\lib_shopware6_api_base.py", line 633, in _request_paginated
partial_data = self._make_request(http_method=http_method, request_url=request_url, payload=payload_dict)
File "...\Cache\virtualenvs\shopware-automation-OzY02_Lq-py3.10\lib\site-packages\lib_shopware6_api_base\lib_shopware6_api_base.py", line 698, in _make_request
response = self._request(http_method=http_method, request_url=request_url, payload=payload_dict)
File "...\Cache\virtualenvs\shopware-automation-OzY02_Lq-py3.10\lib\site-packages\lib_shopware6_api_base\lib_shopware6_api_base.py", line 759, in _request
raise ShopwareAPIError(f"{exc}{detailed_error}")
lib_shopware6_api_base.conf_shopware6_api_base_classes.ShopwareAPIError: 401 Client Error: Unauthorized for url: XXX/api/search/product-media : {"errors":[{"code":"9","status":"401","title":"The resource owner or authorization server denied the request.","detail":"Access token could not be verified"}]}
**If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem
After arround 10 minutes the server error occure. Sometimes the error occure, sometimes not.
Looks like Server API Error. If you catch exeption and retry the request the API get a new token.
What is the expected behavior?
get refresh token without error
Please tell us about your environment:
The text was updated successfully, but these errors were encountered: