Skip to content

exception <(22, 'Invalid argument')> in source localhost when creating interface #890

Closed
@sirkrypt0

Description

@sirkrypt0

Hi,

since version 0.6.8 when creating an interface, I sometimes get the following log output:

2022-03-28 13:43:13,526 WARNING [pr2modules.ndb.main] unsupported event ignored: <class 'pr2modules.netlink.nlmsg'>
2022-03-28 13:43:13,526    ERROR pyroute2.ndb.140652981319136.main: exception <(22, 'Invalid argument')> in source localhost
2022-03-28 13:43:13,526 ERROR [pyroute2.ndb.140652981319136.main] exception <(22, 'Invalid argument')> in source localhost

While the interface seems to be created correctly, I'm wondering whether this behavior is desired or rather some bug.

Repeatedly run the following script until you get the error message, which on my machine takes on average no more than 10 runs.

import logging
import pyroute2

def main():
    IFACE = 'test-br'
    logging.basicConfig(format='%(asctime)s %(levelname)s [%(name)s] %(message)s', level='DEBUG')

    ndb = pyroute2.NDB(log='on')
    interface = ndb.interfaces.create(ifname=IFACE, kind='bridge')
    interface.set('state', 'up')
    interface.commit()

    input('Press any key to tear down')

    interface.set('state', 'down')
    interface.commit()
    with pyroute2.IPRoute() as ipr:
        ipr.link('delete', ifname=IFACE)
    ndb.close()

if __name__ == '__main__':
    main()

Tested this on the Ubuntu 5.13.0-37-generic and 5.15.28-1-MANJARO kernels.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions