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

lemon-mart-server database doesn't seem to initialize #57

Open
virshu opened this issue Jun 3, 2024 · 1 comment
Open

lemon-mart-server database doesn't seem to initialize #57

virshu opened this issue Jun 3, 2024 · 1 comment
Labels
question Further information is requested

Comments

@virshu
Copy link

virshu commented Jun 3, 2024

docker compose --up build is supposed to work automagically - so I am not sure where to troubleshoot.. I see that web-app started successfully, and I can open a website on localhost:8080. But something is wrong with lemondb - it runs commands, and then it shuts down and keeps restarting - but fails again. And I assume because of that server shows "Exited (1)" in docker desktop.

If there is some things to look and/or tweak, I am happy to do. Ideally, I would prefer to understand what is going on on the server side (I have many years of server-side development; although mostly not in NodeJS). But if it works as black box - OK; as long as it works.

For what it's worth I have NodeJS 22, and installation flashed a warning that it may not be compatible.
Thank you - loved the Angular portion of the book; in part because I was able to figure out the errors in the sample code

@duluca duluca added the question Further information is requested label Aug 28, 2024
@duluca
Copy link
Owner

duluca commented Aug 28, 2024

@virshu I apologize for the delayed response.

I've tested against Node 22 and haven't seen an issue related there. However, I would recommend sticking to the LTS version of Node at all times, which is at 20 currently.

To troubleshoot this I'd recommend gradually bringing up the component parts:

  1. First bring up the database with npm start:database -- if there's an issue at this step, then it's likely there's some sort of configuration issue with Docker, a missing file, or disk access permissions.
  2. Next you can bring up npm start:backend and if successful it should report:
lemon-mart-server  | Connected to database!
lemon-mart-server  | Server listening on port 3000...
lemon-mart-server  | Initializing default user...
lemon-mart-server  | Create indexes...
lemon-mart-server  | Found existing user... deleting
lemon-mart-server  | Done.

If there's a failure here, please ensure that the server works by running it separately. If there are issues with the server, then there might be an authentication issue with MongoDB. In this case, please double check your environment variables and if you believe those are correct you can use the MongoDB Explorer tool by Studio 3T to manually log in to it.
3. Once you clear all the issues then docker compose --up build should work as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants