ramgrandhi / serverless-wso2-apim

Serverless Framework plugin to manage APIs on WSO2 API Manager.
MIT License
10 stars 13 forks source link

Error re-deploying APIs previously deleted manually #100

Open flaviostutz opened 1 year ago

flaviostutz commented 1 year ago

In some cases we face random errors when re-deploying an API with the same name after deleting it manually on WSO2

Steps to reproduce

More info

Sometimes it works well, sometimes the plugin output log seems to be ok, but I see the API wasn't plublished (it's in "created" state), and sometimes I got the following errors on the console:


[serverless-wso2-apim] Upserting Swagger spec for ****-flavio..
[serverless-wso2-apim] Upserting.. OK
{
  response: {
    code: 403,
    message: 'Forbidden',
    description: "You don't have permission to access the API with Id *****",
    moreInfo: '',
    error: []
  },
  responseCode: 403,
  responseHeaders: {
    date: 'Fri, 10 Mar 2023 12:32:43 GMT',
    'content-type': 'application/json',
    'transfer-encoding': 'chunked',
    connection: 'close',
    'set-cookie': [
      '******; Expires=Fri, 17 Mar 2023 12:32:42 GMT; Path=/',
      'AWSALBCORS=*******; Expires=Fri, 17 Mar 2023 12:32:42 GMT; Path=/; SameSite=None; Secure'
    ],
    'x-content-type-options': 'nosniff',
    'x-xss-protection': '1; mode=block',
    server: 'EAPIM Server'
  }
}
[serverless-wso2-apim] An error occurred while retrieving Invokable API URL, proceeding further.

OR

{
  response: {
    code: 500,
    message: 'Internal server error',
    description: 'Error while adding new API : null-[name_of_my_api_here]-v1 - Error while performing registry transaction operation',
    moreInfo: '',
    error: []
  },
  responseCode: 500,
  responseHeaders: {
    date: 'Fri, 10 Mar 2023 12:28:46 GMT',
    'content-type': 'application/json',
    'transfer-encoding': 'chunked',
    connection: 'close',
    'set-cookie': [
      'AWSALB=*****; Expires=Fri, 17 Mar 2023 12:28:45 GMT; Path=/',
      'AWSALBCORS=******; Expires=Fri, 17 Mar 2023 12:28:45 GMT; Path=/; SameSite=None; Secure'
    ],
    'x-content-type-options': 'nosniff',
    'x-xss-protection': '1; mode=block',
    server: 'EAPIM Server'
  }
}
ramgrandhi commented 1 year ago

@flaviostutz - can you test if it still persists with the latest version? It helps to prioritise this issue. Thanks for reporting!