Web GUI pops up regularly with "Connection Failed" message on Safari only

Discussion of the Web Interface for Transmission, formerly known as Clutch. This applies to all version of Transmission
Post Reply
jimbo831
Posts: 3
Joined: Sun Dec 18, 2016 3:17 am

Web GUI pops up regularly with "Connection Failed" message on Safari only

Post by jimbo831 »

I recently set up a Raspberry Pi as a home server and installed transmission-daemon on it. I also have my own domain that connects to this server and set up an Apache reverse proxy so that https://torrents.mydoamin.com proxies to transmission. Here are my transmission settings:

Code: Select all

{
    "alt-speed-down": 50,
    "alt-speed-enabled": false,
    "alt-speed-time-begin": 540,
    "alt-speed-time-day": 127,
    "alt-speed-time-enabled": false,
    "alt-speed-time-end": 1020,
    "alt-speed-up": 50,
    "bind-address-ipv4": "0.0.0.0",
    "bind-address-ipv6": "::",
    "blocklist-enabled": false,
    "blocklist-url": "http://www.example.com/blocklist",
    "cache-size-mb": 4,
    "dht-enabled": true,
    "download-dir": "/var/lib/transmission-daemon/downloads",
    "download-limit": 100,
    "download-limit-enabled": 0,
    "download-queue-enabled": true,
    "download-queue-size": 5,
    "encryption": 1,
    "idle-seeding-limit": 30,
    "idle-seeding-limit-enabled": false,
    "incomplete-dir": "/var/lib/transmission-daemon/Downloads",
    "incomplete-dir-enabled": false,
    "lpd-enabled": false,
    "max-peers-global": 200,
    "message-level": 1,
    "peer-congestion-algorithm": "",
    "peer-id-ttl-hours": 6,
    "peer-limit-global": 200,
    "peer-limit-per-torrent": 50,
    "peer-port": 51413,
    "peer-port-random-high": 65535,
    "peer-port-random-low": 49152,
    "peer-port-random-on-start": false,
    "peer-socket-tos": "default",
    "pex-enabled": true,
    "port-forwarding-enabled": false,
    "preallocation": 1,
    "prefetch-enabled": 1,
    "queue-stalled-enabled": true,
    "queue-stalled-minutes": 30,
    "ratio-limit": 2,
    "ratio-limit-enabled": false,
    "rename-partial-files": true,
    "rpc-authentication-required": true,
    "rpc-bind-address": "0.0.0.0",
    "rpc-enabled": true,
    "rpc-password": "xxxxxxx",
    "rpc-port": 9091,
    "rpc-url": "/transmission/",
    "rpc-username": "username",
    "rpc-whitelist": "127.0.0.1",
    "rpc-whitelist-enabled": false,
    "scrape-paused-torrents-enabled": true,
    "script-torrent-done-enabled": false,
    "script-torrent-done-filename": "",
    "seed-queue-enabled": false,
    "seed-queue-size": 10,
    "speed-limit-down": 100,
    "speed-limit-down-enabled": false,
    "speed-limit-up": 100,
    "speed-limit-up-enabled": false,
    "start-added-torrents": true,
    "trash-original-torrent-files": false,
    "umask": 18,
    "upload-limit": 100,
    "upload-limit-enabled": 0,
    "upload-slots-per-torrent": 14,
    "utp-enabled": true
}
Here is my conf file for my Apache reverse proxy:

Code: Select all

	<VirtualHost *:443>
        ServerName torrents.mydomain.com

        <Proxy *>
                Order deny,allow
                Allow from all
        </Proxy>

        SSLEngine On
        SSLProxyEngine On
        SSLCertificateFile /etc/letsencrypt/live/webmin.mydomain.com-0001/fullchain.pem
        SSLCertificateKeyFile /etc/letsencrypt/live/webmin.mydomain.com-0001/privkey.pem

        ErrorLog /var/log/apache2/torrents-ssl_error_log
        CustomLog /var/log/apache2/torrents-ssl_access_log common

        KeepAlive On
        ProxyVia On
        ProxyRequests Off
        ProxyPreserveHost Off
        ProxyPass / http://localhost:9091/
        ProxyPassReverse / http://localhost:9091/
</VirtualHost>
The problem I'm having is pretty specific and somewhat intermittent which makes it hard to troubleshoot. When I first access the site, it works fine. After a period of inactivity usually between 1-5 minutes, a box pops up that says:
Connection Failed
Could not connect to the server. You may need to reload the page to reconnect.
If I just click on the dismiss button on the box, it goes away and I can still use the site. After doing this, however, it continues to pop up when I am inactive for about 5-10 seconds or so. I can always dismiss it and use the site, but it gets pretty annoying. To further complicate troubleshooting this, it only happens when I access the site through my domain and using the Safari browser on my MacBook or the mobile Safari browser on my iPad. It works fine in Chrome both on my MacBook and on a different Windows PC. It also works on Safari if I access it using the local IP from within my network, i.e. 192.168.1.XXX:9091. The only time this issue happens is using Safari and the Apache reverse proxy.

I have tried setting up a CustomLog and ErrorLog in Apache for this conf file but looking through there I don't see any issues that stand out. If I had to take a wild guess, I assume there's some sort of timeout happening because the message doesn't appear when I'm actively using the site, only after a period of inactivity. I'm not sure if there are any other logs I can check or if anyone else has ever seen this issue. Any help would be greatly appreciated. Thanks.
gh0st
Posts: 7
Joined: Sun Dec 18, 2016 12:16 pm

Re: Web GUI pops up regularly with "Connection Failed" message on Safari only

Post by gh0st »

What causes this error I don´t know, but I´m facing the exact problem sometimes on my Ubuntu Server...
jimbo831
Posts: 3
Joined: Sun Dec 18, 2016 3:17 am

Re: Web GUI pops up regularly with "Connection Failed" message on Safari only

Post by jimbo831 »

I have tried using those x190 and it didn't help unfortunately. My current Apache configuration has KeepAlive On which should keep the backend connection between Apache and the transmission web server active if I understand it correctly. The interesting part of this to me is why it works on Chrome but not Safari.
jimbo831
Posts: 3
Joined: Sun Dec 18, 2016 3:17 am

Re: Web GUI pops up regularly with "Connection Failed" message on Safari only

Post by jimbo831 »

I will try to do that. You are much better at Googling than me because I never found that. I'll report back in a bit.
Borsly
Posts: 1
Joined: Tue Jan 24, 2017 2:49 pm

Re: Web GUI pops up regularly with "Connection Failed" message on Safari only

Post by Borsly »

I had the same problem recently, too, in this browser. Then I reconfigured all my network options, began to work. In my opinion, the problem was in incorrect settings of the proxy server (advanced.name in my case).
Post Reply