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

MySQL database connection timeout #1315

Closed
007-sys opened this issue Nov 1, 2023 · 8 comments
Closed

MySQL database connection timeout #1315

007-sys opened this issue Nov 1, 2023 · 8 comments
Labels
bug Categorizes issue or PR as related to a bug.

Comments

@007-sys
Copy link

007-sys commented Nov 1, 2023

What happened?

Database connection timeout when Mac M1 source code deployment starts
image

(base) yongshuideMacBook-Pro:open-im-server yongshuizhao$ docker inspect fdc604bbd598
[
    {
        "Id": "fdc604bbd5989696ab53403897c8270602e2317719dbf4dad6e9f4168d46c998",
        "Created": "2023-11-01T06:17:36.029922051Z",
        "Path": "docker-entrypoint.sh",
        "Args": [
            "mysqld"
        ],
        "State": {
            "Status": "running",
            "Running": true,
            "Paused": false,
            "Restarting": false,
            "OOMKilled": false,
            "Dead": false,
            "Pid": 2528,
            "ExitCode": 0,
            "Error": "",
            "StartedAt": "2023-11-01T06:17:37.380636968Z",
            "FinishedAt": "0001-01-01T00:00:00Z"
        },
        "Image": "sha256:5d2fb452c483ffe15d4ec362a904fd285ab1f4dedd98b0a38060c87f1d98f582",
        "ResolvConfPath": "/var/lib/docker/containers/fdc604bbd5989696ab53403897c8270602e2317719dbf4dad6e9f4168d46c998/resolv.conf",
        "HostnamePath": "/var/lib/docker/containers/fdc604bbd5989696ab53403897c8270602e2317719dbf4dad6e9f4168d46c998/hostname",
        "HostsPath": "/var/lib/docker/containers/fdc604bbd5989696ab53403897c8270602e2317719dbf4dad6e9f4168d46c998/hosts",
        "LogPath": "/var/lib/docker/containers/fdc604bbd5989696ab53403897c8270602e2317719dbf4dad6e9f4168d46c998/fdc604bbd5989696ab53403897c8270602e2317719dbf4dad6e9f4168d46c998-json.log",
        "Name": "/mysql",
        "RestartCount": 0,
        "Driver": "overlay2",
        "Platform": "linux",
        "MountLabel": "",
        "ProcessLabel": "",
        "AppArmorProfile": "",
        "ExecIDs": null,
        "HostConfig": {
            "Binds": [
                "/Users/yongshuizhao/Desktop/open-im/open-im-server/components/mysql/data:/var/lib/mysql:rw",
                "/etc/localtime:/etc/localtime:rw"
            ],
            "ContainerIDFile": "",
            "LogConfig": {
                "Type": "json-file",
                "Config": {}
            },
            "NetworkMode": "open-im-server_server",
            "PortBindings": {
                "3306/tcp": [
                    {
                        "HostIp": "",
                        "HostPort": "13306"
                    }
                ]
            },
            "RestartPolicy": {
                "Name": "always",
                "MaximumRetryCount": 0
            },
            "AutoRemove": false,
            "VolumeDriver": "",
            "VolumesFrom": null,
            "ConsoleSize": [
                0,
                0
            ],
            "CapAdd": null,
            "CapDrop": null,
            "CgroupnsMode": "private",
            "Dns": null,
            "DnsOptions": null,
            "DnsSearch": null,
            "ExtraHosts": [],
            "GroupAdd": null,
            "IpcMode": "private",
            "Cgroup": "",
            "Links": null,
            "OomScoreAdj": 0,
            "PidMode": "",
            "Privileged": false,
            "PublishAllPorts": false,
            "ReadonlyRootfs": false,
            "SecurityOpt": null,
            "UTSMode": "",
            "UsernsMode": "",
            "ShmSize": 67108864,
            "Runtime": "runc",
            "Isolation": "",
            "CpuShares": 0,
            "Memory": 0,
            "NanoCpus": 0,
            "CgroupParent": "",
            "BlkioWeight": 0,
            "BlkioWeightDevice": null,
            "BlkioDeviceReadBps": null,
            "BlkioDeviceWriteBps": null,
            "BlkioDeviceReadIOps": null,
            "BlkioDeviceWriteIOps": null,
            "CpuPeriod": 0,
            "CpuQuota": 0,
            "CpuRealtimePeriod": 0,
            "CpuRealtimeRuntime": 0,
            "CpusetCpus": "",
            "CpusetMems": "",
            "Devices": null,
            "DeviceCgroupRules": null,
            "DeviceRequests": null,
            "MemoryReservation": 0,
            "MemorySwap": 0,
            "MemorySwappiness": null,
            "OomKillDisable": null,
            "PidsLimit": null,
            "Ulimits": null,
            "CpuCount": 0,
            "CpuPercent": 0,
            "IOMaximumIOps": 0,
            "IOMaximumBandwidth": 0,
            "MaskedPaths": [
                "/proc/asound",
                "/proc/acpi",
                "/proc/kcore",
                "/proc/keys",
                "/proc/latency_stats",
                "/proc/timer_list",
                "/proc/timer_stats",
                "/proc/sched_debug",
                "/proc/scsi",
                "/sys/firmware"
            ],
            "ReadonlyPaths": [
                "/proc/bus",
                "/proc/fs",
                "/proc/irq",
                "/proc/sys",
                "/proc/sysrq-trigger"
            ]
        },
        "GraphDriver": {
            "Data": {
                "LowerDir": "/var/lib/docker/overlay2/64bbcc7ebad42577aaed1e78b33a08b3c4a93de654576255a0d67503f934496a-init/diff:/var/lib/docker/overlay2/7ec8a3001d636598a9c3502ac9925f61b7672d27b8b5bc2073c986e431e635bf/diff:/var/lib/docker/overlay2/044532100a04bd6d5b4cde1e44630509fe6e5f379f62a71f54da7be4388ddcac/diff:/var/lib/docker/overlay2/15e16fc08d7a6af49fb44733f0aaada6a9975a688f5ec213a1cf8b92fe9a26c7/diff:/var/lib/docker/overlay2/0d1a20a9d816765a97590a29c83e4039adcd819cf310ebbce8d2f6df4fe43c80/diff:/var/lib/docker/overlay2/c37290584d791d814e413109a0fec636948a2a0c07d8dd99d43769eb6ec423d8/diff:/var/lib/docker/overlay2/c66b1042474d2aee678c4043b6c9ef8d0ab71beae401e110cc01512461ab372a/diff:/var/lib/docker/overlay2/397b2380bdf799f41493f204efedab7a464611aad3f2df341335269c4fbca9bd/diff:/var/lib/docker/overlay2/ff5975d067d62d7b33098d6fa3c1828dda5a42db26da1c56b9aee5068b6eefee/diff:/var/lib/docker/overlay2/3db505df4bf203565f4c3543f7a5c88e9335b2e002519c8fb8aceaaa9806eaf8/diff:/var/lib/docker/overlay2/380e3ef1242031be3365fb944eeed8c6e14ae98d8a9d0be3e5b8f88a03700cd3/diff",
                "MergedDir": "/var/lib/docker/overlay2/64bbcc7ebad42577aaed1e78b33a08b3c4a93de654576255a0d67503f934496a/merged",
                "UpperDir": "/var/lib/docker/overlay2/64bbcc7ebad42577aaed1e78b33a08b3c4a93de654576255a0d67503f934496a/diff",
                "WorkDir": "/var/lib/docker/overlay2/64bbcc7ebad42577aaed1e78b33a08b3c4a93de654576255a0d67503f934496a/work"
            },
            "Name": "overlay2"
        },
        "Mounts": [
            {
                "Type": "bind",
                "Source": "/Users/yongshuizhao/Desktop/open-im/open-im-server/components/mysql/data",
                "Destination": "/var/lib/mysql",
                "Mode": "rw",
                "RW": true,
                "Propagation": "rprivate"
            },
            {
                "Type": "bind",
                "Source": "/etc/localtime",
                "Destination": "/etc/localtime",
                "Mode": "rw",
                "RW": true,
                "Propagation": "rprivate"
            }
        ],
        "Config": {
            "Hostname": "fdc604bbd598",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": true,
            "AttachStderr": true,
            "ExposedPorts": {
                "3306/tcp": {},
                "33060/tcp": {}
            },
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "MYSQL_ROOT_PASSWORD=openIM123",
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "GOSU_VERSION=1.16",
                "MYSQL_MAJOR=innovation",
                "MYSQL_VERSION=8.2.0-1.el8",
                "MYSQL_SHELL_VERSION=8.0.35-1.el8"
            ],
            "Cmd": [
                "mysqld"
            ],
            "Image": "mysql:latest",
            "Volumes": {
                "/var/lib/mysql": {}
            },
            "WorkingDir": "",
            "Entrypoint": [
                "docker-entrypoint.sh"
            ],
            "OnBuild": null,
            "Labels": {
                "com.docker.compose.config-hash": "d0036cf912c6da4e63723c77bb92e86e0a3d1cf30d0983b1c74b0067d739710c",
                "com.docker.compose.container-number": "1",
                "com.docker.compose.depends_on": "",
                "com.docker.compose.image": "sha256:5d2fb452c483ffe15d4ec362a904fd285ab1f4dedd98b0a38060c87f1d98f582",
                "com.docker.compose.oneoff": "False",
                "com.docker.compose.project": "open-im-server",
                "com.docker.compose.project.config_files": "/Users/yongshuizhao/Desktop/open-im/open-im-server/docker-compose.yml",
                "com.docker.compose.project.working_dir": "/Users/yongshuizhao/Desktop/open-im/open-im-server",
                "com.docker.compose.service": "mysql",
                "com.docker.compose.version": "2.23.0"
            }
        },
        "NetworkSettings": {
            "Bridge": "",
            "SandboxID": "3bfa05a5c9ab6b865a91f3a4bd0911ad5b18ed1b6dac6f24ab559810dedfe460",
            "HairpinMode": false,
            "LinkLocalIPv6Address": "",
            "LinkLocalIPv6PrefixLen": 0,
            "Ports": {
                "3306/tcp": [
                    {
                        "HostIp": "0.0.0.0",
                        "HostPort": "13306"
                    }
                ],
                "33060/tcp": null
            },
            "SandboxKey": "/var/run/docker/netns/3bfa05a5c9ab",
            "SecondaryIPAddresses": null,
            "SecondaryIPv6Addresses": null,
            "EndpointID": "",
            "Gateway": "",
            "GlobalIPv6Address": "",
            "GlobalIPv6PrefixLen": 0,
            "IPAddress": "",
            "IPPrefixLen": 0,
            "IPv6Gateway": "",
            "MacAddress": "",
            "Networks": {
                "open-im-server_server": {
                    "IPAMConfig": {
                        "IPv4Address": "172.21.0.2"
                    },
                    "Links": null,
                    "Aliases": [
                        "mysql",
                        "mysql",
                        "fdc604bbd598"
                    ],
                    "NetworkID": "f2362b1dfe3de17db4eaa6c41ee47626a205c1c244bb748d8c4ee92eca6f1015",
                    "EndpointID": "09f9fab7b378731653e3ed9b0e2ac9b21f2101808398adbe2bffa45b072044bd",
                    "Gateway": "172.21.0.1",
                    "IPAddress": "172.21.0.2",
                    "IPPrefixLen": 16,
                    "IPv6Gateway": "",
                    "GlobalIPv6Address": "",
                    "GlobalIPv6PrefixLen": 0,
                    "MacAddress": "02:42:ac:15:00:02",
                    "DriverOpts": null
                }
            }
        }
    }
]

