Page MenuHomeVyOS Platform

ISIS: error when loading config from file
Closed, ResolvedPublicBUG

Description

Replacing or merging configuration files with IS-IS configuration causes an
error in IS-IS 0-to-1 migration script (/opt/vyatta/etc/config-migrate/migrate/isis/0-to-1).

/tmp/test_isis.conf

interfaces {
  loopback lo {
  }
}
protocols {
  isis {
    interface lo {
    }
    net 49.0001.0000.0000.0001.00
  }
}
jvoss@vyos# merge /tmp/test_isis.conf

Migration script error: /opt/vyatta/etc/config-migrate/migrate/isis/0-to-1: [Errno 1] failed to run command: ['/opt/vyatta/etc/config-migrate/migrate/isis/0-to-1', '/tmp/tmpd0jll6fb']
returned: 
exit code: 1.
[edit]

Further investigation shows the following error in the migration script:

root@vyos:/home/jvoss# /opt/vyatta/etc/config-migrate/migrate/isis/0-to-1 /tmp/test_isis.conf
Traceback (most recent call last):
  File "/opt/vyatta/etc/config-migrate/migrate/isis/0-to-1", line 45, in <module>
    config.copy(isis_base, tmp_base)
  File "/usr/lib/python3/dist-packages/vyos/configtree.py", line 255, in copy
    raise ConfigTreeError(msg)
vyos.configtree.ConfigTreeError: Non-existent path 'protocols isis interface net'

Setting isis_base to 'protocols isis' plus additional nodes in the configuration results the configuration path
being 'protocols isis interface net':

https://github.com/vyos/vyos-1x/blob/55d6c5749e85fe6d4b771bcdf09fffdd6d6ecb92/src/migration-scripts/isis/0-to-1#L41C12-L41C12

# Only one IS-IS process is supported, thus this operation is save
isis_base = base + config.list_nodes(base)

Keeping the base of only 'protocols isis' resolves this issue and allows the config merge to complete
correctly and successfully:

# After proposed changes

jvoss@vyos# merge /tmp/test_isis.conf
Merge complete. Use 'commit' to make changes effective.
[edit]

jvoss@vyos# compare
[protocols]
+ isis {
+     interface     lo { }
+     net "49.0001.0000.0000.0001.00"
+ }

[edit]

jvoss@vyos# commit
[edit]

jvoss@vyos:~$ show isis interface 
Area VyOS:
  Interface   CircId   State    Type     Level
  lo          0x0      Up       loopback L1L2

Details

Difficulty level
Easy (less than an hour)
Version
vyos-1.4-rolling-202306260317-amd64
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Perfectly compatible
Issue type
Bug (incorrect behavior)

Event Timeline

jvoss changed the task status from Open to In progress.Jul 3 2023, 2:54 PM
jvoss claimed this task.
Viacheslav changed the task status from In progress to Needs testing.Jul 4 2023, 9:22 AM
Viacheslav moved this task from Need Triage to Finished on the VyOS 1.4 Sagitta board.