syncthing / syncthing

Open Source Continuous File Synchronization
https://syncthing.net/
Mozilla Public License 2.0
65.63k stars 4.31k forks source link

I am getting Connection error - caused by slow rest/events endpoint #9440

Closed ieugen closed 8 months ago

ieugen commented 8 months ago

Hello,

I am getting this error notice . I have traced the cause to the rest/events endoint being slow to respond for whatever reason. It takes 1min to respond and the UI seems to give up before a response comes through. I have a powerful enough computer and low syncthing usage (~30GB) to exclude performance issues .

syncthing-events

Does your log mention database corruption?

No

Include required information

Please be sure to include at least:

Syncthing 1.27.3 on Debian Trixie (Testing).

    ,g$$$$$$$$$$$$$$$P.       --------------- 
  ,g$$P"     """Y$$.".        OS: Debian GNU/Linux trixie/sid x86_64 
 ,$$P'              `$$$.     Host: 20NJCTO1WW ThinkPad T495 
',$$P       ,ggs.     `$$b:   Kernel: 6.6.15-amd64 
`d$$'     ,$P"'   .    $$$    Uptime: 10 hours, 8 mins 
 $$P      d$'     ,    $$P    Packages: 5516 (dpkg), 44 (guix-user), 207 (flatpak) 
 $$:      $$.   -    ,d$$'    Shell: bash 5.2.21 
 $$;      Y$b._   _,d$P'      Resolution: 1920x1080 
 Y$$.    `.`"Y$$$$P"'         DE: Xfce 
 `$$b      "-.__              WM: Xfwm4 
  `Y$$                        WM Theme: Default 
   `Y$$.                      Theme: Adwaita [GTK2], Breeze [GTK3] 
     `$$b.                    Icons: Adwaita [GTK2], breeze [GTK3] 
       `Y$$b.                 Terminal: tilix 
          `"Y$b._             CPU: AMD Ryzen 7 PRO 3700U w/ Radeon Vega Mobile Gfx (8) @ 2.300GHz 
              `"""            GPU: AMD ATI Radeon Vega Series / Radeon Vega Mobile Series 
                              Memory: 7321MiB / 37981MiB 

Firefox ESR 115.x

I opened up Syncthing web gui and I constantly see the error dialog. It's very annoying.

time curl --insecure 'https://127.0.0.1:8069/rest/events?since=591' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/115.0' -H 'Accept: application/json, text/plain, */*' -H 'Accept-Language: en,ro;q=0.8,ro-RO;q=0.7,en-US;q=0.5,en-GB;q=0.3,pt;q=0.2' -H 'Accept-Encoding: gzip, deflate, br' -H 'X-CSRF-Token-PMSSISX: REDACTED' -H 'DNT: 1' -H 'Connection: keep-alive' -H 'Referer: https://127.0.0.1:8069/' -H 'Cookie: CSRF-Token-PMSSI=REDACTED' -H 'Sec-Fetch-Dest: empty' -H 'Sec-Fetch-Mode: cors' -H 'Sec-Fetch-Site: same-origin' -H 'Sec-GPC: 1' -H 'Pragma: no-cache' -H 'Cache-Control: no-cache'
[]

real    1m0,031s
user    0m0,013s
sys 0m0,019s
calmh commented 8 months ago

The events endpoint returning after a minute is expected and doesn't cause a GUI error. Your root cause is something else. If you're using a proxy, it needs to allow requests that take over a minute to respond without returning a timeout error. I suggesting turning to the forum for troubleshooting if you don't figure it out on your own.

ieugen commented 8 months ago

hi @calmh , I am not using a proxy. I am running syncthing 1.27.3 on a raspberry pi 4 and I don't see issues there (same browser on same computer). I see the error only for local syncthing.

It might be something with the build for Debian or my setup. I disabled firewall and also restored the port to it's original. I still get the error.

I will try the forums perhaps as you suggested. I don't have any idea of what might be wrong.