Proxy - read: connection res:q!et by peer


#1

I am running cntlm proxy server on my desktop to get me through the corp http proxy. I know that cntlm and root certs are working because able to reach here without issue.

root@garciaj1-virtual-machine:~# snap version
snap 2.37.1.1+18.04
snapd 2.37.1.1+18.04
series 16
linuxmint 19.1
kernel 4.15.0-45-generic

In /etc/environment I have the following and it appears that snapd is not picking this up this up without issue.

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
http_proxy=http://127.0.0.1:3128
https_proxy=https://127.0.0.1:3128
ftp_proxy=http://127.0.0.1:3128
no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com"
HTTP_PROXY=http://127.0.0.1:3128/
HTTPS_PROXY=https://127.0.0.1:3128/
FTP_PROXY=http://127.0.0.1:3128/
NO_PROXY="localhost,127.0.0.1,localaddress,.localdomain.com"
SNAPD_DEBUG=1

tailing the cntlm log never shows that snap or snapd attempts to connect to it

Here is what I get from journalctl:

Feb 06 22:48:41 garciaj1-virtual-machine snapd[8112]: retry.go:41: DEBUG: Retrying https://api.snapcraft.io/api/v1/snaps/sections, attempt 1, elapsed time=10.635µs
Feb 06 22:48:41 garciaj1-virtual-machine snapd[8112]: retry.go:112: DEBUG: Retrying because of temporary net error: &net.OpError{Op:"proxyconnect", Net:"tcp", Source:net.Addr(nil), Addr:net.Addr(nil), Err:(*net.OpError)(0xc42047c000)}
Feb 06 22:48:41 garciaj1-virtual-machine snapd[8112]: retry.go:41: DEBUG: Retrying https://api.snapcraft.io/api/v1/snaps/sections, attempt 2, elapsed time=350.850966ms
Feb 06 22:48:41 garciaj1-virtual-machine snapd[8112]: retry.go:112: DEBUG: Retrying because of temporary net error: &net.OpError{Op:"proxyconnect", Net:"tcp", Source:net.Addr(nil), Addr:net.Addr(nil), Err:(*net.OpError)(0xc420348000)}
Feb 06 22:48:42 garciaj1-virtual-machine snapd[8112]: retry.go:41: DEBUG: Retrying https://api.snapcraft.io/api/v1/snaps/sections, attempt 3, elapsed time=1.246966357s
Feb 06 22:48:42 garciaj1-virtual-machine snapd[8112]: retry.go:112: DEBUG: Retrying because of temporary net error: &net.OpError{Op:"proxyconnect", Net:"tcp", Source:net.Addr(nil), Addr:net.Addr(nil), Err:(*net.OpError)(0xc420348460)}
Feb 06 22:48:44 garciaj1-virtual-machine snapd[8112]: retry.go:41: DEBUG: Retrying https://api.snapcraft.io/api/v1/snaps/sections, attempt 4, elapsed time=3.412851627s
Feb 06 22:48:44 garciaj1-virtual-machine snapd[8112]: retry.go:112: DEBUG: Retrying because of temporary net error: &net.OpError{Op:"proxyconnect", Net:"tcp", Source:net.Addr(nil), Addr:net.Addr(nil), Err:(*net.OpError)(0xc4203b4140)}
Feb 06 22:48:49 garciaj1-virtual-machine snapd[8112]: retry.go:41: DEBUG: Retrying https://api.snapcraft.io/api/v1/snaps/sections, attempt 5, elapsed time=8.890126437s
Feb 06 22:48:49 garciaj1-virtual-machine snapd[8112]: retry.go:112: DEBUG: Retrying because of temporary net error: &net.OpError{Op:"proxyconnect", Net:"tcp", Source:net.Addr(nil), Addr:net.Addr(nil), Err:(*net.OpError)(0xc4203b4460)}
Feb 06 22:49:03 garciaj1-virtual-machine snapd[8112]: retry.go:41: DEBUG: Retrying https://api.snapcraft.io/api/v1/snaps/sections, attempt 6, elapsed time=22.554050363s
Feb 06 22:49:03 garciaj1-virtual-machine snapd[8112]: retry.go:53: DEBUG: The retry loop for https://api.snapcraft.io/api/v1/snaps/sections finished after 6 retries, elapsed time=22.556527288s, status: Get https://api.snapcraft.io/api/v1/snaps/sections: proxyconnect tcp: read tcp 127.0.0.1:50670->127.0.0.1:3128: read: connection reset by peer
Feb 06 22:49:03 garciaj1-virtual-machine snapd[8112]: catalogrefresh.go:84: DEBUG: Catalog refresh failed: Get https://api.snapcraft.io/api/v1/snaps/sections: proxyconnect tcp: read tcp 127.0.0.1:50670->127.0.0.1:3128: read: connection reset by peer.
Feb 06 22:49:03 garciaj1-virtual-machine snapd[8112]: stateengine.go:102: state ensure error: Get https://api.snapcraft.io/api/v1/snaps/sections: proxyconnect tcp: read tcp 127.0.0.1:50670->127.0.0.1:3128: read: connection reset by peer
Feb 06 22:49:16 garciaj1-virtual-machine snapd[8112]: daemon.go:611: gracefully waiting for running hooks
Feb 06 22:49:16 garciaj1-virtual-machine snapd[8112]: daemon.go:613: done waiting for running hooks
Feb 06 22:49:16 garciaj1-virtual-machine snapd[8112]: daemon stop requested to wait for socket activation

