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

Docker upgrade to v4 is not working #264

Closed
smilebasti opened this issue Apr 10, 2024 · 7 comments
Closed

Docker upgrade to v4 is not working #264

smilebasti opened this issue Apr 10, 2024 · 7 comments

Comments

@smilebasti
Copy link

Hello, firstly nice to see some updates to this project.

I was running v3.4.0 with the docker-compose file, without any problems.

I now just executed docker-compose pull facilmap and docker-compose up. I left the DB running. The output is shown in the Picture:
image

I tried it with v4.0 and v4.1 and leaving it running for a bit. Nothing changes afterward as in the screenshot shown and the web interface is not reachable.

Any thoughts on why this could be? Thanks ahead :)

@cdauth
Copy link
Contributor

cdauth commented Apr 10, 2024

That log actually looks good.

Could there be a problem with your reverse proxy? Could you try finding out the container's IP address using docker inspect and see if you can reach port 8080 of the container directly?

@smilebasti
Copy link
Author

smilebasti commented Apr 10, 2024

Thank you for the quick reply.
I tried it with the ip of the VM where the containers live but still no success. (Without reverse proxy)

Tomorrow i can test a fresh install.

@smilebasti
Copy link
Author

I just tested it with a fresh install with the mysql docker-compose.yml file from: https://docs.facilmap.org/developers/server/docker.html#docker-compose. I just inserted my Maxmind id and key, Ors token and Mapbox token.

I had problems with the healthcheck and with the DB_Host in line 16. I removed the healthcheck because links is enough to start after the database and changed db_host to mysql (correct name). The logs after starting are now the same as the screenshot above.

I then set ports in line 6 to 8080:8080 and then it worked pointing the reverse proxy to port 8080 or trying to access it with the ip:8080.

After changing the line 6 the old machine upgrade worked. I think the random published port changed after the upgrade. With the change to 8080:8080 the published port will always be 8080.

Updating the Docs would resolve this problem for future installations. Thank you. Should i create a pull request?

@cdauth
Copy link
Contributor

cdauth commented Apr 11, 2024

Ah, that makes sense.

Actually the ports directive should only be used for testing, as it publishes the service through unencrypted HTTP. When used behind a reverse proxy, a typical setup would be to omit ports altogether, as the reverse proxy usually runs in a container on the same network, so it can access the internal exposed port. If the reverse proxy runs outside of the docker daemon, ports can be used, but care should ideally be taken that the unencrypted port is not publicly reachable.

I have added a note about this to the docs. Also, the fact that the example config publishes a random port was a mistake, I've also corrected that.

I would also be curious what problems you had with the healthcheck.

@smilebasti
Copy link
Author

Thank you.
I am using a reverse proxy in a second vm. Therefore, i have to publish the port.

The second problem in the compose example is in line 16: DB_HOST: db should be DB_HOST: mysql. The changed service name.

The health check shows state unhealthy of mysql. The logs:

....
mysql-1     | 2024-04-11 12:20:22 0 [Note] InnoDB: log sequence number 47763; transaction id 14
mysql-1     | 2024-04-11 12:20:22 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
mysql-1     | 2024-04-11 12:20:22 0 [Note] Plugin 'FEEDBACK' is disabled.
mysql-1     | 2024-04-11 12:20:22 0 [Note] Plugin 'wsrep-provider' is disabled.
mysql-1     | 2024-04-11 12:20:22 0 [Note] InnoDB: Buffer pool(s) load completed at 240411 12:20:22
mysql-1     | 2024-04-11 12:20:22 0 [Note] Server socket created on IP: '0.0.0.0'.
mysql-1     | 2024-04-11 12:20:22 0 [Note] Server socket created on IP: '::'.
mysql-1     | 2024-04-11 12:20:22 0 [Note] mariadbd: Event Scheduler: Loaded 0 events
mysql-1     | 2024-04-11 12:20:22 0 [Note] mariadbd: ready for connections.
mysql-1     | Version: '11.3.2-MariaDB-1:11.3.2+maria~ubu2204'  socket: '/run/mysqld/mysqld.sock'  port: 3306  mariadb.org binary distribution
dependency failed to start: container smilebasti-mysql-1 is unhealthy

I executed in the mariadb container: mysqladmin ping -h 127.0.0.1 -u MY_MYSQL_USER --password=MY_MYSQL_PASSWORD. The output was: command not found.
I changed the command to: mariadb-admin ping -h 127.0.0.1 -u MY_MYSQL_USER --password=MY_MYSQL_PASSWORD and the output was: mariadb active.
Changing it in the compose.yml made it work :).

@cdauth
Copy link
Contributor

cdauth commented Apr 12, 2024

Ah, thanks for the hints! I've corrected the wrong DB_HOST (I've now renamed the service to mariadb).

Turns out the healthcheck command was for MySQL 5, which I'm personally still using. I've updated the docs to use the right command for MariaDB.

@cdauth cdauth closed this as completed Apr 12, 2024
@smilebasti
Copy link
Author

Thank you for your great work :)

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