haiwen / seafile-docker

A Docker image for Seafile server
Other
544 stars 183 forks source link

Seafile server option to not build a new database when pod fails (k8s) #216

Closed dan-m8t closed 2 years ago

dan-m8t commented 4 years ago

Hey,

I deployed seafile in k8s but ran into some issues as I tried to test what happens when the seafile container fails. So k8s is of course rebuilding it and trying to bring it back online

Seafile then runs its configuration and tries to add a new seafile user, password and database, but because it is already there the build fails ending up the pod stays in error state and seafile service is down. Mariadb runs in a seperate pod.

Only way to fix for me: delete mariadb deployment, delete mariadb persistent volume claim (...urgh) and redeploy all the stuff. But well, that's of course not the desired behaviour. So is there a way to tell seafile-mc container that it should NOT try to setup a new database, when a mariadb instance already exists? e.g. via environment variable.

Thanks

Dan

fvhockney commented 4 years ago

I'm having the same issue and it's pretty much a game breaker. trying to reset the admin also doesn't work Failed to connect to MySQL: Access denied for user 'seafile'@'REDACTED' (using password: YES) A cursory look around the code that checks for a user and this message makes me think that the database connection is managed by seafile. If it can't connect to check if there is a user (which is attempted) it aborts. Easiest solution is probably just to give the option to provide a DB_USER password as and ENV to docker and put it here: https://github.com/haiwen/seafile-docker/blob/master/scripts_7.1/bootstrap.py#L121-L131

fvhockney commented 4 years ago

actually just saw a couple of pull requests/issues about this Issue: https://github.com/haiwen/seafile-docker/issues/194 pull-request: https://github.com/haiwen/seafile-docker/pull/195