ONLYOFFICE / CommunityServer

Free open source office suite with business productivity tools: document and project management, CRM, mail aggregator.
http://www.onlyoffice.com
Apache License 2.0
2.75k stars 621 forks source link

mysql restart error occurs when community server' is started #493

Open Zmzzz opened 10 months ago

Zmzzz commented 10 months ago

This is the community startup log `+ '[' ']'

I wouldn't have this problem on another normal computer, the current one having some permissions issues

Zmzzz commented 10 months ago

I tried to remove all the Volume without mounting any files on my machine, this problem still exists, thank you very much for your answer

Carazyda commented 10 months ago

Hello @Zmzzz Please describe in more detail how you installed Onlyoffice? Your host OS?

Zmzzz commented 10 months ago

@Carazyda

According to the official documentation of onlyoffice, I have successfully run onlyoffice on ubuntu 20 before. Now I am using an immutable kernel operating system made by our company based on ubunutu 20, which is still in the test stage, and file permission problems often occur. I wrote a yaml file on this computer using k3s to start the container, there are four mirrors inside the container, the first time I used Volume mapping to the local path, I encountered a permission error, I deleted all the volumes still the same problem

The following is the yaml file:

name: "onlyoffice"
image_version_mysql: "mysql:8.0.29"
image_version_document: "zmm001/onlyoffice:latest"
image_version_control_panel: "onlyoffice/controlpanel"
image_version_community: "onlyoffice/communityserver"
  apiVersion: v1
  kind: Service
  metadata:
    name: v1n-svc-{{ .Values.name }}
  spec:
    type: NodePort
    selector:
      name: v1n-{{ .Values.name }}
    ports:
      - protocol: TCP
        name: port1
        port: 80  # Service 的端口
        targetPort: 80  # 目标容器的端口
      - protocol: TCP
        name: port2
        port: 443
        targetPort: 443
      - protocol: TCP
        name: port3
        port: 5222
        targetPort: 5222
---
  apiVersion: apps/v1
  kind: Deployment
  metadata:
    name: v1n-deploy-{{ .Values.name }}
  spec:
    replicas: 1  # 根据需要设置副本数量
    selector:
      matchLabels:
        name: v1n-{{ .Values.name }}
    template:
      metadata:
        labels:
          name: v1n-{{ .Values.name }}
      spec:
        containers:
        - name: onlyoffice-mysql-server
          image: {{ .Values.image_version_mysql }}
          imagePullPolicy: IfNotPresent 
          env:
          - name: MYSQL_ROOT_PASSWORD
            value: my-secret-pw
          - name: MYSQL_DATABASE
            value: onlyoffice
        - name: onlyoffice-document-server
          image: {{ .Values.image_version_document }}
          imagePullPolicy: IfNotPresent 
          env:
          - name: JWT_ENABLED
            value: "false"
        - name: onlyoffice-control-panel
          image: {{ .Values.image_version_control_panel }}
          imagePullPolicy: IfNotPresent 
        - name: onlyoffice-community-server
          image: {{ .Values.image_version_community }}
          imagePullPolicy: IfNotPresent 
          env:
          - name: MYSQL_SERVER_ROOT_PASSWORD
            value: my-secret-pw
          - name: MYSQL_SERVER_DB_NAME
            value: onlyoffice
          # 其他 Community Server 相关配置...
          ports:
          - containerPort: 80
          - containerPort: 443
          - containerPort: 5222
          imagePullPolicy: IfNotPresent 

Among them, I changed a configuration of the document image and repackaged it based on the official image. The official image would have a downloading failure due to the private IP problem Finally, thank you very much for your reply, my English is generated by translation software, I hope it will not cause trouble to you

Zmzzz commented 10 months ago

Just now, I entered the mysql container to check whether the user was successfully created, and found that the previous sql script was not successfully executed, could it be related to this

echo "[mysqld]
sql_mode = 'NO_ENGINE_SUBSTITUTION'
max_connections = 1000
max_allowed_packet = 1048576000
group_concat_max_len = 2048" > /app/onlyoffice/mysql/conf.d/onlyoffice.cnf

echo "ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'my-secret-pw';
CREATE USER IF NOT EXISTS 'onlyoffice_user'@'%' IDENTIFIED WITH mysql_native_password BY 'onlyoffice_pass';
CREATE USER IF NOT EXISTS 'mail_admin'@'%' IDENTIFIED WITH mysql_native_password BY 'Isadmin123';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%';
GRANT ALL PRIVILEGES ON *.* TO 'onlyoffice_user'@'%';
GRANT ALL PRIVILEGES ON *.* TO 'mail_admin'@'%';
FLUSH PRIVILEGES;" > /app/onlyoffice/mysql/initdb/setup.sql
Carazyda commented 10 months ago

Sorry, but we do not support installation of k3s or other type of Kubernetes. I have no idea what the /nonexistent folder is. Maybe you'll try a different type of Onlyoffice installation, script or docker-compose?