How to turn off periodic requests?

We have Ubuntu machine with preinstalled snapd service. We don’t use it and there are no packages installed by using snap. Recently we noticed some activity from the daemon, doing some sort of sync requests:

November 9th 2018, 19:15:32.175 lc11 snapd 2018/11/10 00:15:32.165522 stateengine.go:101: state ensure error: Get https://api.snapcraft.io/api/v1/snaps/sections: dial tcp: lookup api.snapcraft.io on [::1]:53: read udp [::1]:54054->[::1]:53: read: connection refused

It is not obvious how often it happens. Some config of the system has been changed and we started to see these errors from time to time. I understand, it is trying to resolve domain name, sending UDP to DNS. But it is not the issue. I wonder, why it sends requests, and what was the reason. How often it sends them and if there is a way to disable them. Anything will help to understand the logic of it. I am not familiar with Go language.

The snapd daemon is trying to build a cache of snap sections present on the store side.

Ultimately it’s used in searching snaps:

$ snap find --section
No section specified. Available sections:
 * developers
 * featured
 * finance
 * games
 * graphics
 * music
 * productivity
 * server
 * social-networking
 * utilities
 * video
Please try 'snap find --section=<selected section>'
$ snap find --section=utilities foo

Since 2.36, if there are no snaps installed, snapd will automatically stop.

You can disable snapd.service and only enable snapd.socket, so that snapd will not be started at boot but will start automatically when you issue snap .. command

Thanks for your help. By the way, how often it tries to build the cache? Looks like it happens at the same time on multiple hosts, once a day.

Once a day sounds about right. It’s once every 24 hours, which is once a day most days :slight_smile:

Cool, thanks a lot for your answer and the source line.