IceWhaleTech / CasaOS

CasaOS - A simple, easy-to-use, elegant open-source Personal Cloud system.
https://casaos.io
Apache License 2.0
23.61k stars 1.28k forks source link

Too many DNS requests #1472

Open Vizion-HUN opened 8 months ago

Vizion-HUN commented 8 months ago

Describe the bug

Casa OS frequently sending DNS requests. Way too many... github.com codeload.github.com

To Reproduce install Casa OS, log traffic.

Expected behavior Checking updates, etc. is OK. Daily 1 would be fine.

Screenshots casa2 casa1

Desktop (please complete the following information):

Thank You!

jerrykuku commented 8 months ago

This request should be coming from an app store source update. It does seem to be more frequent at the moment, and we'll discuss and determine a more reasonable frequency to fix it in a future release.

tigerinus commented 8 months ago

@Vizion-HUN - On top of my mind I don't recall any logic within CasaOS keeps sending DNS Lookup requests. At most it resolves a domain to IP once, then following connections will be established via IP.

Would you please provide full repro step for this issue, including the tools you used?

Vizion-HUN commented 8 months ago

Hello!

There isn't any special steps, I am using AdGuard Home as DNS filter/resolver. And I see the requests, as You can see above on the pictures.

There was no changes in SW or anything (other Dockers are started and stopped as needed), this is why I think sohehow the problem is Casa OS update related.

How can I find the source of the requests?

Thank You for Your help! Vizion

tigerinus commented 8 months ago

What tool do you use for capture the DNS lookups?

Can you help eliminating some factors (apps, settings, etc.) down to minimum environment for reproducing this issue? Super appreciated!

Vizion-HUN commented 8 months ago

As I wrote, I have AdGuard Home (LXC on my PVE server) as my DNS resolver, I can track my network there.

Look at this maybe it helps: vizion@casa:~$ sudo journalctl -xef -u casaos.service nov 01 19:12:26 casa casaos[1096]: /bin/bash -c source /usr/share/casaos/shell/helper.sh ;CatNetCardState ens18 nov 01 19:12:30 casa casaos[1096]: 消息来了,message:{"type":"ping"} nov 01 19:12:31 casa casaos[1096]: /bin/bash -c source /usr/share/casaos/shell/helper.sh ;CatNetCardState ens18 nov 01 19:12:36 casa casaos[1096]: /bin/bash -c source /usr/share/casaos/shell/helper.sh ;CatNetCardState ens18 nov 01 19:12:41 casa casaos[1096]: /bin/bash -c source /usr/share/casaos/shell/helper.sh ;CatNetCardState ens18 nov 01 19:12:46 casa casaos[1096]: /bin/bash -c source /usr/share/casaos/shell/helper.sh ;CatNetCardState ens18 nov 01 19:12:51 casa casaos[1096]: /bin/bash -c source /usr/share/casaos/shell/helper.sh ;CatNetCardState ens18 nov 01 19:12:56 casa casaos[1096]: /bin/bash -c source /usr/share/casaos/shell/helper.sh ;CatNetCardState ens18 nov 01 19:13:00 casa casaos[1096]: 消息来了,message:{"type":"ping"}

This thing is running continuosly.

