New installation: cannot decode JSON error message

Hi

I installed Seafile (seafile-server_6.2.5_x86-64) with SQLite according to the manual on Ubuntu 16.04.

I also installed certbot via the ppa as described in the manual.

But when I browse to it either with the local address (http: //127.0.0.1:8000) or via the browser with Nginx reverse proxy I get the following message:

{“jsonrpc”: “2.0”, “id”: null, “error”: {“code”: -32700, “message”: “cannot decode JSON: Expecting value: line 1 column 1 (char 0)”}}

Did I miss a package or a configuration?

I tried to setup it twice and used ./setup-seafile.sh to create the configuration.

Thanks!

Can you try again, and then post the contents of the log files here? It may help us narrow it down.

I just noticed you said you installed certbot. The instructions in the manual are outdated. Due to an issue with certbot, they had to change it to a new version. The certbot website details the issue and the solution is OS specific. In my case, I use Debian, and I had to use certbot-auto rather than certbot in order to get it to work. Furthermore, the settings for NGinx in the manual are now ambiguous. For example, the manual states that you need to run the dhparams program to generate that file, but the new certbot handles that for you instead.

Also, if you set your server up to use https then you’ll need to use https rather than http. Locally, though, it shouldn’t matter.

Post your nginx config file and I’ll take a look at it. Or, if you prefer, you can PM me since your domain name will be included in there. Wouldn’t want to post that publicly. If you do post it here, publicly, then I would advise changing the server name in NGinx to something like server.myseafile.com or whatever you want.

Thanks for looking into this.
Here is my Nginx configuration.

server {
    server_name server.myseafile.com;

    proxy_set_header X-Forwarded-For $remote_addr;

    # Reverse proxy for seafile
    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_set_header   X-Forwarded-Proto https;
         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;
    }

    # Reverse Proxy for seahub
    location /seafhttp {
        rewrite ^/seafhttp(.*)$ $1 break;
        proxy_pass http://127.0.0.1:8082;
        client_max_body_size 0;
        proxy_connect_timeout  36000s;
        proxy_read_timeout  36000s;
        proxy_send_timeout  36000s;
        send_timeout  36000s;
    }

    #CHANGE THIS PATH WITH YOUR OWN DIRECTORY
    location /media {
        root /home/seafile/seafile/seafile-server-latest/seahub;
    }

    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/server.myseafile.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/server.myseafile.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

    server_tokens off;

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


    listen 80;
    server_name server.myseafile.com;
    return 404; # managed by Certbot

    server_tokens off;

}

I think Nginx works because I see a secure connection and the response is the same as when I connect locally to 127.0.0.1:8000.

ccnet.log

[03/22/18 00:06:29] ../common/session.c(132): using config file /home/seafile/seafile/conf/ccnet.conf
[03/22/18 00:06:29] ../common/session.c(484): Listen on /home/seafile/seafile/ccnet/ccnet.sock for local clients
[03/22/18 00:06:29] ../common/session.c(290): Update pubinfo file
[03/22/18 00:06:30] ../common/session.c(398): Accepted a local client
[03/22/18 00:06:30] ../common/session.c(398): Accepted a local client
[03/22/18 00:06:30] ../common/session.c(398): Accepted a local client
[03/22/18 00:06:30] ../common/session.c(398): Accepted a local client
[03/22/18 00:06:42] ../common/session.c(398): Accepted a local client
[03/22/18 00:07:17] ../common/peer.c(943): Local peer down

seafile.log

[03/22/18 00:06:30] http-server.c(161): fileserver: worker_threads = 10
[03/22/18 00:06:30] http-server.c(176): fileserver: fixed_block_size = 8388608
[03/22/18 00:06:30] http-server.c(191): fileserver: web_token_expire_time = 3600
[03/22/18 00:06:30] http-server.c(206): fileserver: max_indexing_threads = 1
[03/22/2018 12:06:32 AM] ../common/mq-mgr.c(54): [mq client] mq cilent is started
[03/22/2018 12:06:33 AM] size-sched.c(96): Repo size compute queue size is 0
[03/22/2018 12:11:33 AM] size-sched.c(96): Repo size compute queue size is 0

controller.log

[03/22/18 00:06:29] seafile-controller.c(154): starting ccnet-server ...
[03/22/18 00:06:29] seafile-controller.c(73): spawn_process: ccnet-server -F /home/seafile/seafile/conf -c /home/seafile/seafile/ccnet -f /home/seafile/seafile/logs/ccnet.log -d -P /home/seafile/seafile/pids/ccnet.pid
[03/22/18 00:06:29] seafile-controller.c(88): spawned ccnet-server, pid 5571
[03/22/18 00:06:30] seafile-controller.c(555): ccnet daemon connected.
[03/22/18 00:06:30] seafile-controller.c(186): starting seaf-server ...
[03/22/18 00:06:30] seafile-controller.c(73): spawn_process: seaf-server -F /home/seafile/seafile/conf -c /home/seafile/seafile/ccnet -d /home/seafile/seafile/seafile-data -l /home/seafile/seafile/logs/seafile.log -P /home/seafile/seafile/pids/seaf-server.pid
[03/22/18 00:06:30] seafile-controller.c(88): spawned seaf-server, pid 5575
[03/22/18 00:06:30] seafile-controller.c(528): seafdav not enabled.

Ok… Everything looks fine here. Seafile is starting and is not throwing any errors. It may be that either one of your dependencies is an older version, or possibly newer version, or that you have a permissions problem somewhere. You could also have a corrupt file.

Check the Linux system logs to see if you see anything in there. If I can recall correctly, the error you are getting has to do with CURL libraries and Python. Check the python log files as well.

Also, I’m betting that you can sync files with the client. Am I correct in that, or are you having a problem there too?