Android Network Error

I recently started up a Seafile 11 server on an Ubuntu 22.04 machine with Apache enabled, and I was able to access the server from my windows machines. Both download and upload work fine, however I cannot connect to the server from any of my android devices. I have double checked the server address, the ports, but nothing seems to change. I keep getting the “Network Error” response every time I try to log in through the app, and I can’t even pull up my Seafile via any browser on an Android device. I’ve seen the other posts on this forum about issues like this, but they seem to go completely ignored. Does anyone have any suggestions?

It is unfortunate that all the phone OSs have normalized useless error messages. I think we will need some more details to figure out what this “Network Error” might be. Here’s some questions that come to mind that might help narrow down what’s going on.

  • Does your server have TLS/SSL? If so is it using a self-signed certificate, or did you get a cert from someone (like maybe letsencrypt)? If you go there with the browser on your computer do you get security or certificate warnings?
  • Is your server accessible on the normal port (80 for HTTP or 443 for HTTPS)?
  • Do you have a domain name set up for your server (for example myseafile.domain.com )? If so, is this in the public DNS, or only in a local DNS? Android sometimes ignores the DNS server that your router tells it to use, and uses google’s instead.
  • Are you telling the phone app to connect to a name or an IP address?
  • This is with your phone connected to wifi on the same network as your computer, right?
  • No, not yet. I wanted to verify that the HTTP worked before setting that up.
  • It was up until yesterday when I tried to move the router and use a coax coupler. Even after moving it back to the original position, it doesn’t work anymore. Now the only machine I can access my Seafile server on is the tower I’m hosting it on.
  • I do not have a domain name for my server, I am just using the IP.
  • IP address, exact same that I used on the desktop web browser when it was working.
  • Correct. I’ve also tried it on the phone’s network and it does not work that way either.

OK. I think I might know the problem then. Seafile isn’t really safe to expose to the internet directly. Generally it is supposed to be behind a reverse proxy (apache or nginx) to add TLS/SSL. The normal deployment expects you to be connecting to that reverse proxy, and then only that reverse proxy would talk to seafile. It also assumes that the reverse proxy will be running on the same machine, so it only listens on the localhost network (server talking to iteself), not the machine’s real network. And that is probably why you can connect from the server itself, but nothing else.

Running without the reverse proxy is fine for testing, as long as you aren’t exposing it to the public internet. You just need to edit the configs. You would also have to make these changes if your reverse proxy is on another server.

In the seafile.conf config file, in the “[fileserver]” section, look for “host = 127.0.0.1”, and change it to “host = 0.0.0.0”. This sets where the server binds it’s port from localhost to all network interfaces. There are "host = " lines in other sections, but they don’t need to be changed.

https://manual.seafile.com/config/seafile-conf/#seafile-fileserver-configuration

Also in the gunicorn.conf.py config file, look for “bind = localhost:8000”. Change this one to “bind = 0.0.0.0:8000”.

Once those have been changed, you need to restart seafile and seahub, and then you should be able to connect to it.