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

While deploying and un-deploying getting the Storage returned null on logs #2264

Closed
dumindurox777 opened this issue Nov 10, 2023 · 0 comments

Comments

@dumindurox777
Copy link

Problem

We have followed the below steps and observed some unexpected behaviour in the Deployments
Section of the APIM publisher portal.

Reproducing steps[1]:

Configure two gateways(Production/Sandbox) with one control plane node[1]
Then created a New API.
It assigns a Business Plans -> Unlimited : Allows unlimited requests
The API is deployed only in the Production GW
Lifecycle goes to Published status
Then the following 2 operations are carried out very quickly
GW - Sandbox - Deploy
GW - Production - UNDeploy.
Able to see below error on the Sandbox gateway.

[2023-11-03 09:50:49,880] ERROR - InMemoryAPIDeployer Error retrieving artifacts for API e4899b5f-c36a-4ef1-81ce-6a6814a1faa0. Storage returned null
[2023-11-03 09:50:49,890] ERROR - InMemoryAPIDeployer Error deploying e4899b5f-c36a-4ef1-81ce-6a6814a1faa0 in Gateway
org.wso2.carbon.apimgt.impl.gatewayartifactsynchronizer.exception.ArtifactSynchronizerException: Error retrieving artifacts for API e4899b5f-c36a-4ef1-81ce-6a6814a1faa0. Storage returned null
	at org.wso2.carbon.apimgt.gateway.InMemoryAPIDeployer.retrieveArtifact_aroundBody4(InMemoryAPIDeployer.java:173) ~[org.wso2.carbon.apimgt.gateway_9.20.74.220.jar:?]
	at org.wso2.carbon.apimgt.gateway.InMemoryAPIDeployer.retrieveArtifact(InMemoryAPIDeployer.java:158) ~[org.wso2.carbon.apimgt.gateway_9.20.74.220.jar:?]
	at org.wso2.carbon.apimgt.gateway.InMemoryAPIDeployer.deployAPI_aroundBody0(InMemoryAPIDeployer.java:94) ~[org.wso2.carbon.apimgt.gateway_9.20.74.220.jar:?]
	at org.wso2.carbon.apimgt.gateway.InMemoryAPIDeployer.deployAPI(InMemoryAPIDeployer.java:89) ~[org.wso2.carbon.apimgt.gateway_9.20.74.220.jar:?]
	at org.wso2.carbon.apimgt.gateway.listeners.GatewayJMSMessageListener.lambda$0_aroundBody12(GatewayJMSMessageListener.java:171) ~[org.wso2.carbon.apimgt.gateway_9.20.74.220.jar:?]
	at org.wso2.carbon.apimgt.gateway.listeners.GatewayJMSMessageListener.lambda$0(GatewayJMSMessageListener.java:148) ~[org.wso2.carbon.apimgt.gateway_9.20.74.220.jar:?]
	at java.lang.Thread.run(Thread.java:829) [?:?]
[2023-11-03 09:50:49,890] ERROR - InMemoryAPIDeployer Error deploying e4899b5f-c36a-4ef1-81ce-6a6814a1faa0 in Gateway
org.wso2.carbon.apimgt.impl.gatewayartifactsynchronizer.exception.ArtifactSynchronizerException: Error deploying e4899b5f-c36a-4ef1-81ce-6a6814a1faa0 in Gateway
	at org.wso2.carbon.apimgt.gateway.InMemoryAPIDeployer.retrieveArtifact_aroundBody4(InMemoryAPIDeployer.java:178) ~[org.wso2.carbon.apimgt.gateway_9.20.74.220.jar:?]
	at org.wso2.carbon.apimgt.gateway.InMemoryAPIDeployer.retrieveArtifact(InMemoryAPIDeployer.java:158) ~[org.wso2.carbon.apimgt.gateway_9.20.74.220.jar:?]
	at org.wso2.carbon.apimgt.gateway.InMemoryAPIDeployer.deployAPI_aroundBody0(InMemoryAPIDeployer.java:94) ~[org.wso2.carbon.apimgt.gateway_9.20.74.220.jar:?]
	at org.wso2.carbon.apimgt.gateway.InMemoryAPIDeployer.deployAPI(InMemoryAPIDeployer.java:89) ~[org.wso2.carbon.apimgt.gateway_9.20.74.220.jar:?]
	at org.wso2.carbon.apimgt.gateway.listeners.GatewayJMSMessageListener.lambda$0_aroundBody12(GatewayJMSMessageListener.java:171) ~[org.wso2.carbon.apimgt.gateway_9.20.74.220.jar:?]
	at org.wso2.carbon.apimgt.gateway.listeners.GatewayJMSMessageListener.lambda$0(GatewayJMSMessageListener.java:148) ~[org.wso2.carbon.apimgt.gateway_9.20.74.220.jar:?]
	at java.lang.Thread.run(Thread.java:829) [?:?]
Caused by: org.wso2.carbon.apimgt.impl.gatewayartifactsynchronizer.exception.ArtifactSynchronizerException: Error retrieving artifacts for API e4899b5f-c36a-4ef1-81ce-6a6814a1faa0. Storage returned null
	at org.wso2.carbon.apimgt.gateway.InMemoryAPIDeployer.retrieveArtifact_aroundBody4(InMemoryAPIDeployer.java:173) ~[org.wso2.carbon.apimgt.gateway_9.20.74.220.jar:?]
	... 6 more

Seem this issue can happen since deploy and un-deploy happens in same time, it can be searching from in memory at the same time.For this simply what we can do we can follow the sequential steps of deployment and un-deploy can be done after giving the couple of second time duration(after deploy the api on sandbox gateway)

But our concern is without considering the error on the backend from publisher portal it always changing the state of the api deployment without considering the error on the backend.
Screenshot 2023-11-10 at 12 35 31

This seems to be a UI issue . Kindly check this behavior and let us know the feedback on this.

Please find the deployment.toml configurations below in the artifacts.zip which we have used for my local setup. Simply creating the new mysql apim_db ,shared_db and point it to the relevant packs, can try out the flow.
artifacts.zip

[1] https://apim.docs.wso2.com/en/latest/deploy-and-publish/deploy-on-gateway/deploy-api/deploy-through-multiple-api-gateways/

Best regards,
Dumindu.

Solution

Seems some related fix going on this wso2/carbon-apimgt#11249

Affected Component

APIM

Version

4.1.0

Implementation

No response

Related Issues

No response

Suggested Labels

apim-4.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants