Android app not working

Hello, I don’t understand why android app is not working. Desktop clients and web interface work fine.
Can’t download files and can’t upload or sync photos.

I’m pretty sure something is wrong in nginx, but can’t figure out what.
Here is my nginx conf (replaced real names and ip):

server {
        server_name seafile.example.com;
	listen 443 ssl http2;
	error_page 497  https://$host:$server_port$request_uri;

	server_tokens off;
        ssl on;
        ssl_certificate /etc/ssl/websites/seafile.example.com.cer;
        ssl_certificate_key /etc/ssl/websites/seafile.example.com.key;
        ssl_session_timeout 5m;

        ssl_dhparam /etc/ssl/websites/dhparam.pem;
	ssl_protocols TLSv1.2 TLSv1.3;
	ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
        ssl_prefer_server_ciphers on;

        add_header Strict-Transport-Security "max-age=31536000";
        add_header X-Frame-Options SAMEORIGIN;
        add_header X-Content-Type-Options nosniff;
        add_header X-XSS-Protection "1; mode=block";

        proxy_set_header X-Forwarded-For $remote_addr;

	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;
                    proxy_set_header   X-Forwarded-Proto https;
		    access_log      /var/log/nginx/seahub.access.log;
		    error_log       /var/log/nginx/seahub.error.log;
		    client_max_body_size 0;
	}

	location /seafhttp {
	        rewrite ^/seafhttp(.*)$ $1 break;
	        proxy_pass http://127.0.0.1:8082;
	        proxy_request_buffering off;
	        client_max_body_size 0;
		proxy_connect_timeout  36000s;
		proxy_read_timeout  36000s;
		proxy_send_timeout  36000s;
		send_timeout  36000s;

                access_log      /var/log/nginx/seafhttp.access.log;
                error_log       /var/log/nginx/seafhttp.error.log;
                proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
	}

        location /media {
            root /home/seafile/seafile-server-latest/seahub;

        }
}

There are errors in nginx logs:

seahub.access.log:
x.x.x.x - - [01/Sep/2020:16:03:14 +0200] "GET /api2/repos/dc394e57-d480-44f2-9298-26f39c583cb2/upload-link/?p=My+Photos%2FCamera HTTP/1.1" 200 84 "-" "Dalvik/2.1.0 (Linux; U; Android 9; Redmi Note 4 Build/PQ3A.190801.002)"

seafhttp.error.log
2020/08/31 23:59:02 [error] 2406#2406: *87732 connect() failed (111: Connection refused) while connecting to upstream, client: x.x.x.x, server: seafile.example.com, request: "GET /seafhttp/repo/6d5d7600-c8ca-490e-bbe2-31d368b21f9f/commit/HEAD HTTP/2.0", upstream: "http://127.0.0.1:8082/repo/6d5d7600-c8ca-490e-bbe2-31d368b21f9f/commit/HEAD", host: "seafile.example.com"

seafhttp.access.log
x.x.x.x - - [01/Sep/2020:16:02:53 +0200] "GET /seafhttp/upload-api/fa5a5b7b-b469-4f1f-8fb2-31809c23fbac HTTP/2.0" 400 0 "-" "okhttp/3.9.1"

here my conf files:
seafile.conf

[fileserver]
port=8082
host = 127.0.0.1

seahub_settings.py

# -*- coding: utf-8 -*-
SECRET_KEY = "mysecretkey"
FILE_SERVER_ROOT = 'http://seafile.example.com/seafhttp'

any help please?

I still can’t figure out where is the issue, anybody can help me?

Hi,

I got a similar problem an traced it down using Wireshark.

Server on 192.168.111.195 (docker containered seafile)
Client on 192.168.2.169 (Android 10 app 2.2.25)

If I try to upload files The following TLS packages are exchanged (among other TCP packages):

|334|83.850430389|192.168.2.169|192.168.111.195|TLSv1.2|249|Client Hello|
|336|83.851779792|192.168.111.195|192.168.2.169|TLSv1.2|3038|Server Hello, Certificate, Server Key Exchange, Server Hello Done|
|340|83.870728877|192.168.2.169|192.168.111.195|TLSv1.2|75|Alert (Level: Fatal, Description: Certificate Unknown)

This seems to be the source of my problem, but I do not know how to resolve it at the actual time. Maybe you could find a solution by verifying that you have the same problem.

I really don’t understand: I set up a test server, with same identical configuration files. The only difference is that it’s in a virtual machine and in LAN, and Android app works with this server :scream:

I just backed up everything and reinstalled on a fresh install on the same server, then imported dbs and data backup. Now it works. But, really, the mistery will remain unsolved