Network connections dropped in strict and devmode, not in classic

2021-02-26T23:00:00Z
I try to run a Python package (script) in a snap. In classic mode it runs normal. Connect to a radio server, get content. In other modes I loose network connections very quickly. Some server with higher ping times do not connect at all. I tested it on several VM’s incl. Bunsen B2, Fedora 29, Suse15, Ubuntu18 +20.
For me, it looks like a problem with the container use a network: use bridged, use host. But I have no idea how this is implemented.

GOOD

sudo snap install --classic --dangerous ghettorecorder_0.1.1_amd64.snap

name: ghettorecorder
version: ‘0.1.1’
summary: InetRadio
grade: devel # devel stable
confinement: classic # ‘classic’, ‘devmode’, ‘strict’
base: core18
apps:
ghettorecorder:
command: python3 -m ghettorecorder.run
parts:
ghettorecorder:
plugin: python
python-version: python3
source: .
python-packages:
- configparser==5.0.1
- requests==2.25.1
- urllib3==1.26.2
- ghettorecorder==0.1.1

BAD

name: ghettorecorder

version: ‘0.1.1’
summary: InetRadioRecorder
grade: devel # devel stable
confinement: devmode # ‘classic’, ‘devmode’, ‘strict’
base: core18

apps:
ghettorecorder:
command: python3 -m ghettorecorder.run
plugs: # only strict confinement - home - network - network-bind, no work at all, see ‘b5_aktuell’ ‘thaisuksonradio’
- home
- network
- network-bind

parts:
ghettorecorder:
plugin: python
python-version: python3
source: .
python-packages:
- configparser==5.0.1
- requests==2.25.1
- urllib3==1.26.2
- ghettorecorder==0.1.1

I highly appreciate any suggestions on where to get error information, or how to get network error information at all.

1 Like