Seahub failed, process gets canceled

Hi, im runnning Seafile 6.0.7 on Windows Server 2016 Standard. I have a couple of them working, so please dont comment with suggestions to go to linux because it is possible.

What I deployed so far:

  • Installed Python 2.7 and added its installation path to the system environment
  • Initialised seafile server
  • Created 3 database as shown in the seafile manual
  • Installed Pyhton MySQL Tools
  • Executed mysql.sql script successfully on seahub-db
  • Added them to the configs

NOTE: At this point seafile was working well.

  • Installed IIS and added a Seafile Website with HTTPS on Port 443
  • Installed Application Request Rounting Proxy Server Pass Through for URL Rewrite
  • Added 2 Rules for rewriting Request to the seafhttp or the webinterface Port 8000 and 8082
  • Added a Zone in DNS for my URL which is resolving the IP of my server
  • Changed SERVICE_URL to my URL and added FILE_SERVER_ROOT

NOTE: Now when Im trying to reach my site via the URL it says BAD GATEWAY. But I noticed that my pyhton background process is not started. So it is clear that i cant reach seahub webinterface.

What I did troubleshoot so far:

  • Checking Rewrite Rules
  • Checking all Configs
  • Checking if there are already hidden python background processes
  • Try to run from Commandline and Python Commandline
  • Checking User Permission
  • Reroll the configs to before installing IIS (didn’t work)
  • Checking Firewall

I had to delete the whole seafile database. The background process did start again.

The Error Messages:

Starting from IDLE with “runserver localhost:8000”

Fun Fact this error shows up on my other seafile server too but they are working…

===== RESTART: C:\Seafile Program\seafile-server-6.0.7\seahub\ =====

Traceback (most recent call last):
  File "C:\Seafile Program\seafile-server-6.0.7\seahub\", line 8, in <module>
    from import execute_from_command_line
ImportError: No module named

From Seafserv.log

created "python.exe -V", pid 5976
[12/19/17 10:57:35] seafserv/seafserv.c(63): starting ccnet-server ...
[12/19/17 10:57:35] created "ccnet-server.exe -c "D:/seafile-server\ccnet" -f "D:/seafile-server\logs\ccnet.log" -F "D:/seafile-server\conf"", pid 3912
[12/19/17 10:57:35] seafserv/seafserv.c(466): ccnet server started
[12/19/17 10:57:36] seafserv/seafserv.c(334): trying to connect to ccnet-sever...
[12/19/17 10:57:36] seafserv/seafserv.c(360): connected to ccnet server
[12/19/17 10:57:36] seafserv/seafserv.c(90): starting seaf-server ...
[12/19/17 10:57:36] created "seaf-server.exe -c "D:/seafile-server\ccnet" -d "D:/seafile-server\seafile-data" -l "D:/seafile-server\logs\seafile.log" -F "D:/seafile-server\conf"", pid 4828
[12/19/17 10:57:36] seafserv/seafserv.c(161): starting seahub ...
[12/19/17 10:57:36] created "python.exe "C:\Seafile Program\seafile-server-6.0.7\seafile\bin\..\..\seahub\" runwsgiserver host= port=8080 autoreload=False staticserve=False", pid 3964
[12/19/17 10:57:36] seafserv/seafserv.c(560): [process monitor] started.
[12/19/17 10:58:26] seafserv/seafserv.c(516): seahub has exited with code 1
[12/19/17 10:58:26] seafserv/seafserv.c(161): starting seahub ...
[12/19/17 10:58:26] created "python.exe "C:\Seafile Program\seafile-server-6.0.7\seafile\bin\..\..\seahub\" runwsgiserver host= port=8080 autoreload=False staticserve=False", pid 4296
[12/19/17 10:59:16] seafserv/seafserv.c(516): seahub has exited with code 1

Its looping over and over again that it creates the pyhton background process and the it immediatly gets shut down.

My Configs:


USER_NAME = my-seafile
ID = editedbecausesecret
NAME = my-seafile

PORT = 10001

PORT = 13418

#MySQL Connection (Seafiledb: ccnet-db)


#MySQL Connection (SeafileDb: seafile-db)

port = 12001

port = 8082

port = 8080
fastcgi = false

SECRET_KEY = edited because secret

#Seafile File-Server Root fĂĽr Upload/Download von Daten

#MySQL Connection (SeafileDb: seahub-db)
	'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME' : 'seahub-db',
        'USER' : 'seafile',
        'PASSWORD' : '**********',
        'HOST' : 'localhost',
		'PORT' : '3306',

I’ve solved it today after ages.
So there is a Problem with a Windows Update…again…which updated maybe utilities or parts of the Windows Webserver IIS.

My web.config did eliminate my python background process because it did not find a server to run because of the rewrite configuration.

If anyone is interested here is my new config:

<?xml version="1.0" encoding="UTF-8"?>
	<location path="" overrideMode="Deny">
				<clear />
				<rule name="Redirect to HTTPS" enabled="true" stopProcessing="true">
					<match url="(.*)" />
					<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
						<add input="{HTTPS}" pattern="^OFF$" />
					<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Permanent" />
				<rule name="seafilehttp" stopProcessing="true">
					<match url="seafhttp/(.*)" />
					<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
						<action type="Rewrite" url="{R:1}" appendQueryString="true" logRewrittenUrl="true" />
				<rule name="seafile" enabled="true" stopProcessing="true">
					<match url="(.*)" />
					<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
					<action type="Rewrite" url="http://localhost:8080/{R:1}" appendQueryString="true" logRewrittenUrl="true" />
					<preCondition name="ResponseIsHtml1">
						<add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
		<httpErrors errorMode="DetailedLocalOnly" />
            <requestFiltering allowDoubleEscaping="true">
                <requestLimits maxAllowedContentLength="4294967295" />
1 Like

Thanks for sharing with the community :slight_smile:

1 Like