The smartAction does not wait for response

Hello,

We have created a smart action that allows us to import a large amount of data into another collection.

Expected Behavior

Upon the completion of the importation process, we expect to receive a success message.

Current Behavior

However, after some time of importing, Forest returns an error: ‘Something went wrong: Failed to fetch.’ This occurs despite the function continuing to run properly in the background of the server.

Context

  • Project Name: Roby
  • Team Name: Developers
  • Agent (Forest Package) Name & Version: ‘forest-express-mongoose’: ‘^8.0.0’
  • Database Type: MongoDB

Thank you for your assistance.

Best regards

Hello,

Are you using a reverse proxy in front of your server? It looks like a timeout error thrown by the reverse proxy itself.

hi,
we are using nginx.
how can we resolve this problem?
thank you

hi,
we got this error from nginx logs:
we tried to increase the timeout value in nginx config file but still return error after 60s.

2023/09/24 22:24:30 [error] 30#30: *9 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 172.17.0.4, server: _, request: "POST /v5.0/forest-admin/api/forest/actions/payment/import-ambasadors?timezone=Europe%2FParis HTTP/1.1", upstream: "http://172.17.0.5:8080/v5.0/forest-admin/api/forest/actions/payment/import-ambasadors?timezone=Europe%2FParis", host: "api-uat.roby.taxi", referrer: "https://app.forestadmin.com/"

The error seems related to NGINX and not the application itself.

I found some documentation here explaining how to increase the timeout in NGINX. Which properties did you try to set?

i tried to update with documentation:
but still return error after 60s exacly.
properties updated
keepalive_timeout 120s;

properties added
proxy_connect_timeout 120s;
proxy_read_timeout 120s;
proxy_send_timeout 120s;
client_body_timeout 120s;
client_header_timeout 120s;

thank you

I don’t really see how to help you further on this. It seems that the error is linked to NGINX and not the underlying application. So I think you can continue digging in that direction.