Skip to content

mySQL 8.4.5 container stuck in (unhealthy) state on Podman + Windows - SSL certificate permission errors prevent initialization #2647

@weiwugujia

Description

@weiwugujia
Image Image

Windows 系统使用 Podman 部署 Coze Studio 时,MySQL 8.4.5 容器持续处于 (unhealthy) 状态,导致后端服务无法连接数据库,智能体编辑器显示"初始化失败"。

环境信息

  • 操作系统: Windows 10/11
  • 容器运行时: Podman (非 Docker)
  • MySQL 版本: 8.4.5
  • Coze Studio 版本: latest
  • 部署方式: docker-compose / podman-compose

错误日志

MySQL 容器日志关键错误

mysqld: Cannot change permissions of the file 'ca.pem' (OS errno 1 - Operation not permitted)
2026-03-27T17:18:05.270513Z 0 [ERROR] [MY-010295] [Server] Could not set file permission for ca.pem
2026-03-27T17:18:05.270542Z 0 [ERROR] [MY-013236] [Server] The designated data directory /var/lib/mysql/ is unusable. You can remove all files that the server added to it.
2026-03-27T17:18:05.270547Z 0 [ERROR] [MY-010119] [Server] Aborting

浏览器控制台错误

POST http://localhost:8888/api/conversation/get_message_list 500 (Internal Server Error)
Uncaught (in promise) CustomError
初始化失败,请重试

容器状态

CONTAINER ID  IMAGE                          COMMAND     CREATED        STATUS                    PORTS                NAMES
487ee2b11bee  docker.io/library/mysql:8.4.5              2 minutes ago  Up 2 minutes (unhealthy)  3306/tcp, 33060/tcp  coze-mysql

问题分析

根本原因

MySQL 8.4.5 在初始化阶段会自动创建 SSL 证书文件(ca.pem, server-cert.pem, server-key.pem 等),但在 Podman + Windows 环境下,由于文件系统权限模型的差异,MySQL 进程无法正确设置这些文件的权限(chmod 操作返回 Operation not permitted),导致:

  1. MySQL 初始化失败并中止
  2. 容器健康检查失败,状态显示为 (unhealthy)
  3. 后端服务无法连接数据库,返回 500 错误

这是我的配置有问题吗

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions