Not Starting Correctly After Install

server

#1

Hello,

I installed server version 6.3.4 following https://manual.seafile.com/deploy/using_mysql.html and https://manual.seafile.com/deploy/deploy_with_nginx.html on CentOS 7.6 on AWS.

When I start the server (either using systemctl or locally) the server starts and I can access the web interface, login as admin, etc. But I can’t create a new library, and the log files are constantly spamming. See below for log data (clipped for repeated regions). Selinux is permissive during these tests and debugging. Firewall is open for 22, 80, 443. Seafile is running under the user seafile in /home/seafile. There isn’t anything relevant in nginx logs. Any help would be appreciated! Please let me know what other information I can provide (sorry if I dumped to much information initially!).

Conf Files

conf/ccnet.conf

[General]
USER_NAME = seafile
ID = [secret]
NAME = [hostname]
SERVICE_URL = https://[public URL]

[Client]
PORT = 13419
# Tried the following based on https://github.com/haiwen/seafile-vagrant/issues/2
# UNIX_SOCKET=/tmp/ccnet.sock

[Database]
ENGINE = mysql
HOST = 127.0.0.1
PORT = 3306
USER = seafile
PASSWD = [secret]
DB = ccnet-db
CONNECTION_CHARSET = utf8

conf/gunicorn.conf


import os

daemon = True
workers = 5

# default localhost:8000
bind = "127.0.0.1:8000"

# Pid
pids_dir = '/home/seafile/[org]/pids'
pidfile = os.path.join(pids_dir, 'seahub.pid')

# for file upload, we need a longer timeout value (default is only 30s, too short)
timeout = 1200

limit_request_line = 8190

conf/seafdav.conf


[WEBDAV]
enabled = false
port = 8080
fastcgi = false
share_name = /

conf/seafile.conf

[fileserver]
host = 172.0.0.1
port = 8082

[database]
type = mysql
host = 127.0.0.1
port = 3306
user = seafile
password = [secret]
db_name = seafile-db
connection_charset = utf8

conf/seahub_settings.py

# -*- coding: utf-8 -*-
SECRET_KEY = "[secret]"

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'seahub-db',
        'USER': 'seafile',
        'PASSWORD': '[secret]',
        'HOST': '127.0.0.1',
        'PORT': '3306'
    }
}
FILE_SERVER_ROOT = 'https://seafile.[org].com/seafhttp'

Logs

logs/ccnet.log

[01/02/19 06:49:23] ../common/session.c(132): using config file /home/seafile/[org]/conf/ccnet.conf
[01/02/19 06:49:23] ../common/session.c(455): socket file exists, delete it anyway
[01/02/19 06:49:23] ../common/session.c(484): Listen on /home/seafile/[org]/ccnet/ccnet.sock for local clients
[01/02/19 06:49:23] ../common/session.c(290): Update pubinfo file
[01/02/19 06:49:24] ../common/session.c(398): Accepted a local client
[01/02/19 06:49:24] ../common/session.c(398): Accepted a local client
[01/02/19 06:49:24] ../common/session.c(398): Accepted a local client
[01/02/19 06:49:24] ../common/session.c(398): Accepted a local client
[01/02/19 06:49:24] ../common/peer.c(943): Local peer down
[01/02/19 06:49:24] ../common/peer.c(943): Local peer down

logs/controller.log

[01/02/19 06:50:51] seafile-controller.c(411): pid file /home/seafile/[org]/pids/seaf-server.pid does not exist
[01/02/19 06:50:51] seafile-controller.c(432): seaf-server need restart...
[01/02/19 06:50:51] Disconnected from daemon
[01/02/19 06:50:51] seafile-controller.c(488): restarting ccnet server ...
[01/02/19 06:50:51] seafile-controller.c(169): starting ccnet-server ...
[01/02/19 06:50:51] seafile-controller.c(73): spawn_process: ccnet-server -F /home/seafile/[org]/conf -c /home/seafile/[org]/ccnet -f /home/seafile/[org]/logs/ccnet.log -d -P /home/seafile/[org]/pids/ccnet.pid
[01/02/19 06:50:51] seafile-controller.c(88): spawned ccnet-server, pid 6970
[01/02/19 06:50:52] seafile-controller.c(571): ccnet daemon connected.
[01/02/19 06:50:52] seafile-controller.c(201): starting seaf-server ...
[01/02/19 06:50:52] seafile-controller.c(73): spawn_process: seaf-server -F /home/seafile/[org]/conf -c /home/seafile/[org]/ccnet -d /home/seafile/[org]/seafile-data -l /home/seafile/[org]/logs/seafile.log -P /home/seafile/[org]/pids/seaf-server.pid
[01/02/19 06:50:52] seafile-controller.c(88): spawned seaf-server, pid 6974
[01/02/19 06:50:52] seafile-controller.c(544): seafdav not enabled.

