Internal Server error but no error in the logs

Hi

This is my first Seafile installation and I cannot find the cause/error why it does not work. I will really appreciate it if someone can point me in the right direction on how to troubleshoot this.

My setup in Ubuntu 20, Nginx, MariaDB 10.3.25

I followed these instructions: https ://manual.seafile.com/deploy/using_mysql/

But when I connect with my browser I get “Internal Server Error”

The logs:

cat controller.log
[01/25/21 14:01:59] seafile-controller.c(189): starting seaf-server ...
[01/25/21 14:01:59] seafile-controller.c(80): spawn_process: seaf-server -F /opt/seafile/conf -c /opt/seafile/ccnet -d /opt/seafile/seafile-data -l /opt/seafile/logs/seafile.log -P /opt/seafile/pids/seaf-server.pid -p /opt/seafile/seafile-server-8.0.2/runtime
[01/25/21 14:01:59] seafile-controller.c(114): spawned seaf-server, pid 152615
root@vmi501259:/opt/seafile/logs# cat seafile.log
[01/25/21 14:01:59] ../common/seaf-utils.c(333): Use database Mysql
[01/25/21 14:01:59] http-server.c(181): fileserver: worker_threads = 10
[01/25/21 14:01:59] http-server.c(196): fileserver: fixed_block_size = 8388608
[01/25/21 14:01:59] http-server.c(211): fileserver: web_token_expire_time = 3600
[01/25/21 14:01:59] http-server.c(226): fileserver: max_indexing_threads = 1
[01/25/21 14:01:59] http-server.c(241): fileserver: max_index_processing_threads= 3
[01/25/21 14:01:59] http-server.c(263): fileserver: cluster_shared_temp_file_mode = 600
[01/25/2021 02:18:58 PM] start to serve on pipe client
[01/25/2021 03:48:30 PM] start to serve on pipe client
[01/25/2021 03:51:57 PM] start to serve on pipe client
[01/25/2021 03:56:32 PM] start to serve on pipe client
[01/25/2021 04:08:12 PM] start to serve on pipe client
[01/25/2021 04:13:51 PM] start to serve on pipe client
[01/25/2021 04:16:29 PM] start to serve on pipe client

seahub.log is empty
seafhttp.error.log is empty

tail -f seahub.access.log
- ********* [25/Jan/2021:20:03:16 +0100] "GET / HTTP/2.0" 500 141 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0" 0.008
tail -f seahub.error.log

Doesn’t move when I access the URL in my webbrowser that display “Internal Server Error”.

Any advise what else I could try or look at?

Hi
Did you check the “gunicorn.conf” file in the “conf” folder?
to be able to access the server from outside without a proxy you must modify the “bind” line like this and restart seafile

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

I noticed that the config is port 8000 and in nginx it is 8082. Are they supposed to be the same?

The content of my gunicorn.conf.py is


import os

daemon = True
workers = 5

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

# Pid
pids_dir = '/opt/seafile/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

It is still the default settings I have not touched.

My nginx config is:

log_format seafileformat '$http_x_forwarded_for $remote_addr [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" $upstream_response_time';

server {
    listen       80;
    server_name cloud.*****.net.za;
    rewrite ^ https://$http_host$request_uri? permanent;    # force redirect http to https

    # Enables or disables emitting nginx version on error pages and in the "Server" response header field.
    server_tokens off;
}

server {
	listen 443 http2;
	listen [::]:443 http2;

    server_name cloud.******.net.za;

    proxy_set_header X-Forwarded-For $remote_addr;

    ssl_certificate /etc/letsencrypt/live/*******/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/*********/privkey.pem; # managed by Certbot
	add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
	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 seafileformat;
         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;
	proxy_request_buffering off;

        send_timeout  36000s;

        access_log      /var/log/nginx/seafhttp.access.log seafileformat;
        error_log       /var/log/nginx/seafhttp.error.log;
    }

    location /media {
        root /var/seahub;
    }
}

(I just masked out **** some sensitive info)

