0

we have created one api to export patient details in csv file, this export request takes 2.5 min to execute. we are using below technology for this app: Scala, akka, nginx and react/node js as front end.

when i will hit on export link, request got executed and able to see in logs. but immediately after 30sec got error on browser console GET /export/request 503 (service unavailable ) with java script error in promise block.

after refering akka documentation i have increased ideal-timeout setting to 240s.

application.conf

   http {
    server {
      request-timeout: 240s
       idle-timeout: 240s
    }
  } 

and it works on my local/development env. /export/ request was executed in 2 min.

after deploying this change at TEST env. issue is still there getting 503 after 30 sec. on TEST env. application is running with docker env.

request flow/application setup:

Internal AWS load balancer => EC2 instance => nginx proxy (listing :80) => front end app (react js app) => backend (scala and akka) 

i have not found any configuration key which has set to 30s.

Could you please help me with this ?

Many thanks

J.Vander
  • 44
  • 3
  • but if i check in backed akka/scala log seems request executed successfully with 200 response. log : 2021-07-19 15:39:53,588 [ApiServer-akka.actor.default-dispatcher-455] INFO akka.actor.ActorSystemImpl -GET /engine/export/details/6a434ca3-ffdb-43e3-a92d-7486631544c0? -> 200 OK (141040 milliseconds) – Shaikh Abutalib Jul 20 '21 at 08:22
  • Does the react app really talk directly to the backend, or does it go via the proxy? Seems odd to have load balancing on the app but not the backend. – Tim Jul 20 '21 at 08:33
  • @Tim Yes react app call backend through proxy only – Shaikh Abutalib Jul 20 '21 at 08:50
  • In which case the timeout is happening in that proxy process, not in the backend server. So check the timeouts in the proxy – Tim Jul 20 '21 at 09:12
  • proxy setting i have increased timeout settings and they are working/affecting: default.conf file of nginx proxy location / { proxy_pass http://paris-web; proxy_set_header Host $http_host; proxy_read_timeout 100; proxy_connect_timeout 100; proxy_send_timeout 100; } – Shaikh Abutalib Jul 22 '21 at 11:14
  • This question is no longer about Scala or Akka. I suggest you ask a new question with different tags and possibly in a more appropriate group. – Tim Jul 22 '21 at 11:30
  • Were you able to fix the issue ? – Arokia Lijas Aug 08 '22 at 11:09

1 Answers1

0

It seems your problem is on any intermediary proxy. You can perform your request with curl and check the response header Server:

curl -v -s -o /dev/null your_hostname/export/request

If it were akka you'd see a line as follows:

< Server: akka-http/10.2.4

Hopefully you can get more insights on your issue with this technique

Didac Montero
  • 2,046
  • 19
  • 27
  • tried to access ,but still request terminated after 30 sec . % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- 0:00:31 --:--:-- 0 Curl Command: curl --request GET --header "Content-Type: text/csv(UTF-8)" --header "Authorization: Bearer ${ACCESS_TOKEN}" --header "Client-Realm:${REALM_ID}" "https://${MY_HOST}/engine/patients/export/details/38fa509d-0c96-4f7a-8ab6-c023863712d6?dataset=${DATASET_ID}" > test_data.csv – Shaikh Abutalib Jul 22 '21 at 11:10
  • using Curl command able to export all records in csv file, seems issue at UI technology or Proxy, but on local everything is fine : Curl command : curl --request GET --header "Content-Type: text/csv(UTF-8)" "http://${HOST}/engine/export/details/31a0686a-21c6-4776-a380-99f61628b074?dataset=${DATASET_ID}" > export_data.csv. – Shaikh Abutalib Jul 25 '21 at 07:28
  • Server: nginx/1.17.10 in response header with 503 status code .. please suggest any other way to troubleshoot and fix this issue – Shaikh Abutalib Jul 25 '21 at 16:44