What did you expect to happen?

MySQL database connection timeout

How can we reproduce it (as minimally and precisely as possible)?

Source code deployment

Anything else we need to know?

No response

version

```Mac m1
</details>


### Cloud provider

<details>
</details>


### OS version

<details>
```console
# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here
# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here

Install tools

@007-sys 007-sys added the bug Categorizes issue or PR as related to a bug. label Nov 1, 2023
@cubxxw
Copy link
Contributor

cubxxw commented Nov 1, 2023

Thank you for bringing up this bug issue. After observing the situation, I noticed that you are using the latest version of the mysql image instead of the one we specified. Could you kindly provide me with the reason for this? Your cooperation is highly appreciated.

@007-sys
Copy link
Author

007-sys commented Nov 1, 2023

我用的 Mac M1 默认版本的版本镜像安装不了
image

@cubxxw
Copy link
Contributor

cubxxw commented Nov 1, 2023

@007-sys

I hope this message finds you well. I wanted to follow up on a previous conversation we had regarding an issue. I recall you mentioning a potential connection between that issue and the following link: #1305.

Would you be able to confirm if there is indeed a relationship between the two? Your insights would be greatly appreciated.

@007-sys
Copy link
Author

007-sys commented Nov 1, 2023

@kubbot
Copy link
Contributor

kubbot commented Nov 1, 2023

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


#1305 This is related. Later I found that after upgrading the corresponding components, https://user-images.githubusercontent.com/16251271/ would not appear. 279691817-1711baf7-5224-4414-ab64-a5661eae5d53.png had this problem, so I upgraded the dependency structure

@007-sys
Copy link
Author

007-sys commented Nov 1, 2023

#1315 (comment)
The solution to the above problem is to change the gateway IP to the local 127.0.0.1 mode, and if the mini startup is abnormal, switch to the OSS mode
image

New issues arise:
image

@kubbot
Copy link
Contributor

kubbot commented Jan 1, 2024

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@kubbot
Copy link
Contributor

kubbot commented Jan 10, 2024

This issue was closed because it has been stalled for 7 days with no activity.

@kubbot kubbot closed this as not planned Won't fix, can't repro, duplicate, stale Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

3 participants