location /media {
    root /patch/to/folder/seafile-server-latest/seahub;

@Cisco thank you for pointing out my error. I changed it to:

    location /media {
        root /opt/seafile/seafile-server-latest/seahub;
    }

but it made no difference after the nginx restart.

try to reach your server on port 8000 with ip address first xxx.xxx.x.x:8000 by configuring the bind:
bind = “0.0.0.0:8000” and restarting seafile and seahub.
if you succeed you will know that the problem comes from nginx

I changed the binding address as instructed. I also turned off my firewall just in case it interferes, but unfortunately I still get “Internal Server Error”.

This is on port 8000.

I have dropped all the databases and deleted all the seafile files and restart the installation but this time with the old version 7 server. After the installation I got at least some error messages (I think version 8 has a bug here that does not log error messages) that showed the some captcha module was missing (although I did install it). After a few hours of Googling I found this command solved it for me:

pip3 install --ignore-installed --timeout=3600 Pillow captcha jinja2 sqlalchemy psd-tools django-pylibmc python3-ldap

The important part is the --ignore-installed parameter.

we will take over the problem slowly are you using SeafilePro or CE?

ccnet.conf

[General]
SERVICE_URL = http://seafile.boubou.xe:8000

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

[Slow_log]
# default to true
ENABLE_SLOW_LOG = true
# the unit of all slow log thresholds is millisecond.
# default to 5000 milliseconds, only RPC queries processed for longer than 5000 milliseconds will be  logged.
RPC_SLOW_THRESHOLD = 5000

gunicorn.conf.py

import os

daemon = True
workers = 5

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

# Pid
pids_dir = '/home/xxxxxx/cloud/seafile/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

> Citation

Seafdav

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

seafevents.conf

[DATABASE]
type = mysql
host = 127.0.0.1
port = 3306
username = seafile
password = @Tb......
name = seahub-db



[AUDIT]
enabled = true

[INDEX FILES]
enabled = true
interval = 60m

highlight = fvh

## If true, indexes the contents of office/pdf files while updating search index
## Note: If you change this option from "false" to "true", then you need to clear the search index and update the index again. See the FAQ for details.
index_office_pdf = true

## where to store the converted office/pdf files. Deafult is /tmp/.
outputdir = /tmp/

[OFFICE CONVERTER]
enabled = true
workers = 3

## the max size of documents allowed to be previewed online, in MB. Default is 10 MB
## Previewing a large file (for example >30M) online is likely going to freeze the browser.
max-size = 30

[SEAHUB EMAIL]
enabled = true

## interval of sending Seahub email. Can be s(seconds), m(minutes), h(hours), d(days)
interval = 30m

# Enable statistics
[STATISTICS]
enabled=true

seafile.conf

[fileserver]
port = 8082

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

# After how much time a temp file will be removed. The unit is in seconds. Default to 3 days.
http_temp_file_ttl = 259200
# File scan interval. The unit is in seconds. Default to 1 hour.
http_temp_scan_interval = 86400

#Set block size to 1MB
#fixed_block_size=8
worker_threads = 20
max_indexing_threads = 20
#Set uploading time limit to 3600s 
web_token_expire_time=86400

# Use larger connection pool
max_connections = 200

[quota]
# default user quota in GB, integer only
default = 50

[history]
keep_days = 3

[library_trash]
# How often trashed libraries are scanned for removal, default 1 day.
scan_days = 1

# How many days to keep trashed libraries, default 30 days.
#expire_days = 7

[zip]
# The file name encoding of the downloaded zip file.
windows_encoding = iso-8859-1

# Set maximum upload file size to 200M.
max_upload_size= 200000

# Set maximum download directory size to 200M.
max_download_dir_size= 200000

[file_lock]
default_expire_hours = 4

[Slow_log]
# default to true

seahub.settings.py

# -*- coding: utf-8 -*-
SECRET_KEY = "b'l^iu=n6!ph=loooolkv6^_zizbf'"

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'seahub-db',
        'USER': 'seafile',
        'PASSWORD': '@T.',
        'HOST': '127.11110.1',
        'PORT': '3306'
    }
}

EMAIL_USE_SSL = True
#EMAIL_BACKEND = 'django_smtp_ssl.SSLEmailBackend'
#EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' 
EMAIL_HOST = 'ssl0.tt.net'
EMAIL_HOST_USER = 'cloud@hhhhu.me'
EMAIL_HOST_PASSWORD = '@Tb78...'
EMAIL_PORT = 465
DEFAULT_FROM_EMAIL = EMAIL_HOST_USER
SERVER_EMAIL = EMAIL_HOST_USER
REPLACE_FROM_EMAIL = True
ADD_REPLY_TO_HEADER = True

