Hello. I'm new to StackOverflow. Despite asking here, I usually look things up in documentations and do my research on problems people might have encountered previously. Please consider that when responding.
(Apologies in advance for incorrect terms)
Hello everyone. I'm dealing with the following issue and would really appreciate some help:
sudo docker-compose up -d
the compose file in its folder and I open the web interface to log in with my pre-set credentials, I am unable to log in no matter what. I'll elaborate on error messages further below.I am new to programming and working with Docker; there might be things I don't know or have overlooked in the process that could have resulted in this issue.
For some context: I am running Ubuntu 20.04 LTS. This is part of the relevant folder structure on my staging machine (located in the user home directory with full user privileges):
/srv
|
+ /srv/docker
|
+ /srv/docker/portainer-ce
|
+ /srv/docker/cells
|
+ srv/docker/cells/dir
|
+ srv/docker/cells/sql
When I present my compose files next, this will hopefully explain why certain volumes are mounted in ways not originally recommended by the install guide.
The following is my current compose file for Pydio Cells (retyped it; not an exact character-by-character match to the actual file). The compose file is located in /srv/docker/cells
and is called docker_compose.yml
:
version: "3.7"
services:
mysql:
image: mysql:8
container_name: cells_mysql
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: root_password # placeholder
MYSQL_DATABASE: cells
MYSQL_USER: sql_user # placeholder
MYSQL_PASSWORD: sql_password # placeholder
command: [mysqld, --character-set-server=utf8mb4, --collation-server=utf8mb4_unicode_ci]
volumes:
- "./sql:/var/lib/mysql"
expose:
- "3306" # I used this here as an experiment, but adding this line made no difference.
networks:
- cels-network
cells:
image: pydio/cells:latest
container_name: cells
restart: unless-stopped
ports: ["8088:8080"]
volumes:
- "./dir:/var/cells"
- "./data:/var/cells/data"
volumes:
sql: {}
data: {}
dir: {}
networks:
cells-network:
driver: bridge
The reason for adding the expose: - "3306" line was that I read about it briefly on this page and thought it was worth a shot to see if it does something here. It did not; there was no difference in the application's behavior before and after adding this line.
Previous iterations of this file had me add this line to the mysql environment: MYSQL_ROOT_HOST: "%"
(based on this post here). This did no difference in application behavior either.
I had also previously tried to move everything apart from MYSQL_DATABASE: cells
to an env_file called sensitive.env
within the same folder. This would be a more desirable setup as I don't like having credentials included with a compose file directly. Unfortunately, this effectively made no difference.
In all cases described above, the server was still inaccessible from the web UI, running off https://localhost:8088
.
I have confirmed that the latest versions of both Docker and Docker-compose are properly installed.
The following is the predominant error code that the Web UI displays directly above the Database Configuration panel:
dial tcp 127.0.0.1:3306: connect: connection refused
This code occurs whenever I try to connect with TCP. It doesn't matter if I have a correct or an incorrect password entered.
In this case, I will have the following settings applied in the Database Connection menu (and please disregard security implications with logging in anywhere as root; I'm aware. This is just for a test):
TCP
Host name: localhost
Port: 3306
Database name: cells
Database user: root
Database password: root_password
Attempting to connect to a socket, I get the following error:
dial unix /var/run/mysql.sock: connect: no such file or directory
I have used the following settings here:
Socket
Socket: /var/run/mysql.sock # using this instead of /var/lib/mysql.sock is because the Dockerfile (?) creates a link from /var/lib/mysql.sock to /var/run/mysql.sock; it shouldn't make a difference which one I pick
Database name: cells
Database user: root
Database password: root_password
I have not attempted a manual connection and would disregard it as a reliable production-capable connection method anyways. Realistically, using TCP exclusively is what makes the most sense in my eyes, both from a reliability and a security standpoint. But, because I don't know how setting these settings initially will impact routine connection attempts, I can't say any of this for sure.
Doing the following change in the compose file for the mysql service outputs the same error in the Web UI.
...
env_file:
- sensitive.env
environment:
MYSQL_DATABASE: cells
...
Between each change made to the compose file, I have shut down the Docker container and cleared its volumes each time with the following command: sudo docker-compose down -v
Running sudo docker-compose logs -f
while the container is active gives the following output every time:
Attaching to cells, cells_mysql
cells | ### Pydio Cells Home Edition
cells | Version: 4.2.0
cells | Built: 09 May 23 17:22 +0000
cells | Git commit: cb8d5c1e61bfad7bedfa9af35944a00f494f4bb7
cells | OS/Arch: linux/amd64
cells | Go version: go1.19.8
cells | ### About to execute: [cells configure --bind :8080]
cells |
cells | Welcome to Pydio Cells Home Edition installation
cells | Pydio Cells Home Edition (v4.2.0) will be configured to run on this machine.
cells | Make sure to prepare access and credentials to a MySQL 5.6+ (or MariaDB equivalent) server.
cells | Pick your installation mode when you are ready.
cells |
cells |
cells | Installation Server is starting...
cells | Listening to: https://0.0.0.0:8080
cells |
cells | 2023-05-22T19:02:22.060Z INFO pydio.rest.install starting {"service": "pydio.rest.install", "hook router to": "/a/install"}
cells | 2023-05-22T19:02:22.060Z INFO pydio.rest.config starting {"service": "pydio.rest.config", "hook router to": "/a/config"}
cells | 2023-05-22T19:02:22.061Z INFO pydio.web.install ready
cells | 2023-05-22T19:02:22.289Z INFO pydio.rest.install ready
cells | 2023-05-22T19:02:22.290Z INFO pydio.rest.config ready
cells | 2023-05-22T19:02:22.291Z INFO pydio.server.caddy ✅ Using the local CA at "rootCA.pem" ✨
cells | 2023-05-22T19:02:22.508Z INFO pydio.server.caddy ✅ Created a new certificate valid for the following names 📜
cells | 2023-05-22T19:02:22.508Z INFO pydio.server.caddy - "127.0.0.1"
cells | 2023-05-22T19:02:22.508Z INFO pydio.server.caddy - "172.22.0.2"
cells | 2023-05-22T19:02:22.508Z INFO pydio.server.caddy - "localhost"
cells | 2023-05-22T19:02:22.508Z INFO pydio.server.caddy ✅ The certificate is at "49845dd9adfc33ae5e8553f25721690a.pem"
cells | and the key at "49845dd9adfc33ae5e8553f25721690a-key.pem"
cells | 2023-05-22T19:02:22.508Z INFO pydio.server.caddy
cells | 2023-05-22T19:02:22.508Z INFO pydio.server.caddy
cells | 2023-05-22T19:02:22.508Z INFO pydio.server.caddy 👉 If you are behind a reverse proxy, you can either install the RootCA on the proxy machine trust store, or configure your proxy to `insecure_skip_verify` for pointing to Cells.
cells | 2023-05-22T19:02:22.508Z INFO pydio.server.caddy 👉 If you are developing locally, you may install the RootCA in your system trust store to see a green light in your browser!
cells | 2023-05-22T19:02:22.508Z INFO pydio.server.caddy 🗒 To easily install the RootCA in your trust store, use https://github.com/FiloSottile/mkcert. Set the $CAROOT environment variable to the rootCA folder then use 'mkcert -install'
cells | 2023-05-22T19:02:22.508Z INFO pydio.server.caddy
cells | Open a browser window to: [https://0.0.0.0:8080]
mysql_1 | 2023-05-22 19:02:20+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.33-1.el8 started.
mysql_1 | 2023-05-22 19:02:21+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
mysql_1 | 2023-05-22 19:02:21+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.33-1.el8 started.
mysql_1 | '/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
mysql_1 | 2023-05-22T19:02:21.865110Z 0 [Warning] [MY-011068] [Server] The syntax '--skip-host-cache' is deprecated and will be removed in a future release. Please use SET GLOBAL host_cache_size=0 instead.
mysql_1 | 2023-05-22T19:02:21.867611Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.33) starting as process 1
mysql_1 | 2023-05-22T19:02:21.877105Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
mysql_1 | 2023-05-22T19:02:22.105857Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
mysql_1 | 2023-05-22T19:02:22.367022Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
mysql_1 | 2023-05-22T19:02:22.367064Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
mysql_1 | 2023-05-22T19:02:22.371844Z 0 [Warning] [MY-011810] [Server] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.
mysql_1 | 2023-05-22T19:02:22.408119Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /var/run/mysqld/mysqlx.sock
mysql_1 | 2023-05-22T19:02:22.408269Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.33' socket: '/var/run/mysqld/mysqld.sock' port: 3306 MySQL Community Server - GPL.
Please help me. As a novice, I feel completely stumped here. Nobody seemed to have encountered this prior to me (or at least it's not been a well-documented issue) and nothing in any documentation has given me even a hint as to what could be going wrong here. It's been a lot to try and figure this out by myself and I hope posting this here can help me in some capacity. If I overlooked something, it wasn't because I was lazy, but because it's a method/solution that I either missed by chance, I overlooked, or because I didn't see a correlation between the method/solution and this problem. If any of that is the case, I'm very sorry. Please point me (and other people that may have this issue and stumble upon this post) towards that method/solution. Thank you very much for reading. I am looking forward to seeing suggestions here. Have a nice day!
Use in your DB connection window mysql not localhost. As localhost would mean the cells container. Docker containers in the same network can talk to each other by service name port.