Starting or restarting the CloudPoint services may fail if a stale IP address entry is retained in the Podamn layer on RHEL 8.3 environment
Sometimes the following error may be encountered when the CloudPoint service containers restart.
Error adding network: failed to allocate for range 0: 10.89.0.140 has been allocated to 02da9e9aab2f79303c53dfb10b5ae6b6b70288d36b8fffbdfabba046da5a9afc, duplicate allocation is not allowed ERRO[0000] Error while adding pod to CNI network "flexsnap-network": failed to allocate for range 0: 10.89.0.140 has been allocated to 02da9e9aab2f79303c53dfb10b5ae6b6b70288d36b8fffbdfabba046da5a9afc, duplicate allocation is not allowed Error: error configuring network namespace for container 02da9e9aab2f79303c53dfb10b5ae6b6b70288d36b8fffbdfabba046da5a9afc: failed to allocate for range 0: 10.89.0.140 has been allocated to 02da9e9aab2f79303c53dfb10b5ae6b6b70288d36b8fffbdfabba046da5a9afc, duplicate allocation is not allowed"
The issue exists in the Podman subsystem which fails to remove the existing IP allocated for the container from dir /var/lib/cni/networks/flexsnap-network/, when the container is stopped.
Workaround:
Find the stale IP address, which is retained when the containers are stopped. For example 10.89.0.140 in the above error.
Run the following command to delete the stale entry fromdir /var/lib/cni/networks/flexsnap-network/:
# rm /var/lib/cni/networks/flexsnap-network/10.89.0.140
Start the service:
# podman start <service-name>