502 Error in establishing connection and 'fetch failed` message

Last week, I was testing the serverless feature and successfully connecting to two different APIs from the same script. However, today I’m encountering a 502 error and a fetch failed message.

I’ve tried the following troubleshooting steps without success:

  • Created a new project from scratch
  • Downgraded the FDK from version 9.5 to 9.3.2
  • Cleared DNS cache
  • Verified the same setup works for my colleague. Sent him the code and he was able to connect.

I’m running the app locally, and despite these efforts, nothing seems to resolve the issue.

Would appreciate any guidance or suggestions you might have.

Hi :wave: @Mo-cds,

Thanks for sharing the detailed info. Since you’re encountering a 502 error while using the Serverless feature in Freshworks apps, and especially since the same code works fine for your colleague, this sounds like an environment or local machine-specific issue rather than an issue with your code or the platform itself.

  • Double-check Endpoint Access and CORS Policy
  • Enable FDK Debug Logs
  • Try Switching Network or VPN
  • Check if You’re Behind a Proxy
  • Use Postman or curl to Test API
  • Clean FDK Cache
    rm -rf .fdk
    fdk run
  • Final Tip — Use request Event for Logging
1 Like

Hello @Mo-cds,

Can you please share the source code to check if everything is good? Of course sanitise the code for any sensitive information and share it.