#DEBUG = True

# For security consideration, please set to match the host/domain of your site, e.g., ALLOWED_HOSTS = ['.example.com'].
# Please refer https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts for details.
ALLOWED_HOSTS = ['.boubcvvme']

ENABLE_WIKI = True

#ENABLE_DEMO_USER = True
#CLOUD_DEMO_USER = 'demo@bousdsdsou.me'

#BRANDING_CSS = 'custom/custom.css'
#LOGO_PATH = 'custom/mylogo.png'
#LOGO_WIDTH = 250
#LOGO_HEIGHT = 41
#DESKTOP_CUSTOM_BRAND = 'Mon Cloud Personnel'
#DESKTOP_CUSTOM_LOGO = 'custom/desktop-custom-logo.png'
#FAVICON_PATH = 'custom/favicon.png'

# video thumbnails
#ENABLE_VIDEO_THUMBNAIL = False
THUMBNAIL_VIDEO_FRAME_TIME = 15  # use the frame at 5 second as thumbnail
ENABLE_RESUMABLE_FILEUPLOAD = True
TIME_ZONE = 'Europe/Paris'
LANGUAGE_CODE = 'fr'
ENABLE_TERMS_AND_CONDITIONS = False
ENABLE_SYS_ADMIN_VIEW_REPO = True
SHOW_TRAFFIC = True
SITE_NAME = 'Seafile'
SITE_TITLE = 'Mon Espace Cloud'
#ENABLE_SHARE_LINK_AUDIT = False
ENABLE_UPLOAD_LINK_VIRUS_CHECK = False
USE_PDFJS = True
FILE_PREVIEW_MAX_SIZE = 40 * 1024 * 1024
ENABLE_THUMBNAIL = True
THUMBNAIL_ROOT = '/home/boubou/cloud/seafile/seahub-data/thumbnail'
THUMBNAIL_SIZE_FOR_ORIGINAL = 1024
THUMBNAIL_IMAGE_SIZE_LIMIT = 30 # MB
ENABLE_GUEST_INVITATION = True
NOTIFY_ADMIN_AFTER_REGISTRATION = True
ENABLE_USER_CLEAN_TRASH = True
ENABLE_SHARE_TO_ALL_GROUPS = True
ENABLE_SHOW_CONTACT_EMAIL_WHEN_SEARCH_USER = True
ENABLE_TWO_FACTOR_AUTH = True

#ENABLE_STORAGE_CLASSES = True

# Whether to allow user to delete account, change login password or update basic user
# info on profile page.
# Since PRO 6.3.10
ENABLE_DELETE_ACCOUNT = True
ENABLE_UPDATE_USER_INFO = True
ENABLE_CHANGE_PASSWORD = True

# Whether to send email when a system admin adding a new member. Default is `True`.
SEND_EMAIL_ON_ADDING_SYSTEM_MEMBER = True
# Whether to send email when a system staff resetting user's password.
SEND_EMAIL_ON_RESETTING_USER_PASSWD = True
# Send system admin notify email when user registration is complete. Default is `False`.
NOTIFY_ADMIN_AFTER_REGISTRATION = True

# Age of cookie, in seconds (default: 2 weeks).
SESSION_COOKIE_AGE = 60 * 60 * 24 * 7 * 2

# Whether a user's session cookie expires when the Web browser is closed.
SESSION_EXPIRE_AT_BROWSER_CLOSE = False

# Whether to save the session data on every request. Default is `False`
SESSION_SAVE_EVERY_REQUEST = False

# Interval for browser requests unread notifications
# Since PRO 6.1.4 or CE 6.1.2
UNREAD_NOTIFICATIONS_REQUEST_INTERVAL = 3 * 60 # seconds

# Add the ability of tagging a snapshot of a library (Use ENABLE_REPO_SNAPSHOT_LABEL = True to turn the feature on)
ENABLE_REPO_SNAPSHOT_LABEL = True

# Enable cloude mode and hide `Organization` tab.
CLOUD_MODE = False
# Disable global address book
ENABLE_GLOBAL_ADDRESSBOOK = True
MAX_NUMBER_OF_FILES_FOR_FILEUPLOAD = 2000