So at this point put in a override file with systemctl edit snapd and put this in there

[Service]
Environment="http_proxy=http://127.0.0.1:3128/"
Environment="https_proxy=https://127.0.0.1:3128/"

Run:
systemctl daemon-reload
systemctl restart snapd

This is what I see now in journalctl

-- Logs begin at Wed 2019-02-06 11:56:32 EST. --
Feb 06 23:16:30 garciaj1-virtual-machine snapd[10268]: retry.go:41: DEBUG: Retrying https://api.snapcraft.io/api/v1/snaps/sections, attempt 6, elapsed time=22.554487047s
Feb 06 23:16:30 garciaj1-virtual-machine snapd[10268]: retry.go:41: DEBUG: Retrying https://api.snapcraft.io/api/v1/snaps/search?confinement=strict%2Cclassic&fields=anon_download_url%2Carchitecture%2Cchannel%2Cdownload_sha3_384%2Csummary%2Cdescription%2Cbinary_filesize%2Cdownload_url%2Clast_updated%2Cpackage_name%2Cprices%2Cpublisher%2Cratings_average%2Crevision%2Csnap_id%2Clicense%2Cbase%2Cmedia%2Csupport_url%2Ccontact%2Ctitle%2Ccontent%2Cversion%2Corigin%2Cdeveloper_id%2Cdeveloper_name%2Cdeveloper_validation%2Cprivate%2Cconfinement%2Ccommon_ids&q=&scope=wide&section=featured, attempt 6, elapsed time=22.554571178s
Feb 06 23:16:30 garciaj1-virtual-machine snapd[10268]: retry.go:53: DEBUG: The retry loop for https://api.snapcraft.io/api/v1/snaps/sections finished after 6 retries, elapsed time=22.557723506s, status: Get https://api.snapcraft.io/api/v1/snaps/sections: proxyconnect tcp: read tcp 127.0.0.1:54428->127.0.0.1:3128: read: connection reset by peer
Feb 06 23:16:30 garciaj1-virtual-machine snapd[10268]: catalogrefresh.go:84: DEBUG: Catalog refresh failed: Get https://api.snapcraft.io/api/v1/snaps/sections: proxyconnect tcp: read tcp 127.0.0.1:54428->127.0.0.1:3128: read: connection reset by peer.
Feb 06 23:16:30 garciaj1-virtual-machine snapd[10268]: stateengine.go:102: state ensure error: Get https://api.snapcraft.io/api/v1/snaps/sections: proxyconnect tcp: read tcp 127.0.0.1:54428->127.0.0.1:3128: read: connection reset by peer
Feb 06 23:16:30 garciaj1-virtual-machine snapd[10268]: retry.go:53: DEBUG: The retry loop for https://api.snapcraft.io/api/v1/snaps/search?confinement=strict%2Cclassic&fields=anon_download_url%2Carchitecture%2Cchannel%2Cdownload_sha3_384%2Csummary%2Cdescription%2Cbinary_filesize%2Cdownload_url%2Clast_updated%2Cpackage_name%2Cprices%2Cpublisher%2Cratings_average%2Crevision%2Csnap_id%2Clicense%2Cbase%2Cmedia%2Csupport_url%2Ccontact%2Ctitle%2Ccontent%2Cversion%2Corigin%2Cdeveloper_id%2Cdeveloper_name%2Cdeveloper_validation%2Cprivate%2Cconfinement%2Ccommon_ids&q=&scope=wide&section=featured finished after 6 retries, elapsed time=22.557526475s, status: Get https://api.snapcraft.io/api/v1/snaps/search?confinement=strict%2Cclassic&fields=anon_download_url%2Carchitecture%2Cchannel%2Cdownload_sha3_384%2Csummary%2Cdescription%2Cbinary_filesize%2Cdownload_url%2Clast_updated%2Cpackage_name%2Cprices%2Cpublisher%2Cratings_average%2Crevision%2Csnap_id%2Clicense%2Cbase%2Cmedia%2Csupport_url%2Ccontact%2Ctitle%2Ccontent%2Cversion%2Corigin%2Cdeveloper_id%2Cdeveloper_name%2Cdeveloper_validation%2Cprivate%2Cconfinement%2Ccommon_ids&q=&scope=wide&section=featured: proxyconnect tcp: read tcp 127.0.0.1:54430->127.0.0.1:3128: read: connection reset by peer
Feb 06 23:16:30 garciaj1-virtual-machine snapd[10268]: daemon.go:296: DEBUG: pid=10260;uid=0;socket=/run/snapd.socket; GET /v2/find?q=&scope=wide&section=featured 22.581488262s 500
Feb 06 23:16:42 garciaj1-virtual-machine snapd[10268]: daemon.go:611: gracefully waiting for running hooks
Feb 06 23:16:42 garciaj1-virtual-machine snapd[10268]: daemon.go:613: done waiting for running hooks
Feb 06 23:16:42 garciaj1-virtual-machine snapd[10268]: daemon stop requested to wait for socket activation
Feb 06 23:23:27 garciaj1-virtual-machine systemd[1]: Starting Snappy daemon...
Feb 06 23:23:27 garciaj1-virtual-machine snapd[10615]: AppArmor status: apparmor is enabled and all features are available
Feb 06 23:23:27 garciaj1-virtual-machine snapd[10615]: daemon.go:379: started snapd/2.37.1.1+18.04 (series 16; classic) linuxmint/19.1 (amd64) linux/4.15.0-45-generic.
Feb 06 23:23:27 garciaj1-virtual-machine snapd[10615]: main.go:82: DEBUG: Setting up sd_notify() watchdog timer every 2m30s
Feb 06 23:23:27 garciaj1-virtual-machine snapd[10615]: main.go:141: DEBUG: activation done in 137ms
Feb 06 23:23:27 garciaj1-virtual-machine systemd[1]: Started Snappy daemon.
Feb 06 23:23:27 garciaj1-virtual-machine snapd[10615]: catalogrefresh.go:78: DEBUG: Catalog refresh starting now; next scheduled for 2019-02-07 23:23:27.281164692 -0500 EST m=+86400.194133907.
Feb 06 23:23:27 garciaj1-virtual-machine snapd[10615]: retry.go:41: DEBUG: Retrying https://api.snapcraft.io/api/v1/snaps/sections, attempt 1, elapsed time=11.55µs
Feb 06 23:23:27 garciaj1-virtual-machine snapd[10615]: retry.go:41: DEBUG: Retrying https://api.snapcraft.io/api/v1/snaps/search?confinement=strict%2Cclassic&fields=anon_download_url%2Carchitecture%2Cchannel%2Cdownload_sha3_384%2Csummary%2Cdescription%2Cbinary_filesize%2Cdownload_url%2Clast_updated%2Cpackage_name%2Cprices%2Cpublisher%2Cratings_average%2Crevision%2Csnap_id%2Clicense%2Cbase%2Cmedia%2Csupport_url%2Ccontact%2Ctitle%2Ccontent%2Cversion%2Corigin%2Cdeveloper_id%2Cdeveloper_name%2Cdeveloper_validation%2Cprivate%2Cconfinement%2Ccommon_ids&q=&scope=wide&section=featured, attempt 1, elapsed time=10.979µs
Feb 06 23:23:27 garciaj1-virtual-machine snapd[10615]: retry.go:112: DEBUG: Retrying because of temporary net error: &net.OpError{Op:"proxyconnect", Net:"tcp", Source:net.Addr(nil), Addr:net.Addr(nil), Err:(*net.OpError)(0xc4200b6140)}
Feb 06 23:23:27 garciaj1-virtual-machine snapd[10615]: retry.go:112: DEBUG: Retrying because of temporary net error: &net.OpError{Op:"proxyconnect", Net:"tcp", Source:net.Addr(nil), Addr:net.Addr(nil), Err:(*net.OpError)(0xc4202fe500)}
Feb 06 23:23:27 garciaj1-virtual-machine snapd[10615]: retry.go:41: DEBUG: Retrying https://api.snapcraft.io/api/v1/snaps/sections, attempt 2, elapsed time=350.361422ms
Feb 06 23:23:27 garciaj1-virtual-machine snapd[10615]: retry.go:112: DEBUG: Retrying because of temporary net error: &net.OpError{Op:"proxyconnect", Net:"tcp", Source:net.Addr(nil), Addr:net.Addr(nil), Err:(*net.OpError)(0xc42041a0a0)}
Feb 06 23:23:27 garciaj1-virtual-machine snapd[10615]: retry.go:41: DEBUG: Retrying https://api.snapcraft.io/api/v1/snaps/search?confinement=strict%2Cclassic&fields=anon_download_url%2Carchitecture%2Cchannel%2Cdownload_sha3_384%2Csummary%2Cdescription%2Cbinary_filesize%2Cdownload_url%2Clast_updated%2Cpackage_name%2Cprices%2Cpublisher%2Cratings_average%2Crevision%2Csnap_id%2Clicense%2Cbase%2Cmedia%2Csupport_url%2Ccontact%2Ctitle%2Ccontent%2Cversion%2Corigin%2Cdeveloper_id%2Cdeveloper_name%2Cdeveloper_validation%2Cprivate%2Cconfinement%2Ccommon_ids&q=&scope=wide&section=featured, attempt 2, elapsed time=350.500053ms
Feb 06 23:23:27 garciaj1-virtual-machine snapd[10615]: retry.go:112: DEBUG: Retrying because of temporary net error: &net.OpError{Op:"proxyconnect", Net:"tcp", Source:net.Addr(nil), Addr:net.Addr(nil), Err:(*net.OpError)(0xc42041a280)}
Feb 06 23:23:28 garciaj1-virtual-machine snapd[10615]: retry.go:41: DEBUG: Retrying https://api.snapcraft.io/api/v1/snaps/sections, attempt 3, elapsed time=1.226111553s
Feb 06 23:23:28 garciaj1-virtual-machine snapd[10615]: retry.go:41: DEBUG: Retrying https://api.snapcraft.io/api/v1/snaps/search?confinement=strict%2Cclassic&fields=anon_download_url%2Carchitecture%2Cchannel%2Cdownload_sha3_384%2Csummary%2Cdescription%2Cbinary_filesize%2Cdownload_url%2Clast_updated%2Cpackage_name%2Cprices%2Cpublisher%2Cratings_average%2Crevision%2Csnap_id%2Clicense%2Cbase%2Cmedia%2Csupport_url%2Ccontact%2Ctitle%2Ccontent%2Cversion%2Corigin%2Cdeveloper_id%2Cdeveloper_name%2Cdeveloper_validation%2Cprivate%2Cconfinement%2Ccommon_ids&q=&scope=wide&section=featured, attempt 3, elapsed time=1.225564245s
Feb 06 23:23:28 garciaj1-virtual-machine snapd[10615]: retry.go:112: DEBUG: Retrying because of temporary net error: &net.OpError{Op:"proxyconnect", Net:"tcp", Source:net.Addr(nil), Addr:net.Addr(nil), Err:(*net.OpError)(0xc4202feaa0)}
Feb 06 23:23:28 garciaj1-virtual-machine snapd[10615]: retry.go:112: DEBUG: Retrying because of temporary net error: &net.OpError{Op:"proxyconnect", Net:"tcp", Source:net.Addr(nil), Addr:net.Addr(nil), Err:(*net.OpError)(0xc4202febe0)}
Feb 06 23:23:30 garciaj1-virtual-machine snapd[10615]: retry.go:41: DEBUG: Retrying https://api.snapcraft.io/api/v1/snaps/sections, attempt 4, elapsed time=3.41295515s
Feb 06 23:23:30 garciaj1-virtual-machine snapd[10615]: retry.go:112: DEBUG: Retrying because of temporary net error: &net.OpError{Op:"proxyconnect", Net:"tcp", Source:net.Addr(nil), Addr:net.Addr(nil), Err:(*net.OpError)(0xc4200b6910)}
Feb 06 23:23:30 garciaj1-virtual-machine snapd[10615]: retry.go:41: DEBUG: Retrying https://api.snapcraft.io/api/v1/snaps/search?confinement=strict%2Cclassic&fields=anon_download_url%2Carchitecture%2Cchannel%2Cdownload_sha3_384%2Csummary%2Cdescription%2Cbinary_filesize%2Cdownload_url%2Clast_updated%2Cpackage_name%2Cprices%2Cpublisher%2Cratings_average%2Crevision%2Csnap_id%2Clicense%2Cbase%2Cmedia%2Csupport_url%2Ccontact%2Ctitle%2Ccontent%2Cversion%2Corigin%2Cdeveloper_id%2Cdeveloper_name%2Cdeveloper_validation%2Cprivate%2Cconfinement%2Ccommon_ids&q=&scope=wide&section=featured, attempt 4, elapsed time=3.41314275s
Feb 06 23:23:30 garciaj1-virtual-machine snapd[10615]: retry.go:112: DEBUG: Retrying because of temporary net error: &net.OpError{Op:"proxyconnect", Net:"tcp", Source:net.Addr(nil), Addr:net.Addr(nil), Err:(*net.OpError)(0xc42041a9b0)}
Feb 06 23:23:36 garciaj1-virtual-machine snapd[10615]: retry.go:41: DEBUG: Retrying https://api.snapcraft.io/api/v1/snaps/sections, attempt 5, elapsed time=8.882239626s
Feb 06 23:23:36 garciaj1-virtual-machine snapd[10615]: retry.go:41: DEBUG: Retrying https://api.snapcraft.io/api/v1/snaps/search?confinement=strict%2Cclassic&fields=anon_download_url%2Carchitecture%2Cchannel%2Cdownload_sha3_384%2Csummary%2Cdescription%2Cbinary_filesize%2Cdownload_url%2Clast_updated%2Cpackage_name%2Cprices%2Cpublisher%2Cratings_average%2Crevision%2Csnap_id%2Clicense%2Cbase%2Cmedia%2Csupport_url%2Ccontact%2Ctitle%2Ccontent%2Cversion%2Corigin%2Cdeveloper_id%2Cdeveloper_name%2Cdeveloper_validation%2Cprivate%2Cconfinement%2Ccommon_ids&q=&scope=wide&section=featured, attempt 5, elapsed time=8.881373382s
Feb 06 23:23:36 garciaj1-virtual-machine snapd[10615]: retry.go:112: DEBUG: Retrying because of temporary net error: &net.OpError{Op:"proxyconnect", Net:"tcp", Source:net.Addr(nil), Addr:net.Addr(nil), Err:(*net.OpError)(0xc4202fed20)}
Feb 06 23:23:36 garciaj1-virtual-machine snapd[10615]: retry.go:112: DEBUG: Retrying because of temporary net error: &net.OpError{Op:"proxyconnect", Net:"tcp", Source:net.Addr(nil), Addr:net.Addr(nil), Err:(*net.OpError)(0xc4200b6c80)}
Feb 06 23:23:49 garciaj1-virtual-machine snapd[10615]: retry.go:41: DEBUG: Retrying https://api.snapcraft.io/api/v1/snaps/sections, attempt 6, elapsed time=22.553818414s
Feb 06 23:23:49 garciaj1-virtual-machine snapd[10615]: retry.go:53: DEBUG: The retry loop for https://api.snapcraft.io/api/v1/snaps/sections finished after 6 retries, elapsed time=22.556570228s, status: Get https://api.snapcraft.io/api/v1/snaps/sections: proxyconnect tcp: read tcp 127.0.0.1:54814->127.0.0.1:3128: read: connection reset by peer
Feb 06 23:23:49 garciaj1-virtual-machine snapd[10615]: catalogrefresh.go:84: DEBUG: Catalog refresh failed: Get https://api.snapcraft.io/api/v1/snaps/sections: proxyconnect tcp: read tcp 127.0.0.1:54814->127.0.0.1:3128: read: connection reset by peer.
Feb 06 23:23:49 garciaj1-virtual-machine snapd[10615]: stateengine.go:102: state ensure error: Get https://api.snapcraft.io/api/v1/snaps/sections: proxyconnect tcp: read tcp 127.0.0.1:54814->127.0.0.1:3128: read: connection reset by peer
Feb 06 23:23:49 garciaj1-virtual-machine snapd[10615]: retry.go:41: DEBUG: Retrying https://api.snapcraft.io/api/v1/snaps/search?confinement=strict%2Cclassic&fields=anon_download_url%2Carchitecture%2Cchannel%2Cdownload_sha3_384%2Csummary%2Cdescription%2Cbinary_filesize%2Cdownload_url%2Clast_updated%2Cpackage_name%2Cprices%2Cpublisher%2Cratings_average%2Crevision%2Csnap_id%2Clicense%2Cbase%2Cmedia%2Csupport_url%2Ccontact%2Ctitle%2Ccontent%2Cversion%2Corigin%2Cdeveloper_id%2Cdeveloper_name%2Cdeveloper_validation%2Cprivate%2Cconfinement%2Ccommon_ids&q=&scope=wide&section=featured, attempt 6, elapsed time=22.554972279s
Feb 06 23:23:49 garciaj1-virtual-machine snapd[10615]: retry.go:53: DEBUG: The retry loop for https://api.snapcraft.io/api/v1/snaps/search?confinement=strict%2Cclassic&fields=anon_download_url%2Carchitecture%2Cchannel%2Cdownload_sha3_384%2Csummary%2Cdescription%2Cbinary_filesize%2Cdownload_url%2Clast_updated%2Cpackage_name%2Cprices%2Cpublisher%2Cratings_average%2Crevision%2Csnap_id%2Clicense%2Cbase%2Cmedia%2Csupport_url%2Ccontact%2Ctitle%2Ccontent%2Cversion%2Corigin%2Cdeveloper_id%2Cdeveloper_name%2Cdeveloper_validation%2Cprivate%2Cconfinement%2Ccommon_ids&q=&scope=wide&section=featured finished after 6 retries, elapsed time=22.557591886s, status: Get https://api.snapcraft.io/api/v1/snaps/search?confinement=strict%2Cclassic&fields=anon_download_url%2Carchitecture%2Cchannel%2Cdownload_sha3_384%2Csummary%2Cdescription%2Cbinary_filesize%2Cdownload_url%2Clast_updated%2Cpackage_name%2Cprices%2Cpublisher%2Cratings_average%2Crevision%2Csnap_id%2Clicense%2Cbase%2Cmedia%2Csupport_url%2Ccontact%2Ctitle%2Ccontent%2Cversion%2Corigin%2Cdeveloper_id%2Cdeveloper_name%2Cdeveloper_validation%2Cprivate%2Cconfinement%2Ccommon_ids&q=&scope=wide&section=featured: proxyconnect tcp: read tcp 127.0.0.1:54816->127.0.0.1:3128: read: connection reset by peer
Feb 06 23:23:49 garciaj1-virtual-machine snapd[10615]: daemon.go:296: DEBUG: pid=10607;uid=0;socket=/run/snapd.socket; GET /v2/find?q=&scope=wide&section=featured 22.565690367s 500
Feb 06 23:24:02 garciaj1-virtual-machine snapd[10615]: daemon.go:611: gracefully waiting for running hooks
Feb 06 23:24:02 garciaj1-virtual-machine snapd[10615]: daemon.go:613: done waiting for running hooks
Feb 06 23:24:02 garciaj1-virtual-machine snapd[10615]: daemon stop requested to wait for socket activation

And I still get the same error from the sanp command line

root@virtual-machine:~# snap search
2019/02/06 23:23:49.848356 error.go:100: DEBUG: error: Get https://api.snapcraft.io/api/v1/snaps/search?confinement=strict%2Cclassic&fields=anon_download_url%2Carchitecture%2Cchannel%2Cdownload_sha3_384%2Csummary%2Cdescription%2Cbinary_filesize%2Cdownload_url%2Clast_updated%2Cpackage_name%2Cprices%2Cpublisher%2Cratings_average%2Crevision%2Csnap_id%2Clicense%2Cbase%2Cmedia%2Csupport_url%2Ccontact%2Ctitle%2Ccontent%2Cversion%2Corigin%2Cdeveloper_id%2Cdeveloper_name%2Cdeveloper_validation%2Cprivate%2Cconfinement%2Ccommon_ids&q=&scope=wide&section=featured: proxyconnect tcp: read tcp 127.0.0.1:54816->127.0.0.1:3128: read: connection reset by peer
error: Get
       https://api.snapcraft.io/api/v1/snaps/search?confinement=strict%2Cclassic&fields=anon_download_url%2Carchitecture%2Cchannel%2Cdownload_sha3_384%2Csummary%2Cdescription%2Cbinary_filesize%2Cdownload_url%2Clast_updated%2Cpackage_name%2Cprices%2Cpublisher%2Cratings_average%2Crevision%2Csnap_id%2Clicense%2Cbase%2Cmedia%2Csupport_url%2Ccontact%2Ctitle%2Ccontent%2Cversion%2Corigin%2Cdeveloper_id%2Cdeveloper_name%2Cdeveloper_validation%2Cprivate%2Cconfinement%2Ccommon_ids&q=&scope=wide&section=featured:
       proxyconnect tcp: read tcp 127.0.0.1:54816->127.0.0.1:3128: read: connection reset by peer

#2

About snapd picking up /etc/environment, the snapd service unit we provide has

EnvironmentFile=-/etc/environment

which causes it to read that file for its environment. If your snapd.service file is missing that, then that’s why.

What happens if you run

curl -v https://api.snapcraft.io/v2/snaps/info/x

?