This was observed during the use of JCP Extension developed using Java SDK.
Step 1: Configured Extension Base URL as https://689f-152-58-225-159.ngrok-free.app
Step 2: Installed the extension
Step 3: Performed partnerPlatformService.addProxyPath [ proxy path is ‘whatsappotp’ ]
Step 4: Restarted the ngrok server and reconfigured the extension with the new base url: https://0c28-152-58-225-223.ngrok-free.app
Step 5: Removed the previously installed Extension and reconfigured the Extencion with the new base url: https://0c28-152-58-225-223.ngrok-free.app
Step 6: Re-installed the extension
Step 7: Performed partnerPlatformService.addProxyPath gives the below mentioned error:
com.sdk.common.model.FDKServerResponseError: HTTP responseCode: 400 responseBody :{“code”:“”,“message”:“Already Present”,“meta”:{“attached_path”:“whatsappotp”,“proxy_url”:“https://689f-152-58-225-159.ngrok-free.app/app/proxy”}}
Step 8: Performed partnerPlatformService.removeProxyPath gives “Not Found” error.
Finally unable to use ‘whatsappotp’ proxy path using different extension base url [ incase if we missed to remove the added proxy path using prior extension base url]
2023-12-26T22:04:03.830+05:30 ERROR 1 — [p-nio-80-exec-3] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed: com.sdk.common.model.FDKServerResponseError: HTTP responseCode: 400 responseBody :{“code”:“”,“message”:“Already Present”,“meta”:{“attached_path”:“jmshipmentfee”,“proxy_url”:“https://f28c-152-58-225-153.ngrok-free.app/app/proxy”}}] with root cause
For this URL : https://689f-152-58-225-159.ngrok-free.app/app/proxy
I can see the proxy is created with whatsappotp for extension_id ‘652fdb53131787fba1d5c2d1’ for company 4. If you want to change the base URL, please uninstall the extension first which should delete the created proxy and update the base URL and then again create the proxy using addProxyPath method.
@Karan_Kaneria - This is not viable for the base url generated by ngrok.
Since we forgot to remove the proxyPath, before restarting the ngrok server, it will be hard to get back the same previous ngrok url again. Hence we require, some solution from JCP Core for rectifying this issue completely 100%.
@Pitchaimani as discussed uninstalling your extension and then re installing your will work here in resolving the issue as it will remove the previous created URL.