Proxy Error 502

Hi All,

I’m using seafile since 4.0.6 with debian wheezy and updated it up to 4.4.6 without any problems. Yesterday I updated my wheezy installation to Jessie (Debian 8) and leave seafile as it is. But I thought it might be good to update seafile to the newest version 6.2.5 (all i386 aka 32 bit) and run into trouble.

I run all upgrade scripts:
upgrade/upgrade_4.4_5.0.sh
upgrade/upgrade_5.0_5.1.sh
upgrade/upgrade_5.1_6.0.sh
upgrade/upgrade_6.0_6.1.sh
upgrade/upgrade_6.1_6.2.sh
All reported success for upgrade

Afterwards I stopped seafile (and hub) and tried to start it but it moans because file user is seafile and I started it as root. Then I started it as user seafile but seahub moaned about permissions under tmp. I deleted the folder under /tmp and than I was able to start seahub too.

But when I open the webpage (which worked with 4.4.6) It throwes an 502 error:
Proxy Error

The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request GET /.

Reason: Error reading from remote server

In the logs apache complains:
Fri Feb 16 22:26:17.954157 2018] [proxy_http:error] [pid 24829] (70007)The timeout specified has expired: [client 127.0.0.1:33170] AH01102: error reading status line from remote server 127.0.0.1:8000,
[Fri Feb 16 22:26:17.954230 2018] [proxy:error] [pid 24829] [client 127.0.0.1:33170] AH00898: Error reading from remote server returned by /,

So it seams to have a problem to connect to port 8000 on localhost.

Error log under runtime from seafile has size zero and everything on taht site looks fine - without any errors in any other log (seafile, seahub and so on).

All was running with Apache 2.4 and fastcgi without any problem before updating it.

Does anyone have any hints? Any comments or help is welcome! even how to downgrade to get access to the data…

Regards
Joris

AFAIK the 6.2 doesn’t use fastgci by default anymore, so you need to start seahub with command: start-fastcgi
Or replace the fastgci config on apache with:

seahub

SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
ProxyPass / http://127.0.0.1:8000/
ProxyPassReverse / http://127.0.0.1:8000/
1 Like

Thanks a lot. My startscript calls start-fastcgi but I tried the other way around but without fastcgi it wont start at all:

/var/lib/seafile/haiwen/seafile-server-latest/seahub.sh start

LC_ALL is not set in ENV, set to en_US.UTF-8
Starting seahub at port 8000 …
Error:Seahub failed to start.
Please try to run “./seahub.sh start” again
seafile@server:/root$ /var/lib/seafile/haiwen/seafile-server-latest/seahub.sh start

LC_ALL is not set in ENV, set to en_US.UTF-8
Starting seahub at port 8000 …
Error:Seahub failed to start.
Please try to run “./seahub.sh start” again
seafile@server:/root$ /var/lib/seafile/haiwen/seafile-server-latest/seahub.sh start-fastcgi

LC_ALL is not set in ENV, set to en_US.UTF-8
Starting seahub (fastcgi) at 127.0.0.1:8000 …

Seahub is started

Done.

And before with 4.4.6 everything worked like a charme. Quiet confusing…

Any further hints? Thanks a lot.

Which database are you using? Or is seafile running 100% correctly? I think in your DB-System the DBs seahub-db and ccnet-db are missing. Could that be possible?

Thank you too. I’m using MySQL and it is working which I can see via phpmyadmin and other Apps like roundcube are using it. No it is set:

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

seahub-db:
DATABASES = {
‘default’: {
‘ENGINE’: ‘django.db.backends.mysql’,
‘NAME’: ‘seahub-db’,
‘USER’: ‘seafile’,
‘PASSWORD’: ‘XXX’,
‘HOST’: ‘127.0.0.1’,
‘PORT’: ‘3306’,
‘OPTIONS’: {
‘init_command’: ‘SET storage_engine=INNODB’,
}
}
}

And it would be confusing when it works since four different versions but stops after successful upgrades to major release 6.

I’m able to connect both via telnet on localhost. is there any cli command to test if those daemons are working properly?

