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

Possible issue with docker installation #51

Closed
intri-in opened this issue Jul 3, 2023 · 16 comments
Closed

Possible issue with docker installation #51

intri-in opened this issue Jul 3, 2023 · 16 comments

Comments

@intri-in
Copy link
Owner

intri-in commented Jul 3, 2023

          I just tried to set this up today, and I'm getting an error on the install page.
manage-my-damn-life-nextjs-app-1  | Error: 'sharp' is required to be installed in standalone mode for the image optimization to function correctly. Read more at: https://nextjs.org/docs/messages/sharp-missing-in-production

Originally posted by @AeliusSaionji in #12 (comment)

@intri-in
Copy link
Owner Author

intri-in commented Jul 3, 2023

Are you trying to run and install via docker compose or by using the docker image?

@intri-in intri-in mentioned this issue Jul 3, 2023
@AeliusSaionji
Copy link

Compose

@intri-in
Copy link
Owner Author

intri-in commented Jul 3, 2023

| Error: 'sharp' is required to be installed in standalone mode for the image optimization to function correctly. Read more at: https://nextjs.org/docs/messages/sharp-missing-in-production

This particular error isn't really fatal. It's just NextJS complaining about missing sharp library. You can install it via
npm i sharp

Can you try navigating to localhost:3000/install, and see if the installation process finishes?

@AeliusSaionji
Copy link

That error is triggered by loading the install page. But nothing happens when I go there- I see what appears to be a static page with non clickable text "install"

@intri-in
Copy link
Owner Author

intri-in commented Jul 3, 2023

I did some testing, and I think this is triggered by wrong db settings.

On the install page, the first thing the backend does it to check if there's valid connection to database. Looks like the mysql library isn't throwing an error in case db settings are completely incorrect, and thus MMDL's UI doesn't move forward.

Did you make any changes to the docker-compose.yml?

@AeliusSaionji
Copy link

Only to change the port. I also tested with the docker sample env file (unmodified)

@intri-in
Copy link
Owner Author

intri-in commented Jul 3, 2023

I am guessing 3306 port was already in use, so you had to change the port binding?

In your docker-compose.yml, in services 'db', try changing the ports directive to expose.

Delete this

ports:
  - "3306:3306"    

And replace it with:

expose: 
     - 3306    

We are exposing the port 3306 to other docker containers, but not the host, so there should be no conflict and the MMDL container should be able to reach the mysql container.

@intri-in intri-in closed this as completed Jul 3, 2023
@intri-in
Copy link
Owner Author

intri-in commented Jul 3, 2023

Closed by mistake

@intri-in intri-in reopened this Jul 3, 2023
@AeliusSaionji
Copy link

I did not change 3306, but I tried exposing it anyway: no luck!

@intri-in
Copy link
Owner Author

intri-in commented Jul 3, 2023

I have pushed some changes to the repo, and I tested it in a fresh machine and it seems to be working. My guess is something is wrong with the db settings, but we can't put our finger on the "what".

If possible, try the following:

  1. Remove your docker-compose file
    rm docker-compose.yml
  2. Pull new changes to the repo
    git pull
  3. Copy docker sample docker-compose file.
    cp docker-compose.yml.sample docker-compose.yml
  4. Run docker-compose up

Let's see if it runs out of the box.

@AeliusSaionji
Copy link

This is what I see at the install page.
image

The base page seems to be working without having gone through any install, though, I'll try to set up my caldav account

@intri-in
Copy link
Owner Author

intri-in commented Jul 3, 2023

I doubt the CalDav account addition will work without install. Tables need to be created in the db for it to function.

Are you using it locally? Can you see any errors in the console log? If you're seeing 404 in the console logs, the front end probably can't talk to the backend api.

If you're using the app with a domain name, or using port other than 3000, You'll need to change the value of NEXT_PUBLIC_BASE_URL variable in docker compose to your URL

@AeliusSaionji
Copy link

OK, I had to change the values from localhost to my physical LAN IP address.

But now I cannot create a user- I make it through user creation, but when trying to log in I always get "invalid password"

@intri-in
Copy link
Owner Author

intri-in commented Jul 4, 2023

I identified the problem with logging in, and I have pushed a fix.

Please use git pull and run docker-compose up now, and see if it works.

You won't be able to login with the user that you have created, unless you reset the password. To reset the password, you'll need to set the SMTP settings, as it needs to send an OTP to your email.

If you don't want to bother with that, I recommend that you nuke the mysql container that was created, so it deletes the installed db tables.

I think everything should work now.

Thanks for your patience

@AeliusSaionji
Copy link

thanks! It's all up and running now.

@intri-in
Copy link
Owner Author

intri-in commented Jul 7, 2023

Great! Will close this issue for now. If you face other problems, you can reopen it.

@intri-in intri-in closed this as completed Jul 7, 2023
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

No branches or pull requests

2 participants