-
Notifications
You must be signed in to change notification settings - Fork 87
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
The back-end API boot is failing inside the container #99
Comments
Hi @wcalderipe , thank you for providing such rich information on the issue, it looks so professional and gives us a good example of an issue template, respect! Quick solution for this issue: wait for about 20 seconds then refresh the page. This is actually a known issue, the root cause seems to be the MongoDB is not ready for connection in the initial few seconds after the application started, we'll implement a better solution to handle this when we have capacity. |
@hyrepo, thanks for the fast reply, and congrats on the awesome project 🙌 I'm really excited to try it out! I've just tried to wait for 20 seconds as you suggested but, unfortunately, it doesn't seem to work.
Note there's a space of ~2 minutes between each curl request to Is there any other lead you have in mind? If you point me in the right direction I wouldn't mind trying it myself. |
Hi @wcalderipe, I just had a closer look at this issue, it's not the one I mentioned above, in this one, the backend part failed to get started, so you keep getting 502 error. Seems it was caused by the Docker in M1 chip. The only environmental difference between mine and yours is the CPU, my Mac uses Inter chip, so I tested it again in an M1 Mac, then I got the same error as yours. We'll try to fix it, but at the current stage, I'm not quite sure about the solution. There're two temporary solutions that came into my mind:
|
Hi, I'm also experiencing this but with a different machine.
And also, I'm trying to build the docker image and run the container by myself from this cloned repository. Here's what I did:
But I'm always getting the {"t":{"$date":"2022-11-11T02:25:25.293+00:00"},"s":"I", "c":"REPL", "id":21313, "ctx":"initandlisten","msg":"Did not find local replica set configuration document at startup","attr":{"error":{"code":47,"codeName":"NoMatchingDocument","errmsg":"Did not find replica set configuration document in local.system.replset"}}}
{"t":{"$date":"2022-11-11T02:25:25.294+00:00"},"s":"I", "c":"CONTROL", "id":20714, "ctx":"LogicalSessionCacheRefresh","msg":"Failed to refresh session cache, will try again at the next refresh interval","attr":{"error":"NotYetInitialized: Replication has not yet been configured"}}
{"t":{"$date":"2022-11-11T02:25:25.294+00:00"},"s":"I", "c":"CONTROL", "id":20711, "ctx":"LogicalSessionCacheReap","msg":"Failed to reap transaction table","attr":{"error":"NotYetInitialized: Replication has not yet been configured"}}
{"t":{"$date":"2022-11-11T02:25:25.294+00:00"},"s":"I", "c":"REPL", "id":40440, "ctx":"initandlisten","msg":"Starting the TopologyVersionObserver"}
{"t":{"$date":"2022-11-11T02:25:25.294+00:00"},"s":"I", "c":"REPL", "id":40445, "ctx":"TopologyVersionObserver","msg":"Started TopologyVersionObserver"}
{"t":{"$date":"2022-11-11T02:25:25.294+00:00"},"s":"I", "c":"NETWORK", "id":23015, "ctx":"listener","msg":"Listening on","attr":{"address":"/tmp/mongodb-27017.sock"}}
{"t":{"$date":"2022-11-11T02:25:25.295+00:00"},"s":"I", "c":"NETWORK", "id":23015, "ctx":"listener","msg":"Listening on","attr":{"address":"0.0.0.0"}}
{"t":{"$date":"2022-11-11T02:25:25.295+00:00"},"s":"I", "c":"NETWORK", "id":23016, "ctx":"listener","msg":"Waiting for connections","attr":{"port":27017,"ssl":"off"}}
{"t":{"$date":"2022-11-11T02:26:25.171+00:00"},"s":"I", "c":"STORAGE", "id":22430, "ctx":"WTCheckpointThread","msg":"WiredTiger message","attr":{"message":"[1668133585:171654][10:0x7f34b0934700], WT_SESSION.checkpoint: [WT_VERB_CHECKPOINT_PROGRESS] saving checkpoint snapshot min: 43, snapshot max: 43 snapshot count: 0, oldest timestamp: (0, 0) , meta checkpoint timestamp: (0, 0)"}}
{"t":{"$date":"2022-11-11T02:27:25.244+00:00"},"s":"I", "c":"STORAGE", "id":22430, "ctx":"WTCheckpointThread","msg":"WiredTiger message","attr":{"message":"[1668133645:244197][10:0x7f34b0934700], WT_SESSION.checkpoint: [WT_VERB_CHECKPOINT_PROGRESS] saving checkpoint snapshot min: 45, snapshot max: 45 snapshot count: 0, oldest timestamp: (0, 0) , meta checkpoint timestamp: (0, 0)"}}
{"t":{"$date":"2022-11-11T02:28:25.291+00:00"},"s":"I", "c":"STORAGE", "id":22430, "ctx":"WTCheckpointThread","msg":"WiredTiger message","attr":{"message":"[1668133705:291122][10:0x7f34b0934700], WT_SESSION.checkpoint: [WT_VERB_CHECKPOINT_PROGRESS] saving checkpoint snapshot min: 46, snapshot max: 46 snapshot count: 0, oldest timestamp: (0, 0) , meta checkpoint timestamp: (0, 0)"}}
{"t":{"$date":"2022-11-11T02:29:25.321+00:00"},"s":"I", "c":"STORAGE", "id":22430, "ctx":"WTCheckpointThread","msg":"WiredTiger message","attr":{"message":"[1668133765:321858][10:0x7f34b0934700], WT_SESSION.checkpoint: [WT_VERB_CHECKPOINT_PROGRESS] saving checkpoint snapshot min: 47, snapshot max: 47 snapshot count: 0, oldest timestamp: (0, 0) , meta checkpoint timestamp: (0, 0)"}} What has possibly gone wrong from my steps above? Did I build the backend app correctly? I'm still having doubt at the moment whether my steps above are the same as what you guys did to build the public image on AWS. Thank you very much. |
+1, exactly the same 502 error on a M1 machine :( |
I ran into this exact same issue on my Apple M2 machine. Reading about nginx running on 9000 I decided to try something with the ports and simply added port 9000 to the run command:
This seems to have fixed it! |
@rbeen I tried your command sample. Unfortunately, it still doesn't work on my end.
Macbook Pro Apple M2 Max on macOS 13.4 |
After a few minutes, it works. Exactly as @hyrepo mentioned. |
Hey folks 👋
Instructions from the README to start the application don't work. The API boot is failing inside the container (see the logs on the "Additional context" section).
To Reproduce
Steps to reproduce the behavior:
docker run -d -p 80:80 --name metrik public.ecr.aws/j2s5d3z8/4-key-metrics:latest
http://localhost:80/
The browser's network inspector says the request to
http://localhost/api/project
is returning 502.Expected behavior
Accordingly, with the README, after running the docker container, the application should be working at
localhost:80
.Screenshots
Desktop
macOS Big Sur 11.5.2 (chip Apple M1)
version 20.10.6, build 370c289
Additional context
Log files from the container:
These two seems the most relevant:
Other log files:
The NGINX configuration file says the API is running at port
9000
inside the container:See nginx_release.conf
Checking the API availability inside the container:
Requests to
http://127.0.0.1:9000
are failingOnly port 80 is open inside the container:
NGINX logs:
Application logs:
The text was updated successfully, but these errors were encountered: