Page MenuHomeVyOS Platform

'show nat source translations ' fails with Python error
Closed, InvalidPublicBUG

Description

Symptoms

Output of show nat source translations:

[email protected]:~$ show nat source translations
Traceback (most recent call last):
  File "/usr/libexec/vyos/op_mode/show_nat_translations.py", line 200, in <module>
    main()
  File "/usr/libexec/vyos/op_mode/show_nat_translations.py", line 196, in main
    process(run(command(arg.type, arg.proto, arg.ipaddr)), arg.stats, arg.proto, arg.pipe, arg.verbose, arg.type)
  File "/usr/libexec/vyos/op_mode/show_nat_translations.py", line 106, in process
    rule_type = rule.get('type', '')
AttributeError: 'str' object has no attribute 'get'
Pre-NAT              Post-NAT             Prot  Timeout
[email protected]:~$

Output of show vershon:

`Version:          VyOS 1.3-rolling-202010080117
Release Train:    equuleus

Built by:         [email protected]
Built on:         Thu 08 Oct 2020 01:17 UTC
Build UUID:       89caac33-a7cf-4799-93cb-a86db73e3d47
Build Commit ID:  4ec212ad33c9c2

Architecture:     x86_64
Boot via:         installed image
System type:      VMware guest

Hardware vendor:  VMware, Inc.
Hardware model:   VMware Virtual Platform
Hardware S/N:     Unknown
Hardware UUID:    Unknown
`

Configuration of source NAT:

nat {
    source {
        rule 10 {
            outbound-interface eth0
            source {
                address 10.0.201.10
            }
            translation {
                address 198.51.100.84
            }
        }
        rule 20 {
            outbound-interface eth0
            source {
                address 10.0.201.11
            }
            translation {
                address 198.51.100.85
            }
        }
        rule 30 {
            outbound-interface eth0
            source {
                address 10.0.201.12
            }
            translation {
                address 198.51.100.86
            }
        }
        rule 40 {
            outbound-interface eth0
            source {
                address 10.0.201.13
            }
            translation {
                address 198.51.100.87
            }
        }
        rule 50 {
            outbound-interface eth0
            source {
                address 10.0.201.14
            }
            translation {
                address 198.51.100.88
            }
        }
        rule 60 {
            outbound-interface eth0
            source {
                address 10.0.201.15
            }
            translation {
                address 198.51.100.89
            }
        }
        rule 70 {
            outbound-interface eth0
            source {
                address 10.0.201.16
            }
            translation {
                address 198.51.100.90
            }
        }
        rule 80 {
            outbound-interface eth0
            source {
                address 10.0.201.17
            }
            translation {
                address 198.51.100.91
            }
        }
        rule 90 {
            outbound-interface eth0
            source {
                address 10.0.201.18
            }
            translation {
                address 198.51.100.92
            }
        }
        rule 100 {
            outbound-interface eth0
            source {
                address 10.0.201.19
            }
            translation {
                address 198.51.100.93
            }
        }
    }
}

Python traceback only occurs, when there are active translations. Otherwise command terminates without output.

Details

Difficulty level
Unknown (require assessment)
Version
1.3-rolling-202010080117
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Bug (incorrect behavior)

Event Timeline

erkin renamed this task from 'show nat source translations ' with traceback on VyOS 1.3-rolling-202010080117 to 'show nat source translations ' fails with Python error.Aug 29 2021, 12:41 PM
erkin set Issue type to Bug (incorrect behavior).
erkin removed a subscriber: Active contributors.