logs/seafile.log

[01/02/19 06:54:21] http-server.c(173): fileserver: worker_threads = 10
[01/02/19 06:54:21] http-server.c(188): fileserver: fixed_block_size = 8388608
[01/02/19 06:54:21] http-server.c(203): fileserver: web_token_expire_time = 3600
[01/02/19 06:54:21] http-server.c(218): fileserver: max_indexing_threads = 1
[01/02/19 06:54:21] http-server.c(233): fileserver: max_index_processing_threads= 3
[01/02/2019 06:54:21 AM] ../common/mq-mgr.c(54): [mq client] mq cilent is started
[01/02/2019 06:54:21 AM] http-server.c(2197): Could not bind socket: Cannot assign requested address

logs/seahub.log

    SearpcError: Error received: 511 Unknown service (In _start_service)
2019-01-02 06:31:44,552 [ERROR] django.request:135 handle_uncaught_exception Internal Server Error: /api2/repos/
Traceback (most recent call last):
  File "/home/seafile/[org]/seafile-server-6.3.4/seahub/thirdpart/django/core/handlers/exception.py", line 41, in inner
    response = get_response(request)
  File "/home/seafile/[org]/seafile-server-6.3.4/seahub/thirdpart/django/core/handlers/base.py", line 249, in _legacy_get_response
    response = self._get_response(request)
  File "/home/seafile/[org]/seafile-server-6.3.4/seahub/thirdpart/django/core/handlers/base.py", line 187, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/home/seafile/[org]/seafile-server-6.3.4/seahub/thirdpart/django/core/handlers/base.py", line 185, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/seafile/[org]/seafile-server-6.3.4/seahub/thirdpart/django/views/decorators/csrf.py", line 58, in wrapped_view
    return view_func(*args, **kwargs)
  File "/home/seafile/[org]/seafile-server-6.3.4/seahub/thirdpart/django/views/generic/base.py", line 68, in view
    return self.dispatch(request, *args, **kwargs)
  File "/home/seafile/[org]/seafile-server-6.3.4/seahub/seahub/api2/base.py", line 23, in dispatch
    response = super(APIView, self).dispatch(*a, **kw)
  File "/home/seafile/[org]/seafile-server-6.3.4/seahub/thirdpart/rest_framework/views.py", line 466, in dispatch
    response = self.handle_exception(exc)
  File "/home/seafile/[org]/seafile-server-6.3.4/seahub/seahub/api2/base.py", line 20, in handle_exception
    return super(APIView, self).handle_exception(exc)
  File "/home/seafile/[org]/seafile-server-6.3.4/seahub/thirdpart/rest_framework/views.py", line 463, in dispatch
    response = handler(request, *args, **kwargs)
  File "/home/seafile/[org]/seafile-server-6.3.4/seahub/seahub/api2/views.py", line 854, in post
    if not is_valid_dirent_name(repo_name):
  File "/home/seafile/[org]/seafile-server-6.3.4/seahub/seahub/utils/__init__.py", line 263, in is_valid_dirent_name
    return seafile_api.is_valid_filename('fake_repo_id', name)
  File "/home/seafile/[org]/seafile-server-6.3.4/seafile/lib64/python2.7/site-packages/seaserv/api.py", line 178, in is_valid_filename
    return seafserv_threaded_rpc.is_valid_filename(repo_id, filename)
  File "/home/seafile/[org]/seafile-server-6.3.4/seafile/lib64/python2.7/site-packages/pysearpc/client.py", line 110, in newfunc
    ret_str = self.call_remote_func_sync(fcall_str)
  File "/home/seafile/[org]/seafile-server-6.3.4/seafile/lib64/python2.7/site-packages/ccnet/rpc.py", line 75, in call_remote_func_sync
    req_id = self._start_service(client)
  File "/home/seafile/[org]/seafile-server-6.3.4/seafile/lib64/python2.7/site-packages/ccnet/rpc.py", line 36, in _start_service
    raise SearpcError("Error received: %s %s (In _start_service)" % (rsp.code, rsp.code_msg))
