Bad response code for GET : 400

Hello,

I have a private Seafile server and since few days I can’t download or sync any files, I have this error with the Seafile client (and SeaDrive) :

[04/04/18 09:56:46] seaf-daemon.c(558): starting seafile client 6.1.6
[04/04/18 09:56:46] seaf-daemon.c(560): seafile source code version 48addfe8ae85ae816978db00e6402a30d3f964fe
[04/04/18 09:56:46] ../common/mq-mgr.c(60): [mq client] mq cilent is started
[04/04/18 09:56:46] ../common/mq-mgr.c(106): [mq mgr] publish to heartbeat mq: seafile.heartbeat
[04/04/18 09:56:46] clone-mgr.c(847): Transition clone state for b46c2107 from [init] to [check server].
[04/04/18 09:56:46] clone-mgr.c(847): Transition clone state for abfd53e6 from [init] to [check server].
[04/04/18 09:56:46] clone-mgr.c(847): Transition clone state for b46c2107 from [check server] to [fetch].
[04/04/18 09:56:46] http-tx-mgr.c(1153): Transfer repo 'b46c2107': ('normal', 'init') --> ('normal', 'check')
[04/04/18 09:56:46] clone-mgr.c(847): Transition clone state for abfd53e6 from [check server] to [fetch].
[04/04/18 09:56:46] http-tx-mgr.c(1153): Transfer repo 'abfd53e6': ('normal', 'init') --> ('normal', 'check')
[04/04/18 09:56:46] http-tx-mgr.c(2396): Bad response code for GET https://cloud.xxxxxxxxxxxx.com/seafhttp/repo/abfd53e6-8985-4d00-8c47-44843db123f7/permission-check/?op=download&client_id=ad5d49b6eb5e6fbc4508b8fa4803308cc70a3d3b&client_name=MBPdeCedric: 400.
[04/04/18 09:56:46] [04/04/18 09:56:46] http-tx-mgr.c(2396): Bad response code for GET https://cloud.xxxxxxxxxxxx.com/seafhttp/repo/b46c2107-75a8-4fea-9f9d-744d7625c0b2/permission-check/?op=download&client_id=ad5d49b6eb5e6fbc4508b8fa4803308cc70a3d3b&client_name=MBPdeCedric: 400.
http-tx-mgr.c(4471): Download permission denied for repo abfd53e6 on server https://cloud.xxxxxxxxxxxx.com.
[04/04/18 09:56:46] http-tx-mgr.c(4471): Download permission denied for repo b46c2107 on server https://cloud.xxxxxxxxxxxx.com.
[04/04/18 09:56:46] http-tx-mgr.c(1153): Transfer repo 'abfd53e6': ('normal', 'check') --> ('error', 'finished')
[04/04/18 09:56:46] clone-mgr.c(864): Transition clone state for abfd53e6 from [fetch] to [error]: fetch.
[04/04/18 09:56:46] http-tx-mgr.c(1153): Transfer repo 'b46c2107': ('normal', 'check') --> ('error', 'finished')
[04/04/18 09:56:46] clone-mgr.c(864): Transition clone state for b46c2107 from [fetch] to [error]: fetch.

The download is unavaiable on the web too.
Seafile is running on Debian 9 With Caddy Server and MySQL

Thanks for your help and sorry for my poor english (I’m french)

Can you provide the server logs as well. Your error is related to permissions, and that could be due to a number of reasons, up to and including corruption.

Thanks for your reply!

Here the log :

controller.log

[04/05/18 11:15:11] seafile-controller.c(154): starting ccnet-server ...
[04/05/18 11:15:11] seafile-controller.c(73): spawn_process: ccnet-server -F /home/*****/conf -c /home/*****/ccnet -f /home/*****/logs/ccnet.log -d -P /home/*****/pids/ccnet.pid
[04/05/18 11:15:11] seafile-controller.c(88): spawned ccnet-server, pid 15706
[04/05/18 11:15:12] seafile-controller.c(555): ccnet daemon connected.
[04/05/18 11:15:12] seafile-controller.c(186): starting seaf-server ...
[04/05/18 11:15:12] seafile-controller.c(73): spawn_process: seaf-server -F /home/*****/conf -c /home/*****/ccnet -d /home/*****/seafile-data -l /home/*****/logs/seafile.log -P /home/*****/pids/seaf-server.pid
[04/05/18 11:15:12] seafile-controller.c(88): spawned seaf-server, pid 15711
[04/05/18 11:15:12] seafile-controller.c(528): seafdav not enabled.