The only thing which changed is that I start both with user seafile instead of root (which does not work anymore because fileowner for data is seafile and release 6 is picky about that). I changed with chown -R the “installation” aka the unpacked tar ball to seafile.seafile to assure it is accessible for that user.

Moreover I tried adding the seafile group to www-data which runs apache 2.4 to assure access rights that way too. But it does not work either :frowning:

The starnge thing is that all services started properly and no error in seafile or seahub was thrown. Just Apache gets no data as shown in the logs:
The timeout specified has expired: [client 127.0.0.1:34049] AH01102: error reading status line from remote server 127.0.0.1:8000

what seafile and seahub logs say?

Yes, here they are:
Seahub logs aren’t touched since 2015 (those in haiwen/logs) but I will have a look at runtime logs too later

Seafile logs are looking quite OK:
[02/17/18 08:07:27] http-server.c(161): fileserver: worker_threads = 10
[02/17/18 08:07:27] http-server.c(176): fileserver: fixed_block_size = 8388608
[02/17/18 08:07:27] http-server.c(191): fileserver: web_token_expire_time = 3600
[02/17/18 08:07:27] http-server.c(206): fileserver: max_indexing_threads = 1
[02/17/2018 08:07:27 AM] …/common/mq-mgr.c(54): [mq client] mq cilent is started
[02/17/2018 08:07:27 AM] listen-mgr.c(120): listen on port 12001 for block tranfer
[02/17/2018 08:07:28 AM] size-sched.c(96): Repo size compute queue size is 0
[02/17/2018 08:12:28 AM] size-sched.c(96): Repo size compute queue size is 0
[02/17/2018 08:17:28 AM] size-sched.c(96): Repo size compute queue size is 0
[02/17/2018 08:22:28 AM] size-sched.c(96): Repo size compute queue size is 0
[02/17/2018 08:27:28 AM] size-sched.c(96): Repo size compute queue size is 0
[02/17/2018 08:32:28 AM] size-sched.c(96): Repo size compute queue size is 0
[02/17/2018 08:37:28 AM] size-sched.c(96): Repo size compute queue size is 0
[02/17/2018 08:42:28 AM] size-sched.c(96): Repo size compute queue size is 0
[02/17/2018 08:47:28 AM] size-sched.c(96): Repo size compute queue size is 0
[02/17/2018 08:52:28 AM] size-sched.c(96): Repo size compute queue size is 0
[02/17/2018 08:57:28 AM] size-sched.c(96): Repo size compute queue size is 0
[02/17/2018 09:02:28 AM] size-sched.c(96): Repo size compute queue size is 0
[02/17/2018 09:07:28 AM] size-sched.c(96): Repo size compute queue size is 0
[02/17/2018 09:12:28 AM] size-sched.c(96): Repo size compute queue size is 0
[02/17/2018 09:17:28 AM] size-sched.c(96): Repo size compute queue size is 0
[02/17/2018 09:22:28 AM] size-sched.c(96): Repo size compute queue size is 0
[02/17/2018 09:27:28 AM] size-sched.c(96): Repo size compute queue size is 0
[02/17/2018 09:32:28 AM] size-sched.c(96): Repo size compute queue size is 0
[02/17/2018 09:37:28 AM] size-sched.c(96): Repo size compute queue size is 0
[02/17/2018 09:42:28 AM] size-sched.c(96): Repo size compute queue size is 0
[02/17/2018 09:47:28 AM] size-sched.c(96): Repo size compute queue size is 0
[02/17/2018 09:52:28 AM] size-sched.c(96): Repo size compute queue size is 0
[02/17/2018 09:57:28 AM] size-sched.c(96): Repo size compute queue size is 0
[02/17/2018 10:02:28 AM] size-sched.c(96): Repo size compute queue size is 0
[02/17/2018 10:07:28 AM] size-sched.c(96): Repo size compute queue size is 0
[02/17/2018 10:12:28 AM] size-sched.c(96): Repo size compute queue size is 0
[02/17/2018 10:17:28 AM] size-sched.c(96): Repo size compute queue size is 0
[02/17/2018 10:22:28 AM] size-sched.c(96): Repo size compute queue size is 0
[02/17/2018 10:27:28 AM] size-sched.c(96): Repo size compute queue size is 0
[02/17/2018 10:32:28 AM] size-sched.c(96): Repo size compute queue size is 0
[02/17/2018 10:37:28 AM] size-sched.c(96): Repo size compute queue size is 0
[02/17/2018 10:42:28 AM] size-sched.c(96): Repo size compute queue size is 0
[02/17/2018 10:47:28 AM] size-sched.c(96): Repo size compute queue size is 0
[02/17/2018 10:52:28 AM] size-sched.c(96): Repo size compute queue size is 0
[02/17/2018 10:57:28 AM] size-sched.c(96): Repo size compute queue size is 0
[02/17/2018 11:02:28 AM] size-sched.c(96): Repo size compute queue size is 0
[02/17/2018 11:07:28 AM] size-sched.c(96): Repo size compute queue size is 0
[02/17/2018 11:12:28 AM] size-sched.c(96): Repo size compute queue size is 0
[02/17/2018 11:17:28 AM] size-sched.c(96): Repo size compute queue size is 0
[02/17/2018 11:22:28 AM] size-sched.c(96): Repo size compute queue size is 0
[02/17/2018 11:27:28 AM] size-sched.c(96): Repo size compute queue size is 0
[02/17/2018 11:32:28 AM] size-sched.c(96): Repo size compute queue size is 0
[02/17/2018 11:37:28 AM] size-sched.c(96): Repo size compute queue size is 0
[02/17/2018 11:42:28 AM] size-sched.c(96): Repo size compute queue size is 0
[02/17/2018 11:47:28 AM] size-sched.c(96): Repo size compute queue size is 0
[02/17/2018 11:52:28 AM] size-sched.c(96): Repo size compute queue size is 0
[02/17/2018 11:57:28 AM] size-sched.c(96): Repo size compute queue size is 0
[02/17/2018 12:02:28 PM] size-sched.c(96): Repo size compute queue size is 0
[02/17/2018 12:07:28 PM] size-sched.c(96): Repo size compute queue size is 0
[02/17/2018 12:12:28 PM] size-sched.c(96): Repo size compute queue size is 0
[02/17/2018 12:17:28 PM] size-sched.c(96): Repo size compute queue size is 0
[02/17/2018 12:22:28 PM] size-sched.c(96): Repo size compute queue size is 0
[02/17/2018 12:27:28 PM] size-sched.c(96): Repo size compute queue size is 0
[02/17/2018 12:32:28 PM] size-sched.c(96): Repo size compute queue size is 0
[02/17/2018 12:37:28 PM] size-sched.c(96): Repo size compute queue size is 0
[02/17/2018 12:42:28 PM] size-sched.c(96): Repo size compute queue size is 0
[02/17/2018 12:47:28 PM] size-sched.c(96): Repo size compute queue size is 0
[02/17/2018 12:52:28 PM] size-sched.c(96): Repo size compute queue size is 0

runtime logs are still empty:
root@server:/var/lib/seafile/haiwen/seafile-server-latest/runtime# l
total 8
-rw-r–r-- 1 seafile seafile 0 Feb 16 21:18 access.log
-rw-r–r-- 1 seafile seafile 0 Feb 16 21:18 error.log
-rw-rw-r-- 1 seafile seafile 338 Jan 23 10:54 seahub.conf
-rw-r–r-- 1 seafile seafile 5 Feb 17 08:08 seahub.pid

Hi All,

I decided to restore my Backups and revert to 4.4.6 which was successful. But I changed to Reverse proxy instead of FastCGI which is already an improvement.

Next Weekend I will start another try with an older 5.x version which I have downloaded already for a while.

Main problem seems to be that I couldn’t start seahub without fastcgi. I will strace it next time to figure out why it fails to start because the logs stay empty. If I get any further hints or reasons I will post them.

Thanks a lot to all who tried to help me!

1 Like