Can't start up OCIS docker image after pull with "error":"cannot open index, metadata corrupt" error
- Dominant language
- Go
- Stars
- 2.1k
- Forks
- 274
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 103
Description
## Describe the bug
I had a running instance of OCIS and did a docker compose pull to update it to the latest version. I didn't look at the Release Notes and forgot to add the new necessary configuration variables before starting, but I fixed that and after restart both the search and graph service report errors and OCIS doesn't start
## Steps to reproduce
Steps to reproduce the behavior:
1. Have a pre-2.0.0 install of the OCIS docker image
2. Pull a the new version and forget to add the new configuration variables for the first start
3. Fix the configuration and start it again
## Expected behavior
OCIS should start normally
## Actual behavior
OCIS refuses to start with the following errors:
```console
❯ docker compose up
[+] Running 1/1
⠿ Container ocis-ocis-1 Created 0.2s
Attaching to ocis-ocis-1
ocis-ocis-1 | 2023/01/10 14:36:57 Could not create config: config in /etc/ocis/ocis.yaml already exists
ocis-ocis-1 | {"level":"error","service":"search","error":"cannot open index, metadata corrupt","time":"2023-01-10T14:36:57.501220039Z","message":"Error initializing search service"}
ocis-ocis-1 | {"level":"error","service":"search","error":"cannot open index, metadata corrupt","time":"2023-01-10T14:36:57.501555113Z","message":"Error initializing search service"}
ocis-ocis-1 | {"level":"error","service":"search","error":"cannot open index, metadata corrupt","time":"2023-01-10T14:36:57.50521034Z","message":"Error initializing search service"}
ocis-ocis-1 | {"level":"error","service":"search","error":"cannot open index, metadata corrupt","time":"2023-01-10T14:36:57.505509777Z","message":"Error initializing search service"}
ocis-ocis-1 | {"level":"error","service":"search","error":"cannot open index, metadata corrupt","time":"2023-01-10T14:36:57.505732167Z","message":"Error initializing search service"}
ocis-ocis-1 | {"level":"error","service":"search","error":"cannot open index, metadata corrupt","time":"2023-01-10T14:36:57.505943918Z","message":"Error initializing search service"}
ocis-ocis-1 | {"level":"error","service":"graph","error":"LDAP Result Code 200 \"Network Error\": dial tcp [::1]:9235: connect: connection refused","time":"2023-01-10T14:36:58.010552219Z","message":"could not get ldap Connection"}
ocis-ocis-1 | {"level":"error","service":"graph","error":"LDAP Result Code 200 \"Network Error\": dial tcp [::1]:9235: connect: connection refused","time":"2023-01-10T14:36:58.010567177Z","message":"autoconnect could not get ldap Connection"}
ocis-ocis-1 | {"level":"error","service":"search","error":"cannot open index, metadata corrupt","time":"2023-01-10T14:37:01.137629754Z","message":"Error initializing search service"}
ocis-ocis-1 | {"level":"error","service":"search","error":"cannot open index, metadata corrupt","time":"2023-01-10T14:37:01.138132966Z","message":"Error initializing search service"}
ocis-ocis-1 | {"level":"error","service":"search","error":"cannot open index, metadata corrupt","time":"2023-01-10T14:37:01.138517834Z","message":"Error initializing search service"}
ocis-ocis-1 | {"level":"error","service":"search","error":"cannot open index, metadata corrupt","time":"2023-01-10T14:37:01.138815798Z","message":"Error initializing search service"}
ocis-ocis-1 | {"level":"error","service":"search","error":"cannot open index, metadata corrupt","time":"2023-01-10T14:37:01.13913369Z","message":"Error initializing search service"}
ocis-ocis-1 | {"level":"error","service":"search","error":"cannot open index, metadata corrupt","time":"2023-01-10T14:37:01.139420983Z","message":"Error initializing search service"}
ocis-ocis-1 | {"level":"error","service":"search","error":"cannot open index, metadata corrupt","time":"2023-01-10T14:37:05.288434036Z","message":"Error initializing search service"}
ocis-ocis-1 | {"level":"error","service":"search","error":"cannot open index, metadata corrupt","time":"2023-01-10T14:37:05.288851156Z","message":"Error initializing search service"}
ocis-ocis-1 | {"level":"error","service":"search","error":"cannot open index, metadata corrupt","time":"2023-01-10T14:37:05.289262274Z","message":"Error initializing search service"}
ocis-ocis-1 | {"level":"error","service":"search","error":"cannot open index, metadata corrupt","time":"2023-01-10T14:37:05.28960389Z","message":"Error initializing search service"}
ocis-ocis-1 | {"level":"error","service":"search","error":"cannot open index, metadata corrupt","time":"2023-01-10T14:37:05.289917343Z","message":"Error initializing search service"}
ocis-ocis-1 | {"level":"error","service":"search","error":"cannot open index, metadata corrupt","time":"2023-01-10T14:37:05.290240104Z","message":"Error initializing search service"}
ocis-ocis-1 | {"level":"error","service":"search","error":"cannot open index, metadata corrupt","time":"2023-01-10T14:37:09.721940254Z","message":"Error initializing search service"}
ocis-ocis-1 | {"level":"error","service":"search","error":"cannot open index, metadata corrupt","time":"2023-01-10T14:37:09.722367022Z","message":"Error initializing search service"}
ocis-ocis-1 | {"level":"error","service":"search","error":"cannot open index, metadata corrupt","time":"2023-01-10T14:37:09.722740929Z","message":"Error initializing search service"}
ocis-ocis-1 | {"level":"error","service":"search","error":"cannot open index, metadata corrupt","time":"2023-01-10T14:37:09.723049163Z","message":"Error initializing search service"}
ocis-ocis-1 | {"level":"error","service":"search","error":"cannot open index, metadata corrupt","time":"2023-01-10T14:37:09.723349892Z","message":"Error initializing search service"}
ocis-ocis-1 | {"level":"error","service":"search","error":"cannot open index, metadata corrupt","time":"2023-01-10T14:37:09.723633819Z","message":"Error initializing search service"}
ocis-ocis-1 | {"level":"error","service":"search","error":"cannot open index, metadata corrupt","time":"2023-01-10T14:37:13.582420588Z","message":"Error initializing search service"}
ocis-ocis-1 | {"level":"error","service":"search","error":"cannot open index, metadata corrupt","time":"2023-01-10T14:37:13.582740764Z","message":"Error initializing search service"}
ocis-ocis-1 | {"level":"error","service":"search","error":"cannot open index, metadata corrupt","time":"2023-01-10T14:37:13.583070849Z","message":"Error initializing search service"}
ocis-ocis-1 | {"level":"error","service":"search","error":"cannot open index, metadata corrupt","time":"2023-01-10T14:37:13.583368151Z","message":"Error initializing search service"}
ocis-ocis-1 | {"level":"error","service":"search","error":"cannot open index, metadata corrupt","time":"2023-01-10T14:37:13.583648933Z","message":"Error initializing search service"}
ocis-ocis-1 | {"level":"error","service":"search","error":"cannot open index, metadata corrupt","time":"2023-01-10T14:37:13.583905628Z","message":"Error initializing search service"}
ocis-ocis-1 exited with code 0
```
## Setup
Please describe how you started the server and provide a list of relevant environment variables or configuration files.
### docker-compose.yml
```yaml
---
version: "3.7"
services:
ocis:
image: owncloud/ocis:${OCIS_DOCKER_TAG:-latest}
user: 1000:1000
entrypoint:
- /bin/sh
# run ocis init to initialize a configuration file with random secrets
# it will fail on subsequent runs, because the config file already exists
# therefore we ignore the error and then start the ocis server
command: ["-c", "ocis init || true; ocis server"]
environment:
OCIS_URL: https://${OCIS_DOMAIN:-ocis.owncloud.test}
OCIS_LOG_LEVEL: ${OCIS_LOG_LEVEL:-error} # make oCIS less verbose
OCIS_LOG_COLOR: "${OCIS_LOG_COLOR:-false}"
PROXY_TLS: "false" # do not use SSL between Traefik and oCIS
# INSECURE: needed if oCIS / Traefik is using self generated certificates
OCIS_INSECURE: "${INSECURE:-false}"
# basic auth (not recommended, but needed for eg. WebDav clients that do not support OpenID Connect)
PROXY_ENABLE_BASIC_AUTH: "${PROXY_ENABLE_BASIC_AUTH:-false}"
# admin user password
IDM_ADMIN_PASSWORD: "${ADMIN_PASSWORD:-admin}" # this overrides the admin password from the configuration file
# demo users
IDM_CREATE_DEMO_USERS: "${DEMO_USERS:-false}"
# email server (in this case inbucket acts as mail catcher)
NOTIFICATIONS_SMTP_HOST: #####
NOTIFICATIONS_SMTP_PORT: ####
NOTIFICATIONS_SMTP_SENDER: oCIS notifications
NOTIFICATIONS_SMTP_USERNAME: ####
NOTIFICATIONS_SMTP_PASSWORD: ####
NOTIFICATIONS_SMTP_INSECURE: false
volumes:
- ./config:/etc/ocis
- /data/ocis:/var/lib/ocis
labels:
- "traefik.enable=true"
- "traefik.http.routers.ocis.entrypoints=https"
- "traefik.http.routers.ocis.rule=Host(`${OCIS_DOMAIN:-ocis.owncloud.test}`, `####`)"
- "traefik.http.routers.ocis.tls.certresolver=letsencrypt"
- "traefik.http.routers.ocis.service=ocis"
- "traefik.http.services.ocis.loadbalancer.server.port=9200"
logging:
driver: "local"
restart: always
networks:
default:
external: true
name: proxynet
```
### ocis.yml
```yaml
token_manager:
jwt_secret: j9#PXC*Mmdn+Jvy4^0CoqybL4zfp7V4s
machine_auth_api_key: VN2c5JBjVKM.@bb+$Z!J8I#fD==XX*FA
system_user_api_key: CU@t885o-rww+tRwOtdJ2dggl*uGdeLa
transfer_secret: ^AJnzalT#DgWowzg*PmuygLi$z+UDm-7
system_user_id: 7eabb266-d646-430c-b158-39593ad3503d
admin_user_id: ff7a37b2-c99d-4e69-a095-731a81f0be28
graph:
spaces:
insecure: false
identity:
ldap:
bind_password: '!XG93N%dsb&Vd*LPllMGD2DLlIIg4iR='
idp:
ldap:
bind_password: yX.86OiKD8xdTF3Gkb6CU^yTUb&3^!EO
idm:
service_user_passwords:
admin_password: ####
idm_password: '!XG93N%dsb&Vd*LPllMGD2DLlIIg4iR='
reva_password: ab@W2LUuKyW2jt-ygW=rSKN&SHrB8k37
idp_password: yX.86OiKD8xdTF3Gkb6CU^yTUb&3^!EO
proxy:
oidc:
insecure: false
insecure_backends: false
frontend:
archiver:
insecure: false
auth_basic:
auth_providers:
ldap:
bind_password: ab@W2LUuKyW2jt-ygW=rSKN&SHrB8k37
auth_bearer:
auth_providers:
oidc:
insecure: false
users:
drivers:
ldap:
bind_password: ab@W2LUuKyW2jt-ygW=rSKN&SHrB8k37
groups:
drivers:
ldap:
bind_password: ab@W2LUuKyW2jt-ygW=rSKN&SHrB8k37
ocdav:
insecure: false
thumbnails:
thumbnail:
transfer_secret: 2VoIC=SE%Vts*CoTeTyA1.lE5ULqV73p
webdav_allow_insecure: false
cs3_allow_insecure: false
storage_users:
mount_id: 0bb94ff6-247f-45c3-a906-843e4917f333
gateway:
storage_registry:
storage_users_mount_id: 0bb94ff6-247f-45c3-a906-843e4917f333d
```
### .env
```sh
# If you're on a internet facing server please comment out following line.
# It skips certificate validation for various parts of oCIS and is needed if you use self signed certificates.
#INSECURE=true
### oCIS settings ###
# oCIS version. Defaults to "latest"
OCIS_DOCKER_TAG=
# Domain of oCIS, where you can find the frontend. Defaults to "ocis.owncloud.test"
OCIS_DOMAIN=####
# oCIS admin user password. Defaults to "admin".
ADMIN_PASSWORD=####
# The demo users should not be created on a production instance
# because their passwords are public. Defaults to "false".
DEMO_USERS=
# If you want to use debugging and tracing with this stack,
# you need uncomment following line. Please see documentation at
# https://owncloud.dev/ocis/deployment/monitoring-tracing/
#COMPOSE_FILE=docker-compose.yml:monitoring_tracing/docker-compose-additions.yml
GATEWAY_STORAGE_USERS_MOUNT_ID=0bb94ff6-247f-45c3-a906-843e4917f333
STORAGE_USERS_MOUNT_ID=0bb94ff6-247f-45c3-a906-843e4917f333
```
## Additional context
Add any other context about the problem here.
Contributor guide
Assessment
This issue has not been assessed yet.