FutureWarning: Possible nested set at position 23

Bug #1816967 reported by Tommi Rantala
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fix Released
Dan Watkins

Bug Description

With Python 3.7 this FutureWarning is seen e.g. in VM serial console:

[ 4.321959] cloud-init[728]: /usr/lib/python3.7/site-packages/cloudinit/config/ FutureWarning: Possible nested set at position 23
[ 4.323230] cloud-init[728]: r'^(?P<proto>[@]{0,2})'

I think it's fixable by changing [[] to [\[] in the HOST_PORT_RE regex in

Related branches

Revision history for this message
Dan Watkins (oddbloke) wrote :

Hi Tommi,

Thanks for the bug report! I'm not seeing this in my logs when I launch Ubuntu disco (which has Python 3.7) images. Can you give me some concrete steps to reproduce this issue so we can be sure that any changes we might make will actually fix the issue you're seeing?


Changed in cloud-init:
status: New → Incomplete
Revision history for this message
Tommi Rantala (tt-rantala) wrote :


I can reproduce the warning by launching Ubuntu disco image with the following steps (in fedora 29).


cat >my-user-data <<EOF
password: passw0rd
chpasswd: { expire: False }
ssh_pwauth: True

echo "instance-id: $(uuidgen)" >my-meta-data
cloud-localds my-seed.img my-user-data my-meta-data

qemu-img create -f qcow2 -b disco-server-cloudimg-amd64.img my-disk.qcow2
qemu-system-x86_64 -nographic -enable-kvm -cdrom my-seed.img -hda my-disk.qcow2

The FutureWarning then seen in the VM serial console output:

[ 8.207739] cloud-init[364]: ci-info: +++++++++++++++++++Route IPv6 info+++++++++++++++++++
[ 8.212932] cloud-init[364]: ci-info: +-------+-------------+---------+-----------+-------+
[ 8.220609] cloud-init[364]: ci-info: | Route | Destination | Gateway | Interface | Flags |
[ 8.225923] cloud-init[364]: ci-info: +-------+-------------+---------+-----------+-------+
[ 8.231616] cloud-init[364]: ci-info: | 1 | fe80::/64 | :: | ens3 | U |
[ 8.238636] cloud-init[364]: ci-info: | 2 | fec0::/64 | :: | ens3 | Ue |
[ 8.244156] cloud-init[364]: ci-info: | 3 | ::/0 | fe80::2 | ens3 | UGe |
[ 8.247698] cloud-init[364]: ci-info: | 5 | local | :: | ens3 | U |
[ 8.252484] cloud-init[364]: ci-info: | 6 | ff00::/8 | :: | ens3 | U |
[ 8.255744] cloud-init[364]: ci-info: +-------+-------------+---------+-----------+-------+
[ 8.738562] cloud-init[364]: /usr/lib/python3/dist-packages/cloudinit/config/ FutureWarning: Possible nested set at position 23
[ 8.740304] cloud-init[364]: r'^(?P<proto>[@]{0,2})'
[ 8.741799] cloud-init[364]: Generating public/private rsa key pair.
[ 8.745423] cloud-init[364]: Your identification has been saved in /etc/ssh/ssh_host_rsa_key.
[ 8.748589] cloud-init[364]: Your public key has been saved in /etc/ssh/

Revision history for this message
Dan Watkins (oddbloke) wrote :

Thanks Tommi, I've been able to reproduce this now. (It turns out that launching a lxd container doesn't cause this to be emitted, but launching a cloud instance does.)

Revision history for this message
Dan Watkins (oddbloke) wrote :

Is this a fix that you would be interested in submitting as a merge proposal?

Changed in cloud-init:
status: Incomplete → Triaged
importance: Undecided → Low
Revision history for this message
Tommi Rantala (tt-rantala) wrote :

I didn't plan to submit the fix (I have not signed the Canonical CLA).
So feel free to fix this.

Dan Watkins (oddbloke)
Changed in cloud-init:
assignee: nobody → Dan Watkins (daniel-thewatkins)
status: Triaged → In Progress
Revision history for this message
Server Team CI bot (server-team-bot) wrote :

This bug is fixed with commit f0f09629 to cloud-init on branch master.
To view that commit see the following URL:

Changed in cloud-init:
status: In Progress → Fix Committed
Revision history for this message
Chad Smith (chad.smith) wrote : Fixed in cloud-init version 19.1.

This bug is believed to be fixed in cloud-init in version 19.1. If this is still a problem for you, please make a comment and set the state back to New

Thank you.

Changed in cloud-init:
status: Fix Committed → Fix Released
Revision history for this message
James Falcon (falcojr) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.