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 restart error occurs when community server' is started #493

Open
Zmzzz opened this issue Jan 24, 2024 · 5 comments
Open

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

Zmzzz opened this issue Jan 24, 2024 · 5 comments

Comments

@Zmzzz
Copy link

Zmzzz commented Jan 24, 2024

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

  • '[' false == false ']'
  • '[' -e /etc/redis/redis.conf ']'
  • sed -i 's/bind .*/bind 127.0.0.1/g' /etc/redis/redis.conf
  • ELASTICSEARCH_SERVER_HOST=
  • ELASTICSEARCH_SERVER_HTTPPORT=9200
  • grep -q '
    ' /var/www/onlyoffice/WebStudio/Web.config
  • '[' ']'
  • '[' false == false ']'
  • chown -R mysql:mysql /var/lib/mysql/
  • chmod -R 755 /var/lib/mysql/
  • '[' '!' -f /var/lib/mysql/ibdata1 ']'
  • '[' ']'
  • myisamchk -q -r /var/lib/mysql/mysql/proc
    myisamchk: error: File '/var/lib/mysql/mysql/proc' doesn't exist
  • true
  • systemctl enable mysql.service
    Synchronizing state of mysql.service with SysV service script with /lib/systemd/systemd-sysv-install.
    Executing: /lib/systemd/systemd-sysv-install enable mysql
  • service mysql start
  • Starting MySQL database server mysqld
    su: warning: cannot change directory to /nonexistent: Permission denied`

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

@Zmzzz
Copy link
Author

Zmzzz commented Jan 24, 2024

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
Copy link
Member

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

@Zmzzz
Copy link
Author

Zmzzz commented Jan 24, 2024

@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
Copy link
Author

Zmzzz commented Jan 24, 2024

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
Copy link
Member

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?

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