seafile.log

[04/05/2018 10:51:57 AM] size-sched.c(96): Repo size compute queue size is 0
[04/05/2018 10:56:57 AM] size-sched.c(96): Repo size compute queue size is 0
[04/05/2018 11:01:57 AM] size-sched.c(96): Repo size compute queue size is 0

seahub_django_request.log

2018-04-04 07:35:06,285 [WARNING] django.request:170 get_response Not Found: /seahttp/files/3bcfac04-08ed-42a5-9d53-aefbb8110bc1/*******.pdf
2018-04-04 08:01:23,293 [WARNING] django.request:170 get_response Not Found: /seahttp/files/0bffbfc3-85b4-4ceb-855f-a8b9b16cb6ef/*******.mp4
2018-04-04 09:29:42,893 [WARNING] django.request:170 get_response Not Found: /apple-touch-icon-precomposed.png
2018-04-04 09:29:42,966 [WARNING] django.request:170 get_response Not Found: /apple-touch-icon.png
2018-04-04 09:31:32,234 [WARNING] django.request:170 get_response Not Found: /seahttp/files/55102b2d-b72e-45c8-8101-c641c5024772/*******.dmg
2018-04-04 09:32:06,959 [WARNING] django.request:170 get_response Not Found: /seahttp/files/55102b2d-b72e-45c8-8101-c641c5024772/*******.dmg
2018-04-05 09:35:12,619 [WARNING] django.request:170 get_response Not Found: /seahttp/files/4755d348-0694-42ee-a65c-99fddc5a392c/*******.pdf

ccnet.log

[04/05/18 11:34:18] ../common/session.c(398): Accepted a local client
[04/05/18 11:34:49] ../common/session.c(398): Accepted a local client
[04/05/18 11:34:50] ../common/session.c(398): Accepted a local client
[04/05/18 11:35:29] ../common/peer.c(943): Local peer down
[04/05/18 11:35:29] ../common/peer.c(943): Local peer down
[04/05/18 11:35:29] ../common/peer.c(943): Local peer down
[04/05/18 11:35:29] ../common/peer.c(943): Local peer down
[04/05/18 11:35:29] ../common/peer.c(943): Local peer down

In the seahub_django_request.log all the “Warning” appears when I try to download a file from the WebUI and it doesn’t work too.
I have also tried ./seaf-fsck.sh but everything was fine.

Your seafhttp requests are being send to the wrong component (seahub instead of seafile-server).

So your caddy configuration is wrong.

Thanks for your response :slight_smile:

Here my CaddyFile

cloud.****.com {
    proxy / localhost:8556 {
        transparent
    }
    gzip
}
cloud.****.com/seafhttp {
    proxy / localhost:8082 {
        without /seafhttp
	transparent
    }
    gzip
}
cloud.****.com/media {
	root /home/****/seafile-server-latest/seahub/media
	gzip
}

According to https://github.com/caddyserver/examples/blob/master/seafile/Caddyfile

And my ccnet.conf

[General]
USER_NAME = theCave
ID = ac8fe258f8abc0dcec4ce6d7022e487562769d05
NAME = theCave
SERVICE_URL = https://cloud.*****.com

[Client]
PORT = 13419

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

@shoeper

Even thought that link has an example and he has his set up the same way, it looks wrong to me. It seems that /media is pointing to /media. I know little about Caddy, so, correct me if I’m wrong, but shouldn’t it be:

cloud..com/media {
root /home/
/seafile-server-latest/seahub

rather than

cloud..com/media {
root /home/
/seafile-server-latest/seahub/media

This looks wrong to me, but I don’t know caddy and don’t want to use it.