glib warning on netplan-try with wrong config

Bug #1938263 reported by Alex
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Netplan
Triaged
Medium
Unassigned

Bug Description

Hello! Not sure if it is a bug or not, but:
While learning netplan, I've made a wrong config, then check it with netplan-try, and get the error below.

(generate:1255): GLib-WARNING **: 07:45:34.289: GError set over the top of a previous GError or uninitialized memory.
This indicates a bug in someone's code. You must ensure an error is NULL before it's set.
The overwriting error message was: /etc/netplan/00-installer-config.yaml:13:14: Error in network definition: unicast route must include both a 'to' and 'via' IP
             - to: 0.0.0.0/0
             ^
/etc/netplan/00-installer-config.yaml:17:21: Error in network definition: IP family mismatch in route to fe80::1
               via: fe80::1
                    ^
An error occurred: the configuration could not be generated
Reverting.
Warning: Stopping systemd-networkd.service, but it can still be activated by:
  systemd-networkd.socket

My config is (addresses were replaced):

network:
    version: 2
    renderer: networkd
    ethernets:
        eth0:
            addresses:
                - 192.46.XXX.XXX/24
                - 2a01:7e01:e001:23e:152c:a51c:beef:beer/64
            nameservers:
                addresses: [8.8.8.8, 1.1.1.1]
            routes:
             - to: 0.0.0.0/0
               via: 192.XXX.XXX.1
               metric: 100
             - to: 0.0.0.0/0
               via: fe80::1
               metric: 200

Revision history for this message
Alex (qw) wrote :

Oh, sorry, I've forgot to add the system info:
VPC
Linux localhost 5.4.0-80-generic #90-Ubuntu SMP Fri Jul 9 22:49:44 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

libnetplan0/focal-updates,now 0.102-0ubuntu1~20.04.2 amd64 [installed,automatic]
netplan.io/focal-updates,now 0.102-0ubuntu1~20.04.2 amd64 [installed,automatic]

Revision history for this message
Roman K (roman84) wrote :

It is a bug in error reporting. This netplan configuration is still incorrect.

Revision history for this message
Roman K (roman84) wrote :

I was trying to follow https://netplan.io/examples/ but it looks like the "default" key word cannot be used.

Linux srv2 5.4.0-81-generic #91-Ubuntu SMP Thu Jul 15 19:09:17 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

(generate:3732): GLib-WARNING **: 19:34:50.050: GError set over the top of a previous GError or uninitialized memory.
This indicates a bug in someone's code. You must ensure an error is NULL before it's set.
The overwriting error message was: /etc/netplan/00-installer-config.yaml:18:11: Error in network definition: unicast route must include both a 'to' and 'via' IP
          - to: default
          ^
/etc/netplan/00-installer-config.yaml:18:17: Error in network definition: invalid IP family '-1'
          - to: default
                ^

Revision history for this message
Lukas Märdian (slyon) wrote :

netplan try is saving you from applying a wrong config, as Roman already mentioned.

When defining an IP6 default route, you need to specify the IP6 default IP, i.e. use "::/0" instead of "0.0.0.0/0". This way your config (and netplan try) should work.

With the release of netplan v0.103 the "default" keyword was introduced, which will adopt the default route to either "0.0.0.0/0" (for IP4 routes) or "::/0" (for IP6 routes), but that is not yet available in all versions of Ubuntu.

Additionally, indeed you spotted a minor flaw in error reporting here, that should be fixed at some point: "GError set over the top of a previous GError or uninitialized memory."

Changed in netplan:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Alex (qw) wrote :

Lukas Märdian (slyon)

Additionally, indeed you spotted a minor flaw in error reporting here, that should be fixed at some point: "GError set over the top of a previous GError or uninitialized memory."

Sure, that was the one and only point of my report, the rest of netpaln-try output is correct. Thank you!

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.