Toolbox is returning HTTPForbidden 403 error when trying to copy an API Product
Environment
- Red Hat 3scale API Management
- 2 (On Premise)
- SaaS
Issue
- Toolbox copy command is failing.
- When using Toolbox to copy an
API Product
from a 3scale admin portal source into a destination 3scale admin portal, a 403 forbidden error trace is raised.
Resolution
1) Create a new access token from the 3scale source installation with all the permissions selected (read & write)
2) Create a new access token from the 3scale target installation with all the permissions selected (read & write)
3) Try again the copy command with the new access tokens generated in the previous steps:
3scale copy service -t “destination_API_Product_name” -s “https://<new_access_token_source>@<source-3scale-admin-portal-domain> -d “https://<new_access_token_destination>@<destination-3scale-admin-portal-domain> <Product API.System Name>
Root Cause
- It is very likely that the value used as the access token for the 3scale source installation or the 3scale target installation is not correct.
Diagnostic Steps
Toolbox copy command output shows a stack trace like the following:
{
"code": "E_UNKNOWN",
"message": "#<Net::HTTPForbidden 403 Forbidden readbody=true> body={\"status\":\"Forbidden\"}",
"class": "ThreeScale::API::HttpClient::ForbiddenError",
"stacktrace": [
"/var/lib/gems/3.1.0/gems/3scale-api-1.6.0/lib/3scale/api/http_client.rb:86:in `forbidden!'",
"/var/lib/gems/3.1.0/gems/3scale-api-1.6.0/lib/3scale/api/http_client.rb:71:in `parse'",
"/var/lib/gems/3.1.0/gems/3scale-api-1.6.0/lib/3scale/api/http_client.rb:40:in `get'",
"/var/lib/gems/3.1.0/gems/3scale-api-1.6.0/lib/3scale/api/client.rb:1033:in `list_backend_usages'",
"/var/lib/gems/3.1.0/gems/3scale_toolbox-1.0.1/lib/3scale_toolbox/remote_cache.rb:186:in `public_send'",
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Comments