# Getting "Gateway timeout" error while logging into forest admin

**URL:** <https://community.forestadmin.com/t/getting-gateway-timeout-error-while-logging-into-forest-admin/8092>\
**Category:** Help me!\
**Created:** [May 13, 2025, 12:07pm UTC](https://community.forestadmin.com/t/getting-gateway-timeout-error-while-logging-into-forest-admin/8092 "2025-05-13T12:07:19Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ajith](https://avatars.discourse-cdn.com/v4/letter/a/bcef8e/32.png) [@Ajith](https://community.forestadmin.com/u/Ajith)\
**Post date:** [May 13, 2025, 12:07pm UTC](https://community.forestadmin.com/t/getting-gateway-timeout-error-while-logging-into-forest-admin/8092/1 "2025-05-13T12:07:19Z")

</div>

Hi team,  
We are getting the following error in BE logs while logging into the forest admin portal in Production environments  
“Gateway response type: DEFAULT\_5XX with status code: 504”  
PFB the screenshots

 ![Screenshot 2025-05-13 at 12.06.44 PM](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/b/b6d7a35a9de6f5b9418d46ddc519a9f988ba7e82.jpeg)  
 ![Screenshot 2025-05-13 at 12.06.57 PM](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/0/00652fbc841f76d7bb686eb1d6d5d3b99d4b21a9.jpeg)

Note that it is failing only in Production environment under the project.

Due to which, the authentication and subsequent apis are failing

- Project name: Yubi Invest - B2B2C (Unlisted)
- Team name: Ops - Super Admin
- Environment name: Prodcution
- Database type: Postgress

**And, if you are self-hosting your agent:**

- Agent technology: Ruby on Rails
- Agent (forest package) name & version (from your .lock file): forest\_liana (7.7.0)

---

<div class="post-metadata">

**Author:** ![anon7284711](https://avatars.discourse-cdn.com/v4/letter/a/ac8455/32.png) [@anon7284711](https://community.forestadmin.com/u/anon7284711)\
**Post date:** [May 13, 2025, 12:43pm UTC](https://community.forestadmin.com/t/getting-gateway-timeout-error-while-logging-into-forest-admin/8092/2 "2025-05-13T12:43:43Z")

</div>

Hello @Ajith,

Could you please share the request and response (if any) of the failing `/authentication` call we can see in your screenshot.

Do you have any logs on your production environment agent when trying to connect ?

---

<div class="post-metadata">

**Author:** ![Ajith](https://avatars.discourse-cdn.com/v4/letter/a/bcef8e/32.png) [@Ajith](https://community.forestadmin.com/u/Ajith)\
**Post date:** [May 20, 2025, 10:35am UTC](https://community.forestadmin.com/t/getting-gateway-timeout-error-while-logging-into-forest-admin/8092/3 "2025-05-20T10:35:05Z")

</div>

Hi @anon7284711,  
We are getting CORS issue while authentication API is called.

 ![Screenshot 2025-05-19 at 3.44.39 PM](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/f/f7909783fea734fe95f43f12f118ed432acad016.png)

We are using AWS API gateway for routing for the backend, where are setting the CORS configuration.  
We are getting the same error if we specify the exact value for ‘Access-Control-Allow-Origin’ as “[https://app.forestadmin.com](https://app.forestadmin.com)”.

Can you help here to debug?

Note that it was working fine before with ‘Access-Control-Allow-Origin’ as \*

---

<div class="post-metadata">

**Author:** ![anon7284711](https://avatars.discourse-cdn.com/v4/letter/a/ac8455/32.png) [@anon7284711](https://community.forestadmin.com/u/anon7284711)\
**Post date:** [May 20, 2025, 11:31am UTC](https://community.forestadmin.com/t/getting-gateway-timeout-error-while-logging-into-forest-admin/8092/4 "2025-05-20T11:31:13Z")

</div>

Hello @Ajith

This may have popped up recently as security policies evolve and get stricter.

Could you try to set your custom domain as value ? `https://partner-api.yubbiinvest.com`

You might also want to check the environment variable configured in your agent to ensure the value is also present in the `CORS_ORIGINS` variable.

---

<div class="post-metadata">

**Author:** ![Ajith](https://avatars.discourse-cdn.com/v4/letter/a/bcef8e/32.png) [@Ajith](https://community.forestadmin.com/u/Ajith)\
**Post date:** [May 21, 2025, 9:42am UTC](https://community.forestadmin.com/t/getting-gateway-timeout-error-while-logging-into-forest-admin/8092/5 "2025-05-21T09:42:04Z")

</div>

Hi @anon7284711  
We have set the custom domain name for our AWS API gateway as ‘[https://partner-api.yubiinvest.com](https://partner-api.yubiinvest.com)’. And note that the same is being used for other services. i.e it is working fine.

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/2/250519d751e00bdc8d3e1ff2428a4743d0ecd4ea.png)

Also, there is no value set with the environment variable CORS\_ORIGINS.  
We are using RoR for the forest admin service.

 ![Screenshot 2025-05-21 at 2.51.00 PM](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/6/69c1b7d800359cbefcdb22a4b7f175c81fa0a6fd.png)  
 ![Screenshot 2025-05-21 at 2.51.48 PM](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/4/4267caf2444fb9fe7bc57fa4288a34fa507791fa.png)

Note that the same configurations are present in other environment “QA” of the same project.  
And it is working fine without any error

---

<div class="post-metadata">

**Author:** ![anon7284711](https://avatars.discourse-cdn.com/v4/letter/a/ac8455/32.png) [@anon7284711](https://community.forestadmin.com/u/anon7284711)\
**Post date:** [May 21, 2025, 1:19pm UTC](https://community.forestadmin.com/t/getting-gateway-timeout-error-while-logging-into-forest-admin/8092/7 "2025-05-21T13:19:48Z")

</div>

Sorry I got confused there and thought you had a custom domain setup, indeed you would not need the CORS\_ORIGINS var env then.

Are you able to see any logs on your agent when accessing the frontend ?  
Is there any difference in the setup between your QA and prod envs ?  
If nothing else, do you have a date in mind of when this started happening ?

---

<div class="post-metadata">

**Author:** ![Ajith](https://avatars.discourse-cdn.com/v4/letter/a/bcef8e/32.png) [@Ajith](https://community.forestadmin.com/u/Ajith)\
**Post date:** [May 26, 2025, 7:53am UTC](https://community.forestadmin.com/t/getting-gateway-timeout-error-while-logging-into-forest-admin/8092/8 "2025-05-26T07:53:39Z")

</div>

Hi @anon7284711,

1. Yes, Till now, we have not needed to set up anything in CORS\_ORIGIN.
2. We are able to see logs from the Backend while hitting from the frontend as well as from other api tools like POSTMAN. We are getting the below error  
 ![Screenshot 2025-05-26 at 12.48.26 PM](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/2/22659d8f809b4d6615b4c8155fae552301f2e24d.png)  
Do you know what causes this?
3. This issue is happening from around April 10th, 2025

---

<div class="post-metadata">

**Author:** ![anon7284711](https://avatars.discourse-cdn.com/v4/letter/a/ac8455/32.png) [@anon7284711](https://community.forestadmin.com/u/anon7284711)\
**Post date:** [May 26, 2025, 1:24pm UTC](https://community.forestadmin.com/t/getting-gateway-timeout-error-while-logging-into-forest-admin/8092/9 "2025-05-26T13:24:48Z")

</div>

Could you confirm to me the last 4 chars of your `FOREST_ENV_SECRET` in both `QA` env and `Production` env.

From the logs of our server I can see that your QA env is making requests, but I cannot see a single call made with the `FOREST_ENV_SECRET` of your production environment.

---

<div class="post-metadata">

**Author:** ![Ajith](https://avatars.discourse-cdn.com/v4/letter/a/bcef8e/32.png) [@Ajith](https://community.forestadmin.com/u/Ajith)\
**Post date:** [May 26, 2025, 1:44pm UTC](https://community.forestadmin.com/t/getting-gateway-timeout-error-while-logging-into-forest-admin/8092/10 "2025-05-26T13:44:36Z")

</div>

PFB Last 4 characters of FOREST\_ENV\_SECRET  
QA: 3568  
PROD: f5bd

---

<div class="post-metadata">

**Author:** ![anon7284711](https://avatars.discourse-cdn.com/v4/letter/a/ac8455/32.png) [@anon7284711](https://community.forestadmin.com/u/anon7284711)\
**Post date:** [May 27, 2025, 7:55am UTC](https://community.forestadmin.com/t/getting-gateway-timeout-error-while-logging-into-forest-admin/8092/11 "2025-05-27T07:55:42Z")

</div>

I can confirm then that on our side we do not have any log with your PROD env secret, I would suggest you to look into your AWS config that could cause error or impede the network between your agent and Forest Admin Servers.
