Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(dev): fix hot reloading and Localstack port #324

Merged
merged 4 commits into from
Sep 16, 2020
Merged

Conversation

mantariksh
Copy link
Contributor

@mantariksh mantariksh commented Sep 16, 2020

Problem

  1. Server hot reloading has been broken in the dev environment for a couple of months.
  2. A recent Localstack upgrade (v0.11.5) broke the local S3 service on the S3 port 4572, which is also due to be deprecated.

Solution

Hot reloading

Running ts-node-dev with the --debug flag showed the following issue:
image

The SIGTERM was somehow failing for the child process. To fix this, I added the --exit-child flag (docs).

Localstack

Since the ports for individual services are due to be deprecated anyway, I thought we should try to switch to the edge port 4566. However, when I tried to switch, I got the following error:

formsg-localstack | 2020-09-16T09:27:37:INFO:localstack.services.edge: Unable to find forwarding rule for host "localhost:4566", path "/", target header "", auth header "", data "b''"

I figured this was probably related to the fact that we had a hackish way of initialising our S3 buckets. Rather than using the documented way of initialising AWS resources, we were using init-localstack.sh to repeatedly ping localhost:4572 until Localstack was ready, before initialising the S3 buckets. Since we are now using the latest version of Localstack which supports initialisation scripts, I removed the pinging code and added the bucket initialisation code to /docker-entrypoint-initaws.d.

Unsolved mysteries

Local emails are still broken for me due to the same error encountered by @frankchn which necessitated #285. However, not everyone seems to be facing the same issue, so this is likely due to some local configuration problem.

Copy link
Contributor

@karrui karrui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AHHHH THIS IS GREAT

docker-compose.yml Show resolved Hide resolved
@mantariksh mantariksh merged commit acd825e into develop Sep 16, 2020
@tshuli tshuli mentioned this pull request Sep 22, 2020
@karrui karrui deleted the fix-dev-envt branch November 18, 2020 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants