Duplicate network name with very similar creation timestamps
Description
On a device, when running balena network ls, there will be duplicate networks of the same name, for example:
root@f29ba6a:~# balena network ls
NETWORK ID NAME DRIVER SCOPE
0ae95aa06032 900de4f3cbac4b9bbd232885a35e407b_default bridge local
0db8a8564e2c 900de4f3cbac4b9bbd232885a35e407b_default bridge local
0d6886984713 012256e0da5841d5b3fc239fd1b0202b_default bridge local
e62e8d0683ff 012256e0da5841d5b3fc239fd1b0202b_default bridge local
04c253fe2f4b bridge bridge local
742646ce9be4 host host local
f007b855108d none null local
938bd0471378 supervisor0
Upon inspecting each network:
root@f29ba6a:~# balena inspect 0ae95aa06032 | jq '.[] | {Name,Id,Created,IPAMConfig:.IPAM.Config,Labels}'
{
"Name": "900de4f3cbac4b9bbd232885a35e407b_default",
"Id": "0ae95aa06032de5f9b7d10b740e039affabd408937e42a70b0eb42025d40ab54",
"Created": "2022-03-30T20:07:30.777967024Z",
"IPAMConfig": [
{
"Subnet": "172.19.0.0/16",
"Gateway": "172.19.0.1"
}
],
"Labels": {
"io.balena.app-id": "1667443",
"io.balena.supervised": "true"
}
}
root@f29ba6a:~# balena inspect 0db8a8564e2c | jq '.[] | {Name,Id,Created,IPAMConfig:.IPAM.Config,Labels}'
{
"Name": "900de4f3cbac4b9bbd232885a35e407b_default",
"Id": "0db8a8564e2c7cbc007476dcc9a2e3d61d23182948e7d563940ae90f035f9b35",
"Created": "2022-03-30T20:07:30.081596565Z",
"IPAMConfig": [
{
"Subnet": "172.17.0.0/16",
"Gateway": "172.17.0.1"
}
],
"Labels": {
"io.balena.app-id": "1667443",
"io.balena.supervised": "true"
}
}
They will display different subnets and nearly the same creation timetsamps, indicating a command was issued more than once. It's unclear how this issue has come about, as the device where the above info was obtained from has long since rotated its logs, so more investigation of a device freshly in this state is needed for a reproduction.
The workaround to resolve this is to delete one of the networks, then restart the Supervisor on the device.
Steps to reproduce the issue: 1. 2. 3.
Describe the results you received:
Describe the results you expected:
Additional information you deem important (e.g. issue happens only occasionally):
Output of balena-engine version:
Client:
Version: 20.10.12
API version: 1.41
Go version: go1.16.2
Git commit: 73c78258302d94f9652da995af6f65a621fac918
Built: Wed Mar 2 18:39:47 2022
OS/Arch: linux/arm64
Context: default
Experimental: true
Server:
Engine:
Version: 20.10.12
API version: 1.41 (minimum version 1.12)
Go version: go1.16.2
Git commit: 73c78258302d94f9652da995af6f65a621fac918
Built: Wed Mar 2 18:39:47 2022
OS/Arch: linux/arm64
Experimental: true
containerd:
Version: 1.4.0+unknown
GitCommit:
runc:
Version: spec: 1.0.2-dev
GitCommit:
balena-engine-init:
Version: 0.13.0
GitCommit: 949e6fa-dirty
Output of balena-engine info:
Client:
Context: default
Debug Mode: false
Server:
Containers: 4
Running: 1
Paused: 0
Stopped: 3
Images: 15
Server Version: 20.10.12
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
userxattr: false
Logging Driver: journald
Cgroup Driver: systemd
Cgroup Version: 1
Plugins:
Volume: local
Network: bridge host null
Log: journald json-file local
Swarm:
NodeID:
Is Manager: false
Node Address:
Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
Default Runtime: runc
Init Binary: balena-engine-init
containerd version:
runc version:
init version: 949e6fa-dirty (expected: de40ad007797e)
Kernel Version: 5.10.83-v8
Operating System: balenaOS 2.95.8
OSType: linux
Architecture: aarch64
CPUs: 4
Total Memory: 3.754GiB
Name: f29ba6a
ID: BMJY:P6ZO:IBXA:2I42:MTC4:MRYC:GGCQ:R3MJ:ZBOK:LH57:ZHNA:O4CW
Docker Root Dir: /var/lib/docker
Debug Mode: false
Registry: https://index.docker.io/v1/
Labels:
Experimental: true
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
Additional environment details (device type, OS, etc.):
Device Type: Raspberry Pi 4 OS: balenaOS 2.95.8 (production)
[cywang117] This issue has attached support thread https://jel.ly.fish/19280bc1-0976-4089-ab20-8aa6de7a42d7