Fix loss of network access after upgrading a Debian-based OS image on a Private Network
Problem
When upgrading a Debian-based OS image to the latest version, you may experience a loss of network connectivity if your Instance is connected to a Private Network.
Typically, this may happen when Ubuntu is upgraded from either Ubuntu 22.04 Jammy Jellyfish or Ubuntu 24.04 Noble Numbat to Ubuntu 26.04 Resolute Raccoon.
Cause
This issue is caused by a change of behavior of Netplan, which is no longer able to read the file generated by /usr/bin/scw-vpc-ifup.
Solution
Update scaleway-ecosystem package before OS upgrade
Before upgrading the OS of the Instance to the latest version, make sure that the scaleway-ecosystem package is at least at version 0.0.17-1 or later to avoid this situation.
Use rescue mode when network connectivity is lost
If you have not been able to update the scaleway-ecosystem package prior to upgrading the OS, you may find yourself unable to connect to the Instance. To remediate this situation, apply the following steps.
When your Instance has lost network connectivity, rescue mode allows you to boot your Instance into a temporary operating system, running from the RAM of the Instance. Rescue mode is often used to diagnose and resolve issues such as faulty kernel configurations, networking issues, firewall configurations, and more.
-
Switch the Instance
boot-typetorescueand reboot your Instance into rescue mode using the CLI. Replace<Instance_ID>with the unique ID of your Instance, e.g.,0500ebd2-d70d-49af-a969-3ac09b6f7fff.Copyscw instance server stop <Instance_ID> # Wait for the instance to be stopped. scw instance server update <Instance_ID> boot-type=rescue scw instance server start <Instance_ID> -
Once the Instance is rebooted, log in to your Instance using SSH and set up the environment to be able to chroot into it:
Copycat /proc/partitions major minor #blocks name 7 0 65480 loop0 7 1 89120 loop1 7 2 39760 loop2 252 0 19531250 vda 252 1 19417569 vda1 252 14 4096 vda14 252 15 108544 vda15 8 0 9765625 sda 8 1 3240943 sda1 8 14 4096 sda14 8 15 108544 sda15Then mount the partitions and get into the
chroot:Copymount /dev/vda1 /mnt chroot /mnt -
Modify the
usr/bin/scw-vpc-ifup.netplanfile to apply the fix: add theumask 022command after theEoFmarker. After the modification, the file should look like this:Copy#!/bin/bash iface=$(basename ${1}) mkdir -p /run/netplan umask 077 rm -f /etc/netplan/60-$iface-vpc.yaml cat > /run/netplan/60-$iface-vpc.yaml << EoF network: version: 2 ethernets: $iface: dhcp4: true dhcp4-overrides: route-metric: 50 EoF umask 022 netplan apply -
Get out of the
chrootand remove the mounts:Copyumount /mnt -
Stop the Instance, switch back the Instance
boot_typetolocal, and reboot the Instance. Replace<Instance_ID>with the unique ID of your Instance, e.g.,0500ebd2-d70d-49af-a969-3ac09b6f7fff.Copyscw instance server stop <Instance_ID> # Wait for the instance to be stopped scw instance server update <Instance_ID> boot-type=local scw instance server start <Instance_ID>Once rebooted, your Instance will be reachable again.
-
Install the definitive correction.
The modified file is part of the
scaleway-ecosystempackage. A new package has been released with the correction so the newest package should be installed to ensure that a definitive fix is in place.Copyapt get update apt -y install scaleway-ecosystem