sudo journalctl -xef -u casaos-app-management: nov 01 21:38:39 casa casaos-app-management[1994]: 2023-11-01T21:38:39.799Z info Using default appstore {"func": "service.(AppStoreManagement).ComposeApp", "file": "/home/runner/work/CasaOS-AppManagement/CasaOS-AppManagement/service/appstore_management.go", "line": 397} nov 01 21:38:39 casa casaos-app-management[1994]: 2023-11-01T21:38:39.799Z error store compose app not found, thus no update available {"storeAppID": "digikam", "func": "service.(ComposeApp).IsUpdateAvailable", "file": "/home/runner/work/CasaOS-AppManagement/CasaOS-AppManagement/service/compose_app.go", "line": 181} nov 01 21:38:39 casa casaos-app-management[1994]: 2023-11-01T21:38:39.808Z info main app image tag is latest, thus no update available {"image": "filebrowser/filebrowser:latest", "func": "service.(ComposeApp).IsUpdateAvailableWith", "file": "/home/runner/work/CasaOS-AppManagement/CasaOS-AppManagement/service/compose_app.go", "line": 206} nov 01 21:38:39 casa casaos-app-management[1994]: {"time":"2023-11-01T21:38:39.828558532Z","id":"","remote_ip":"192.168.0.5","host":"192.168.0.8:36163","method":"GET","uri":"/v2/app_management/web/appgrid","user_agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36","status":200,"error":"","latency":54110769,"latency_human":"54.110769ms","bytes_in":0,"bytes_out":1421} nov 01 21:38:44 casa casaos-app-management[1994]: 2023-11-01T21:38:44.803Z info main app image tag is latest, thus no update available {"image": "filebrowser/filebrowser:latest", "func": "service.(ComposeApp).IsUpdateAvailableWith", "file": "/home/runner/work/CasaOS-AppManagement/CasaOS-AppManagement/service/compose_app.go", "line": 206} nov 01 21:38:44 casa casaos-app-management[1994]: 2023-11-01T21:38:44.810Z info app not found in any appstore {"id": "digikam", "func": "service.(AppStoreManagement).ComposeApp", "file": "/home/runner/work/CasaOS-AppManagement/CasaOS-AppManagement/service/appstore_management.go", "line": 390} nov 01 21:38:44 casa casaos-app-management[1994]: 2023-11-01T21:38:44.810Z info Using default appstore {"func": "service.(AppStoreManagement).ComposeApp", "file": "/home/runner/work/CasaOS-AppManagement/CasaOS-AppManagement/service/appstore_management.go", "line": 397} nov 01 21:38:44 casa casaos-app-management[1994]: 2023-11-01T21:38:44.810Z error store compose app not found, thus no update available {"storeAppID": "digikam", "func": "service.(*ComposeApp).IsUpdateAvailable", "file": "/home/runner/work/CasaOS-AppManagement/CasaOS-AppManagement/service/compose_app.go", "line": 181} nov 01 21:38:44 casa casaos-app-management[1994]: {"time":"2023-11-01T21:38:44.827304107Z","id":"","remote_ip":"192.168.0.5","host":"192.168.0.8:36163","method":"GET","uri":"/v2/app_management/web/appgrid","user_agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36","status":200,"error":"","latency":50065941,"latency_human":"50.065941ms","bytes_in":0,"bytes_out":1421}

tigerinus commented 8 months ago

Can u stop AdGuard Home and see if it still send these many DNS lookups?

Just want to see if it is AdGuard or CasaOS causing the issue.

Vizion-HUN commented 8 months ago

No, AdGuard Home is my DNS server, can't stop it. However I tested: add line to Casa OS hosts file: 0.0.0.0 github.com and no more request sended to AGH, so it is sure the Casa OS sending this. I dont know much about helper.sh, but I think that file triggers the pings somehow.

tigerinus commented 8 months ago

Like I said above, CasaOS has no functionality or need to keep sending DNS lookups. It is not a DNS service (but AdGuard is).

Correct me if I am wrong, but I don't see helper.sh has anything to do with DNS lookup, especially GitHub.com.

I was not suggesting u to turn off AdGuard as a solution. I was asking u to turn it off for like 1min and see if the behavior still persist just so we can rule out AdGuard as a factor. I need ur help before I can help u.

Vizion-HUN commented 8 months ago

AGH just receiving the requests, logs and redirect to the upstream server. I used AGH even before Casa OS, it is not the source. With 0.0.0.0 inb Casa OS's hosts file, there is no more requests. I will try to stop all dockers, or reinstall Casa OS, and see. THX for Your help.

LinkLeong commented 8 months ago

Thanks for your feedback, I will close this question and reopen it if you have any questions.

Vizion-HUN commented 8 months ago

Hello again! Fresh installed (a few hours ago) Casa OS on Proxmox VE (fully updated free version), using Ubuntu live Server 2023.10 Casaa OS installed on Ubuntu server via wget -qO- https://get.casaos.io | sudo bash Also fully updated, no dockers or anything installed:

So this one is a new virtual SSD, with a different linux base system. And the result is sadly the same. github.com and codeload.github requests (6-10 times) every 10 minutes. casa

To reproduce: install Casa OS and log network/DNS requests. Later I will test Casa OS on other server distros, maybe Ubuntu causing the requests. Thank You!

tigerinus commented 8 months ago

Let's keep this issue open until its cause is clear.

ObiWaz commented 2 weeks ago

I want to chime in here as well. I am having the same exact issue. I have Adguard as my DNS on a Pi4. My Casa machine is latest Debian (Bookworm). It only has Casa installed and Jellyfin installed on Casa. Maybe a couple of other terminal apps to help me monitor the system like btop. It's really just a vessel for Jellyfin and nothing else. It looks like Casa is making these requests every 10 minutes which is excessive.

Screenshot from 2024-06-23 12-15-28