ludeknovy / jtl-reporter

JtlReporter is an online application that allows users to generate beautiful, customizable and easy to understand performance reports from JMeter(Taurus), Locust, and other tools.
https://jtlreporter.site
MIT License
131 stars 35 forks source link

FE doesn't respond if BE is restarted #292

Closed mcleodj closed 3 months ago

mcleodj commented 3 months ago

Describe the bug We are running JTL reporter on ECS, using fargate. Each container is running independently. When the BE container restarts, the FE can sometimes not function (i.e. display a white screen on the UI) until it is restarted.

To Reproduce Restart BE after all containers are up and functional.

Expected behavior The FE to auto-recover from losing connection to the original BE.

Screenshots If applicable, add screenshots to help explain your problem.

Additional context To work around the hardcoded be value in nginx.conf we are running the below command on startup.

  command = [
    "/bin/sh",
    "-c",
    "sed -i 's/server be/server be.jtl-reporter.local/' /etc/nginx/nginx.conf && nginx -g 'daemon off;'"
  ]

Did JtlReporter make you happay in any way? Answering this question is not required, but if you have anything positive to share, please do so here.

ludeknovy commented 3 months ago

Hi @mcleodj. Do I understand it correctly that if you restart the BE, the FE will never reconnect to the BE again? Is this behaviour specific for your current setup or when running it using docker-compose?

mcleodj commented 3 months ago

That is correct.

I don't know if this is specific to running this on ECS or not as this is the only place that I've run the app.

ludeknovy commented 3 months ago

I will try to reproduce it locally, but my guess it's specific to your setup, as it looks like something had changed in networking after you restarted the application.

ludeknovy commented 3 months ago

So there's nothing wrong with the application itself. It works correctly locally.

The workaround looks reasonable as you need to connect to different domain. On jtl reporter side, it could be improved so the domain would be parametrized.

After you restart, are you sure that the BE is running at be.jtl-reporter.local ?

mcleodj commented 3 months ago

It is actually an nginx "issue" (actually behaving by design). Nginx caches the upstream IP address until reload or restart. My options here are to either put the BE behind a load balancer with a persistent IP or to use the resolver directive in nginx.

Either way, not an application problem, thanks for looking anyway.