Skip to content
This repository has been archived by the owner on Oct 4, 2023. It is now read-only.

Creation of initial seafile admin fails #5

Open
UnrealKazu opened this issue Feb 8, 2018 · 5 comments
Open

Creation of initial seafile admin fails #5

UnrealKazu opened this issue Feb 8, 2018 · 5 comments

Comments

@UnrealKazu
Copy link

UnrealKazu commented Feb 8, 2018

When spinning up a fresh container, I receive the following error halfway through the initial setup script:

seafile  | Starting seahub...
seafile  | + echo 'Starting seahub...'
seafile  | + ./seahub.sh start-fastcgi
seafile  |
seafile  | LANG is not set in ENV, set to en_US.UTF-8
seafile  | LC_ALL is not set in ENV, set to en_US.UTF-8
seafile  | ./seahub.sh: line 209: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
seafile  | Starting seahub (fastcgi) at 127.0.0.1:8000 ...
seafile  |
seafile  | Error happened during creating seafile admin.

This is a snippet from the logs. The container starts fine, and I can actually get to the login page, but since the admin account has not been created, I cannot log in.

I've been digging through the Seafile codebase to find out where this pops up, and it looks like the check_init_admin.py file is where the exception is thrown, which is called by seahub.sh.

I'm creating the container using the following docker-compose:

version: '3'

services:
  cloud:
    container_name: seafile
    image: stonemaster/docker-seafile-server
    volumes:
      - /containers/Seafile:/data
    expose:
      - "80"
    environment:
      - SEAFILE_EXTERNAL_PORT=80
      - SEAFILE_HOSTNAME=localhost
      - SEAFILE_SERVER_NAME=test
      - SEAFILE_ADMIN_EMAIL=actual@email.com
      - SEAFILE_ADMIN_PASSWORD=password

networks:
  default:
    external:
      name: nginx-proxy

There is another reverse proxy in front of this container. I'm assuming this won't interfere with the admin creation process, but I'm still mentioning it just in case.

By the way: thanks for creating this. It is much, much better than the strange dockerfile wrapper script presented by the Seafile devs themselves.

@stonemaster
Copy link
Owner

stonemaster commented Feb 21, 2018

Could you give some information on the Docker and Docker-compose versions used?

I have a similar setup in use with an NGINX Reverse proxy and that definitely doesn't interfer.

This indeed is a strange bug because the Travis Build runs some unit tests and the admin creation is essential for anything to work.

  • Is there maybe a permission problem of some sort with the host mount /containers/Seafile?
  • And could you check dmesg/syslog output to problems related to SELinux or other things interfering with docker?
  • What happens without the host mount (not persitent of course)?
  • EDITED: What distribution do you use?

@UnrealKazu
Copy link
Author

My Docker host is an Ubuntu server 17.10 machine, with Docker version 17.12.0-ce and Docker-compose version 1.18.0.

I've been testing around some more (also based on your questions). Not mounting the volume still gives the same creation error, so it does not seem to be a permission error on the volume itself. As far as any dmesg logs, there are no things out of the ordinary. I tried looking into some other logging, but Seafile itself does not log a lot regarding the python bootstrap scripts they are providing, so it seems like a dead end there.

However, I found something interesting. Executing the docker run equivalent of my compose file does work. So that would be the following (minus the volume, still for testing purposes):

docker run --name seafile \
	--expose  "80" \
	-e SEAFILE_EXTERNAL_PORT=80 \
	-e SEAFILE_HOSTNAME=localhost \
	-e SEAFILE_SERVER_NAME=myseafile \
	-e SEAFILE_ADMIN_MAIL=admin@seafile.com \
	-e SEAFILE_ADMIN_PASSWORD=test123 \
        --network="nginx-proxy" \
	stonemaster/docker-seafile-server

So this seems to be an issue related to Docker-compose?

@stonemaster
Copy link
Owner

This is super weird. To my understanding docker-compose is just wrapper for docker and shouldn't do any extra stuff. I have docker 1.13 and docker-compose 1.8, so much older versions than you. I am also using Ubuntu but 16.04.

Could you post the logs of Docker after trying to create the container using docker-compose? You should be able to get the logs using journalctl -u docker -n 1000 on Ubuntu.

@UnrealKazu
Copy link
Author

The following is the resulting log of specifically creating the container.

Using docker-compose:

Feb 27 17:27:49 dockerd[951]: time="2018-02-27T17:27:49.471678449+01:00" level=info msg="ignoring event" module=libcontainerd namespace=moby topic=/containers/create type="*events.ContainerCreate"
Feb 27 17:27:49 dockerd[951]: time="2018-02-27T17:27:49+01:00" level=info msg="shim docker-containerd-shim started" address="/containerd-shim/moby/220251072f03fbe468dbc1149c12f0bf686d112ba0a2755922e517354f3268c8/shim.sock" debug=false module="containerd/tasks" pid=24321
Feb 27 17:27:49 dockerd[951]: time="2018-02-27T17:27:49.773039165+01:00" level=warning msg="unknown container" container=220251072f03fbe468dbc1149c12f0bf686d112ba0a2755922e517354f3268c8 module=libcontainerd namespace=plugins.moby
Feb 27 17:27:49 dockerd[951]: time="2018-02-27T17:27:49.790139716+01:00" level=warning msg="unknown container" container=220251072f03fbe468dbc1149c12f0bf686d112ba0a2755922e517354f3268c8 module=libcontainerd namespace=plugins.moby

And using docker run:

Feb 27 17:29:52 dockerd[951]: time="2018-02-27T17:29:52.378937285+01:00" level=info msg="ignoring event" module=libcontainerd namespace=moby topic=/containers/create type="*events.ContainerCreate"
Feb 27 17:29:52 dockerd[951]: time="2018-02-27T17:29:52+01:00" level=info msg="shim docker-containerd-shim started" address="/containerd-shim/moby/e6534d7a7fa26b562d4110654978079ffab85d53d0b23bf6a666494520097a29/shim.sock" debug=false module="containerd/tasks" pid=25555
Feb 27 17:29:52 dockerd[951]: time="2018-02-27T17:29:52.684113891+01:00" level=warning msg="unknown container" container=e6534d7a7fa26b562d4110654978079ffab85d53d0b23bf6a666494520097a29 module=libcontainerd namespace=plugins.moby
Feb 27 17:29:52 dockerd[951]: time="2018-02-27T17:29:52.705783752+01:00" level=warning msg="unknown container" container=e6534d7a7fa26b562d4110654978079ffab85d53d0b23bf6a666494520097a29 module=libcontainerd namespace=plugins.moby

They seem identical regarding the operations themselves. The moment the creation error pops up, there is no log entry created by Docker.

Could it be a rights issue, that UID and GID need to be passed into the container to properly work when using docker-compose? I'm guessing here, as it seems to be a longshot.

@s3rvant
Copy link

s3rvant commented Jan 18, 2021

Just encountered similar with a manual build on Ubuntu 20.04 and Seafile 7.1.5

Starting seahub.sh asks for admin email and password then gives the above error "Error happened during creating seafile admin"

Except in my case I cannot access the site at this point and on server curl 127.0.0.1:8000 returns nothing

Of note I did need to install libmemcached-dev via apt before I could install pylibmc and django-pylibmc via pip3

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants