Error: Get snap under proxy configuration

Everytime I try to download any package using snap I get errors like this:
error: cannot install “intellij”: Post
https://api.snapcraft.io/v2/snaps/refresh: proxyconnect tcp: tls:
oversized record received with length 20527

How can I fix that?

what proxy are you using?

1 Like

googling that error leads me to believe you have set https_proxy=https://<something> when you might need it to be https_proxy=http://<something> instead.

1 Like

I’m using a company proxy that works for everything here but didn’t work for snap.
I put it as environment variable and in snap settings.

I tried both, http and https.

could you show me the output of

sudo cat /proc/`pidof snapd`/environ | tr '\0' '\n' 

please?

1 Like

LANG=pt_BR.UTF-8
LANGUAGE=pt_BR:pt:en
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
NOTIFY_SOCKET=/run/systemd/notify
LISTEN_PID=702
LISTEN_FDS=2
LISTEN_FDNAMES=snapd.socket:snapd.socket
WATCHDOG_PID=702
WATCHDOG_USEC=300000000
INVOCATION_ID=019d7e7ebc3a4fd785f8a779c13fb371
JOURNAL_STREAM=9:19180

I made it.
I runned this command.
sudo snap set system proxy.http=http://127.0.0.1:3128
sudo snap set system proxy.https=http://127.0.0.1:3128
and installed the snaps in the same session of the root.

1 Like

When a use sudo for each command didn’t work.

Also, we can remove the proxy by:

sudo snap set system proxy.http=
sudo snap set system proxy.https=
1 Like