wso2 / product-apim

Welcome to the WSO2 API Manager source code! For info on working with the WSO2 API Manager repository and contributing code, click the link below.
http://wso2.github.io/
Apache License 2.0
846 stars 785 forks source link

Failed to get API Revision deployment mapping details for api uuid... #12169

Closed a4systems-sford closed 8 months ago

a4systems-sford commented 2 years ago

Description:

When accessing the publisher page an error happens because of union between incompatible types. The underlying query attempts to create a union between two records with one column as an integer _0 AS DISPLAY_ONDEVPORTAL and the other column is defined as a boolean. SQL requires that both types be implicitly castable to each type of which a boolean cannot be cast to an integer wihtin the spec.

SELECT *
FROM (SELECT NAME, VHOST, REVISION_UUID, DEPLOYED_TIME, 0 AS DISPLAY_ON_DEVPORTAL, NULL AS DEPLOY_TIME
      FROM AM_DEPLOYED_REVISION DR
      UNION
      SELECT NAME, VHOST, REVISION_UUID, NULL AS DEPLOYED_TIME, DISPLAY_ON_DEVPORTAL, DEPLOYED_TIME AS DEPLOY_TIME
      FROM AM_DEPLOYMENT_REVISION_MAPPING DRM) AD
WHERE AD.REVISION_UUID IN
      (SELECT REVISION_UUID FROM AM_REVISION WHERE API_UUID = '5be231f5-4236-4f37-b17c-24df8b8d3b9d')

{"code":500,"message":"Internal server error","description":"Error while adding retrieving API Revision for api id : 88cbebed-5de5-4b0b-8ceb-a87c8172b468 - Failed to get API Revision deployment mapping details for api uuid: 88cbebed-5de5-4b0b-8ceb-a87c8172b468","moreInfo":"","error":[]}

Steps to reproduce:

Install the latest version of APIM (4.1.0-m2) migrate to Postgres 13.2 as the DB and attempt to create any api revision.

Affected Product Version:

APIM (4.1.0-m2) 4.x.x

Environment details (with versions):

Distributor ID: Ubuntu Description: Ubuntu 20.04.3 LTS Release: 20.04 Codename: focal


Optional Fields

Related Issues:

Suggested Labels:

Suggested Assignees:

chamilaadhi commented 8 months ago

Please check with the latest 4.1.0 U2 updated pack https://wso2.com/updates/#update or try with the latest APIM 4.2.0