SearpcError: Error received: 511 Unknown service (In _start_service)

All the above logs repeat every 10 seconds except for conf/seahub.log which prints that stack trace at the start/restart of the seafile/seahub service.

/etc/systemd/system/seafile.service

[Unit]
Description=Seafile
# add mysql.service or postgresql.service depending on your database to the line below
After=network.target mysql.service

[Service]
Type=forking
ExecStart=/home/seafile/[org]/seafile-server-latest/seafile.sh start
ExecStop=/home/seafile/[org]/seafile-server-latest/seafile.sh stop
User=seafile
Group=seafile

[Install]
WantedBy=multi-user.target

/etc/systemd/system/seahub.service

[Unit]
Description=Seafile hub
After=network.target seafile.service

[Service]
Type=forking
# change start to start-fastcgi if you want to run fastcgi
ExecStart=/home/seafile/[org]/seafile-server-latest/seahub.sh start
ExecStop=/home/seafile/[org]/seafile-server-latest/seahub.sh stop
User=seafile
Group=seafile

[Install]
WantedBy=multi-user.target

/etc/nginx/conf.d/seafile.[org].com.conf

server {
  server_name seafile.[org].com;
  listen 443 ssl; # managed by Certbot
  ssl_certificate /etc/letsencrypt/live/seafile.[org].com/fullchain.pem; # managed by Certbot
  ssl_certificate_key /etc/letsencrypt/live/seafile.[org].com/privkey.pem; # managed by Certbot
  include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
  ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
  proxy_set_header X-Forwarded-For $remote_addr;
  server_tokens off;

  location / {
    proxy_pass http://127.0.0.1:8000;
    proxy_set_header   Host $host;
    proxy_set_header   X-Real-IP $remote_addr;
    proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header   X-Forwarded-Host $server_name;
    proxy_read_timeout  1200s;

    # used for view/edit office file via Office Online Server
    client_max_body_size 0;

    access_log      /var/log/nginx/seahub.access.log;
    error_log       /var/log/nginx/seahub.error.log;
  }

  location /seafhttp {
    rewrite ^/seafhttp(.*)$ $1 break;
    proxy_pass http://127.0.0.1:8082;
    client_max_body_size 0;
    proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;

    proxy_connect_timeout  36000s;
    proxy_read_timeout  36000s;
    proxy_send_timeout  36000s;

    send_timeout  36000s;
  }

  location /media {
    root /home/seafile/[org]/seafile-server-latest/seahub;
  }
}

server {
    if ($host = seafile.[org].com) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


  listen 80;
  server_tokens off;
  server_name seafile.[org].com;
    return 404; # managed by Certbot


} 

netstat -tulpn

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:3306            0.0.0.0:*               LISTEN      4389/mysqld         
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      1/systemd           
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      4199/nginx: master  
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      4500/sshd           
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      4444/master         
tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN      4199/nginx: master  
tcp        0      0 127.0.0.1:8000          0.0.0.0:*               LISTEN      6534/python2.7      
tcp6       0      0 :::111                  :::*                    LISTEN      1/systemd           
tcp6       0      0 :::80                   :::*                    LISTEN      4199/nginx: master  
tcp6       0      0 :::22                   :::*                    LISTEN      4500/sshd           
tcp6       0      0 ::1:25                  :::*                    LISTEN      4444/master         
udp        0      0 0.0.0.0:68              0.0.0.0:*                           3979/dhclient       
udp        0      0 0.0.0.0:111             0.0.0.0:*                           1/systemd           
udp        0      0 0.0.0.0:661             0.0.0.0:*                           3099/rpcbind        
udp        0      0 127.0.0.1:323           0.0.0.0:*                           3395/chronyd        
udp6       0      0 :::111                  :::*                                1/systemd           
udp6       0      0 :::661                  :::*                                3099/rpcbind        
udp6       0      0 ::1:323                 :::*                                3395/chronyd

Firewall is open for 22, 80, 443.


#2

Sorry to bump my own post, but doesn anyone have any ideas here? Thanks!