设置和问题

设置和问题

设置和问题

我有一个在服务器上启动的 docker-compose 文件。使用一段时间后,我希望它在第二个域名下可用,因此我使用以下命令重新启动了它:

docker-compose stop
docker-compose rm # answering yes in the process
docker-compose up -d --force-recreate

似乎底层 owncloud 映像在此期间已更新,因为我在 owncloud 日志中发现一个失败的更新(参见帖子末尾)。日志建议禁用occ app:disable richdocuments阻止安装更新的插件。当我现在尝试禁用该应用程序时:

docker-compose run --rm -u www-data owncloud php occ app:disable richdocuments
# yields: Command "app:disable" is not defined.
# Look whats possible then
docker-compose run --rm -u www-data owncloud php occ list --raw
# yields: check, help, list, status, app:check-code, maintenance:install and some integrity checks
# What is the status then?
docker-compose run --rm -u www-data owncloud php occ status
# yields:
# ownCloud is not installed - only a limited number of commands are available
# Failed to connect to the database: An exception occured in driver: SQLSTATE[HY000] [14] unable to open database file

似乎还未owncloud occ tool完全可用。此外,与数据库的连接似乎失败了。

问题

  1. 我如何occ通过该 owncloud 安装来访问该工具?
  2. 为什么连接数据库失败?

参考

docker-compose.yml

version: '2.1'
# Following
# https://owncloud.org/news/docker-owncloud-traefik-reverse-proxy-lets-encrypt-ssl/
volumes:
  files:
    driver: local
  mysql:
    driver: local
  backup:
    driver: local
  redis:
    driver: local
services:
  owncloud:
    image: owncloud/server:10.0
    restart: unless-stopped
    depends_on:
      - db
      - redis
    environment:
      - OWNCLOUD_DOMAIN=owncloud.mydomain.de
      - OWNCLOUD_DB_TYPE=mysql
      - OWNCLOUD_DB_NAME=owncloud
      - OWNCLOUD_DB_USERNAME=owncloud
      - OWNCLOUD_DB_PASSWORD=owncloud
      - OWNCLOUD_DB_HOST=db
      - OWNCLOUD_ADMIN_USERNAME=owncloud_admin
      - OWNCLOUD_ADMIN_PASSWORD=password
      - OWNCLOUD_UTF8MB4_ENABLED=true
      - OWNCLOUD_REDIS_ENABLED=true
      - OWNCLOUD_REDIS_HOST=redis
    networks:
      - web
      - internal
    labels:
      - traefik.enable=true
      - traefik.frontend.rule=Host:owncloud.mydomain.de, owncloud.myotherdomain.de
      - traefik.port=80
      - traefik.docker.network=web
    healthcheck:
      test: ["CMD", "/usr/bin/healthcheck"]
      interval: 30s
      timeout: 10s
      retries: 5
    volumes:
      - files:/mnt/data
  db:
    image: webhippie/mariadb:latest
    restart: unless-stopped
    environment:
      - MARIADB_ROOT_PASSWORD=owncloud
      - MARIADB_USERNAME=owncloud
      - MARIADB_PASSWORD=owncloud
      - MARIADB_DATABASE=owncloud
      - MARIADB_MAX_ALLOWED_PACKET=128M
      - MARIADB_INNODB_LOG_FILE_SIZE=64M
      - MARIADB_INNODB_LARGE_PREFIX=ON
      - MARIADB_INNODB_FILE_FORMAT=Barracuda
    healthcheck:
      test: ["CMD", "/usr/bin/healthcheck"]
      interval: 30s
      timeout: 10s
      retries: 5
    volumes:
      - mysql:/var/lib/mysql
      - backup:/var/lib/backup
    networks:
      - internal
  redis:
    image: webhippie/redis:latest
    restart: unless-stopped
    environment:
      - REDIS_DATABASES=1
    healthcheck:
      test: ["CMD", "/usr/bin/healthcheck"]
      interval: 30s
      timeout: 10s
      retries: 5
    volumes:
      - redis:/var/lib/redis
    networks:
      - internal
  # see https://help.nextcloud.com/t/collabora-configuration-with-docker-compose/3970
  office:
    image: collabora/code
    container_name: office
    restart: unless-stopped
    ports:
            - 9980:9980
    cap_add:
      - MKNOD
    environment:
      - DOMAIN=office.mydomain.de
      - dictionaries="de en"
    labels:
      - traefik.enable=true
      - traefik.frontend.rule=Host:office.mydomain.de
      - traefik.port=9980
      - traefik.docker.network=web
    networks:
      - web
      - internal
networks:
  web:
    external: true
  internal:

Owncloud日志:

Copying db file...
Copying utf8mb4 config...
Fixing hook perms...
Fixing base perms...
Fixing data perms...
Upgrading server database...
ownCloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
Set log level to debug
Repair step: Repair MySQL database engine
Repair step: Repair MySQL collation
Repair info: All tables already have the correct collation -> nothing to do
Repair step: Repair SQLite autoincrement
Repair step: Repair orphaned reshare
Repair step: Repair duplicate entries in oc_lucene_status
Repair info: lucene_status table does not exist -> nothing to do
Repair step: Upgrade app code from the marketplace
Repair warning: You have incompatible or missing apps enabled that could not be found or updated via the marketplace.
Repair warning: Please install or update the following apps manually or disable them with: occ app:disable richdocuments
Repair warning: For manually updating, see https://doc.owncloud.org/server/10.0/go.php?to=admin-marketplace-apps
OC\RepairException: Upgrade is not possible
Update failed

更新

为了能够方便地读取和更改数据库,我在设置中添加了 phpmyadmin:

db_admin:
  image: phpmyadmin/phpmyadmin
  restart: unless-stopped
  depends_on:
    - db
  links:
    - db
  networks:
    - web
    - internal
  environment:
    - MYSQL_USERNAME=owncloud_username
    - MYSQL_ROOT_PASSWORD=owncloud_root_password
  labels:
    traefik.enable: true
    traefik.frontend.rule: "Host:managedb.mydomain.de"
    traefik.port: 80
    traefik.docker.network: web
    traefik.frontend.auth.basic: "username:hashed_password_string"
    traefik.frontend.entryPoints: "https"
    traefik.frontend.passHostHeader: true
    traefik.backend.loadbalancer.stickiness: true

在数据库中,我找不到richdocuments任何地方 - 特别是在oc_appconfig表中。

答案1

面临类似的问题

看起来像是 owncloud 的一个错误

我使用了拐杖:

修改 docker-compose.yml

db:
image: webhippie/mariadb:latest
restart: always
ports:           <-- ADD THIS   
  - 3306:3306    <-- ADD THIS

然后

docker-compose up

现在可以通过外部客户端访问 mariadb

login: owncloud
 password: owncloud

编辑表格oc_appconfig 更改行

richdocuments   enabled --> disabled    

答案2

我更改了它使用的数据库。我认为他们的示例 docker-compose 不起作用

将数据库条目更改为如下内容:

  db:
image: mariadb:latest
restart: always
environment:
  - MYSQL_ROOT_PASSWORD=owncloud
  - MYSQL_USER=owncloud
  - MYSQL_PASSWORD=owncloud
  - MYSQL_DATABASE=owncloud
volumes:
  - mysql:/var/lib/mysql
  - backup:/var/lib/backup

相关内容