# Default expire days for share link (since version 6.3.8)
# Once this value is configured, the user can no longer generate an share link with no expiration time.
# If the expiration value is not set when the share link is generated, the value configured here will be used.
#SHARE_LINK_EXPIRE_DAYS_DEFAULT = 7

# Add a report abuse button on download links. (since version 7.1.0)
# Users can report abuse on the share link page, fill in the report type, contact information, and description.
# Default is false.
ENABLE_SHARE_LINK_REPORT_ABUSE = True

# If you don't want to run seahub website on your site's root path, set this option to your preferred path.
# e.g. setting it to '/seahub/' would run seahub on http://example.com/seahub/.
SITE_ROOT = '/'

# Config Memcached ( Http or Socket )

CACHES = {
    'default': {
        'BACKEND': 'django_pylibmc.memcached.PyLibMCCache',
        'LOCATION': '127.0.0.1:11211',
    },
}

#LIBRARY_TEMPLATES = {
#    'Mon Cloud': ['/Documents', '/Photos', '/Partage', '/Musique', '/Video']
#}

#ENABLED_ROLE_PERMISSIONS = {
#    'default': {
#        'can_add_repo': True,
#        'can_add_group': True,
#        'can_view_org': True,
#        'can_use_global_address_book': True,
#        'can_generate_share_link': True,
#        'can_generate_upload_link': True,
#        'can_invite_guest': True,
#        'can_connect_with_android_clients': True,
#        'can_connect_with_ios_clients': True,
#        'can_connect_with_desktop_clients': True,
#    },
#   'guest': {
#        'can_add_repo': False,
#        'can_add_group': False,
#        'can_view_org': True,
#        'can_use_global_address_book': False,
#        'can_generate_share_link': False,
#        'can_generate_upload_link': False,
#        'can_invite_guest': False,
#        'can_connect_with_android_clients': False,
#        'can_connect_with_ios_clients': False,
#        'can_connect_with_desktop_clients': False,
#    }
# }

# Enable Only Office
ENABLE_ONLYOFFICE = True
VERIFY_ONLYOFFICE_CERTIFICATE = True
ONLYOFFICE_APIJS_URL = 'https://seaubou.me/onlyofficeds/web-apps/apps/api/documents/api.js'
ONLYOFFICE_FILE_EXTENSION = ('doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx', 'odt', 'fodt', 'odp', 'fodp', 'ods', 'fods')
ONLYOFFICE_EDIT_FILE_EXTENSION = ('docx', 'pptx', 'xlsx')

#Twilio 2FA
#TWO_FACTOR_SMS_GATEWAY = 'seahub.two_factor.gateways.twilio.gateway.Twilio'
#TWILIO_ACCOUNT_SID = 'A
#    'seahub.two_factor.gateways.twilio.middleware.ThreadLocals',
#)

you have all my setup. . I fought several times before succeeding, after it is only happiness, and I am not even talking about certbot which is no longer maintained on debian, you have to go through the Snap package … good luck …

jasperciti@jasperciti.lol
Jasper007
seafile.boubou.me
it works very very hard ^^
test by yourself

@Cisco Thank you for all your help. I really appreciate it.

  1. Which version are you using?
  2. Would you consider version 8 stable? Should I give it another shot or stay at version 7 (which currently works).
  3. If you are using version 8, do you see your Seafile log entries. Mine is just blank and that is why I couldn’t figure out what was wrong until I downgraded. If I ever run into another issue again, I would at least like to see an error message not just “Internal Server Error”.

@Cisco

Nevermind, I see you are using version 7.1.9.

  1. How did you change the theme? I didn’t know you could do that? It looks pretty cool. Is is that the difference between the Pro and CE?
  2. Also I noticed your Wiki is working. Mine just loads forever for some reason. I will probably open a new topic for that but it is not urgent. It is actually a bonus that Seafile can do that too. I just want to securely sync files on my devices over the internet for now.
  3. I’m using 7.1.5 CE. Where did you download 7.1.9?

hi be careful because I am using the pro version, there are parameters which are useless for the config of seafile CE and I use onlyoffice with Docker, so there are additional parameters