Page MenuHomeVyOS Platform

new rolling release vbash breaks vyps.vyos TerminalModule parsing
Confirmed, NormalPublicBUG

Description

On rolling, vbash runs with readline enable-bracketed-paste on. This adds escape sequences around every command:

ESC[?2004l after every command echo

ESC[?2004h before every prompt

The terminal plugins in vyos.vyos and ansible.netcommon do not strip these sequences. The first line of vyos_command stdout is [?2004l, which causes:

JSON output fails to parse

empty output is treated as non-empty

some prompts are not recognised

Details

Version
6.2.0
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Bug (incorrect behavior)

Event Timeline

---
- name: Sample VyOS Ansible operation
  hosts: vyos_lab
  gather_facts: false
  tasks:
    - vyos.vyos.vyos_command:
        commands:
          - show configuration json | no-more
      register: out
    - debug: var=out.stdout_lines
    - assert:
        that:
          - "'2004' not in (out.stdout | join)"
          - out.stdout[2] | length == 0

gives error

((.venv129) ) $ ansible-playbook -i hosts -l vyos150:vyos150f vyos-vbash.yaml -v
Using /home/d368409/work/work12.vyos/lab/ansible/ansible.cfg as config file

PLAY [Sample VyOS Ansible operation] *****************************************************************************************************************************************************************

TASK [vyos.vyos.vyos_command] ************************************************************************************************************************************************************************
[WARNING]: Deprecation warnings can be disabled by setting `deprecation_warnings=False` in ansible.cfg.
[DEPRECATION WARNING]: Passing `warnings` to `exit_json` or `fail_json` is deprecated. This feature will be removed from ansible-core version 2.23. Use `AnsibleModule.warn` instead.
ok: [vyos150] => {"changed": false, "stdout": ["Version:          VyOS 1.5.0\nRelease train:    circinus\nRelease flavor:   kvm\n\nBuilt by:         VyOS Inc.\nBuilt on:         Mon 30 Mar 2026 15:13 UTC\nBuild UUID:       8fc890cf-a392-4c1b-a7a2-700d311cd0c7\nBuild commit ID:  cb47cdb72c6d08\n\nArchitecture:     x86_64\nBoot via:         installed image\nSystem type:      KVM guest\n\nHardware vendor:  QEMU\nHardware model:   Standard PC (Q35 + ICH9, 2009)\nHardware S/N:     \nHardware UUID:    898ffc49-5620-45bf-bdb4-7f11759ba7cc\n\nCopyright:        VyOS maintainers and contributors", "{\"interfaces\": {\"ethernet\": {\"eth0\": {\"address\": [\"dhcp\"], \"hw-id\": \"52:54:00:db:8e:b6\"}, \"eth1\": {\"hw-id\": \"52:54:00:24:b7:54\"}, \"eth2\": {\"hw-id\": \"52:54:00:ec:8a:ce\"}}, \"loopback\": {\"lo\": {}}}, \"service\": {\"https\": {\"api\": {\"keys\": {\"id\": {\"MY-HTTPS-API-ID\": {\"key\": \"vyos123\"}}}, \"rest\": {}}}, \"ntp\": {\"allow-client\": {\"address\": [\"127.0.0.0/8\", \"169.254.0.0/16\", \"10.0.0.0/8\", \"172.16.0.0/12\", \"192.168.0.0/16\", \"::1/128\", \"fe80::/10\", \"fc00::/7\"]}, \"server\": {\"time1.vyos.net\": {}, \"time2.vyos.net\": {}, \"ti e3.vyos.net\": {}}}, \"ssh\": {}}, \"system\": {\"config-management\": {\"commit-revisions\": \"100\"}, \"console\": {\"device\": {\"ttyS0\": {\"speed\": \"115200\"}}}, \"host-name\": \"vyos\", \"login\": {\"user\": {\"vyos\": {\"authentication\": {\"encrypted-password\": \"$6$QxPS.uk6mfo$9QBSo8u1FkH16gMyAVhus6fU3LOzvLR9Z9.82m3tiHFAxTtIkhaZSWssSgzt4v4dGAL8rhVQxTg0oAG9/q11h/\", \"plaintext-password\": \"\"}}}}, \"option\": {\"reboot-on-upgrade-failure\": \"5\"}, \"syslog\": {\"local\": {\"facility\": {\"all\": {\"level\": \"info\"}, \"local7\": {\"level\": \"debug\"}}}}}", ""], "stdout_lines": [["Version:          VyOS 1.5.0", "Release train:    circinus", "Release flavor:   kvm", "", "Built by:         VyOS Inc.", "Built on:         Mon 30 Mar 2026 15:13 UTC", "Build UUID:       8fc890cf-a392-4c1b-a7a2-700d311cd0c7", "Build commit ID:  cb47cdb72c6d08", "", "Architecture:     x86_64", "Boot via:         installed image", "System type:      KVM guest", "", "Hardware vendor:  QEMU", "Hardware model:   Standard PC (Q35 + ICH9, 2009)", "Hardware S/N:     ", "Hardware UUID:    898ffc49-5620-45bf-bdb4-7f11759ba7cc", "", "Copyright:        VyOS maintainers and contributors"], ["{\"interfaces\": {\"ethernet\": {\"eth0\": {\"address\": [\"dhcp\"], \"hw-id\": \"52:54:00:db:8e:b6\"}, \"eth1\": {\"hw-id\": \"52:54:00:24:b7:54\"}, \"eth2\": {\"hw-id\": \"52:54:00:ec:8a:ce\"}}, \"loopback\": {\"lo\": {}}}, \"service\": {\"https\": {\"api\": {\"keys\": {\"id\": {\"MY-HTTPS-API-ID\": {\"key\": \"vyos123\"}}}, \"rest\": {}}}, \"ntp\": {\"allow-client\": {\"address\": [\"127.0.0.0/8\", \"169.254.0.0/16\", \"10.0.0.0/8\", \"172.16.0.0/12\", \"192.168.0.0/16\", \"::1/128\", \"fe80::/10\", \"fc00::/7\"]}, \"server\": {\"time1.vyos.net\": {}, \"time2.vyos.net\": {}, \"ti e3.vyos.net\": {}}}, \"ssh\": {}}, \"system\": {\"config-management\": {\"commit-revisions\": \"100\"}, \"console\": {\"device\": {\"ttyS0\": {\"speed\": \"115200\"}}}, \"host-name\": \"vyos\", \"login\": {\"user\": {\"vyos\": {\"authentication\": {\"encrypted-password\": \"$6$QxPS.uk6mfo$9QBSo8u1FkH16gMyAVhus6fU3LOzvLR9Z9.82m3tiHFAxTtIkhaZSWssSgzt4v4dGAL8rhVQxTg0oAG9/q11h/\", \"plaintext-password\": \"\"}}}}, \"option\": {\"reboot-on-upgrade-failure\": \"5\"}, \"syslog\": {\"local\": {\"facility\": {\"all\": {\"level\": \"info\"}, \"local7\": {\"level\": \"debug\"}}}}}"], [""]]}
ok: [vyos150f] => {"changed": false, "stdout": ["\u001b[?2004l\n\nVersion:          VyOS 999.202609232109\nRelease train:    rolling\nRelease flavor:   generic\n\nBuilt by:         root@5c6f33deda03\nBuilt on:         Wed 23 Sep 2026 21:09 UTC\nBuild UUID:       79c1218a-a160-471f-be34-5457df2f902d\nBuild commit ID:  \n\nArchitecture:     x86_64\nBoot via:         installed image\nSystem type:      KVM guest\nSecure Boot:      n/a (BIOS)\n\nHardware vendor:  QEMU\nHardware model:   Standard PC (Q35 + ICH9, 2009)\nHardware S/N:     \nHardware UUID:    d2e36f3b-6d62-42a9-a96d-5ed80b1d22be\n\nCopyright:        VyOS maintainers and contributors", "\u001b[?2004l\n\n{\"interfaces\": {\"ethernet\": {\"eth0\": {\"address\": [\"dhcp\"], \"hw-id\": \"52:54:00:23:2b:f5\", \"offload\": {\"gro\": {}, \"gso\": {}, \"sg\": {}, \"tso\": {}}}, \"eth1\": {\"hw-id\": \"52:54:00:58:d3:75\"}, \"eth2\": {\"hw-id\": \"52:54:00:92:2d:c4\"}}, \"loopback\": {\"lo\": {}}}, \"service\": {\"ntp\": {\"allow-client\": {\"address\": [\"127.0.0.0/8\", \"169.254.0.0/16\", \"10.0.0.0/8\", \"172.16.0.0/12\", \"192.168.0.0/16\", \"::1/128\", \"fe80::/10\", \"fc00::/7\"]}, \"server\": {\"time1.vyos.net\": {}, \"time2.vyos.net\": {}, \"time3.vyos.net\": {}}}, \"ssh\": {}},  system\": {\"config-management\": {\"commit-revisions\": \"100\"}, \"console\": {\"device\": {\"ttyS0\": {\"speed\": \"115200\"}}}, \"host-name\": \"vyos\", \"login\": {\"operator-group\": {\"default\": {\"command-policy\": {\"allow\": [\"*\"]}}}, \"user\": {\"vyos\": {\"authentication\": {\"encrypted-password\": \"$6$rounds=656000$q0FD5MJaMRm87nr5$gkuCFtura8g2v.rB5ZV5nge16mfFWprmMztJ93NhMit9oiz3/UBX2C6xQLGmHdFPORbZUjIZixjU4EW8Z8iWM.\", \"plaintext-password\": \"\"}}}}, \"option\": {\"reboot-on-upgrade-failure\": \"5\"}, \"syslog\": {\"local\": {\"facility\": {\"al \": {\"level\": \"info\"}, \"local7\": {\"level\": \"debug\"}}}}}}", "\u001b[?2004l"], "stdout_lines": [["\u001b[?2004l", "", "Version:          VyOS 999.202609232109", "Release train:    rolling", "Release flavor:   generic", "", "Built by:         root@5c6f33deda03", "Built on:         Wed 23 Sep 2026 21:09 UTC", "Build UUID:       79c1218a-a160-471f-be34-5457df2f902d", "Build commit ID:  ", "", "Architecture:     x86_64", "Boot via:         installed image", "System type:      KVM guest", "Secure Boot:      n/a (BIOS)", "", "Hardware vendor:  QEMU", "Hardware model:   Standard PC (Q35 + ICH9, 2009)", "Hardware S/N:     ", "Hardware UUID:    d2e36f3b-6d62-42a9-a96d-5ed80b1d22be", "", "Copyright:        VyOS maintainers and contributors"], ["\u001b[?2004l", "", "{\"interfaces\": {\"ethernet\": {\"eth0\": {\"address\": [\"dhcp\"], \"hw-id\": \"52:54:00:23:2b:f5\", \"offload\": {\"gro\": {}, \"gso\": {}, \"sg\": {}, \"tso\": {}}},\"eth1\": {\"hw-id\": \"52:54:00:58:d3:75\"}, \"eth2\": {\"hw-id\": \"52:54:00:92:2d:c4\"}}, \"loopback\": {\"lo\": {}}}, \"service\": {\"ntp\": {\"allow-client\": {\"address\": [\"127.0.0.0/8\", \"169.254.0.0/16\", \"10.0.0.0/8\", \"172.16.0.0/12\", \"192.168.0.0/16\", \"::1/128\", \"fe80::/10\", \"fc00::/7\"]}, \"server\": {\"time1.vyos.net\": {}, \"time2.vyos.net\": {}, \"time3.vyos.net\":{}}}, \"ssh\": {}},  system\": {\"config-management\": {\"commit-revisions\": \"100\"}, \"console\": {\"device\": {\"ttyS0\": {\"speed\": \"115200\"}}}, \"host-name\": \"vyos\", \"login\": {\"operator-group\": {\"default\": {\"command-policy\": {\"allow\": [\"*\"]}}}, \"user\": {\"vyos\": {\"authentication\": {\"encrypted-password\": \"$6$rounds=656000$q0FD5MJaMRm87nr5$gkuCFtura8g2v.rB5ZV5nge16mfFWprmMztJ93NhMit9oiz3/UBX2C6xQLGmHdFPORbZUjIZixjU4EW8Z8iWM.\", \"plaintext-password\": \"\"}}}}, \"option\": {\"reboot-on-upgrade-failure\": \"5\"}, \"syslog\": {\"local\": {\"facility\": {\"al \": {\"level\": \"info\"}, \"local7\": {\"level\": \"debug\"}}}}}}"], ["\u001b[?2004l"]]}

TASK [debug] *****************************************************************************************************************************************************************************************
ok: [vyos150] => {
    "out.stdout_lines": [
        [
            "Version:          VyOS 1.5.0",
            "Release train:    circinus",
            "Release flavor:   kvm",
            "",
            "Built by:         VyOS Inc.",
            "Built on:         Mon 30 Mar 2026 15:13 UTC",
            "Build UUID:       8fc890cf-a392-4c1b-a7a2-700d311cd0c7",
            "Build commit ID:  cb47cdb72c6d08",
            "",
            "Architecture:     x86_64",
            "Boot via:         installed image",
            "System type:      KVM guest",
            "",
            "Hardware vendor:  QEMU",
            "Hardware model:   Standard PC (Q35 + ICH9, 2009)",
            "Hardware S/N:     ",
            "Hardware UUID:    898ffc49-5620-45bf-bdb4-7f11759ba7cc",
            "",
            "Copyright:        VyOS maintainers and contributors"
        ],
        [
            "{\"interfaces\": {\"ethernet\": {\"eth0\": {\"address\": [\"dhcp\"], \"hw-id\": \"52:54:00:db:8e:b6\"}, \"eth1\": {\"hw-id\": \"52:54:00:24:b7:54\"}, \"eth2\": {\"hw-id\": \"52:54:00:ec:8a:ce\"}}, \"loopback\": {\"lo\": {}}}, \"service\": {\"https\": {\"api\": {\"keys\": {\"id\": {\"MY-HTTPS-API-ID\": {\"key\": \"vyos123\"}}}, \"rest\": {}}}, \"ntp\": {\"allow-client\": {\"address\": [\"127.0.0.0/8\", \"169.254.0.0/16\", \"10.0.0.0/8\", \"172.16.0.0/12\", \"192.168.0.0/16\", \"::1/128\", \"fe80::/10\", \"fc00::/7\"]}, \"server\": {\"time1.vyos.net\": {}, \"time2.vyos.net\":{}, \"ti e3.vyos.net\": {}}}, \"ssh\": {}}, \"system\": {\"config-management\": {\"commit-revisions\": \"100\"}, \"console\": {\"device\": {\"ttyS0\": {\"speed\": \"115200\"}}}, \"host-name\": \"vyos\", \"login\": {\"user\": {\"vyos\": {\"authentication\": {\"encrypted-password\": \"$6$QxPS.uk6mfo$9QBSo8u1FkH16gMyAVhus6fU3LOzvLR9Z9.82m3tiHFAxTtIkhaZSWssSgzt4v4dGAL8rhVQxTg0oAG9/q11h/\", \"plaintext-password\": \"\"}}}}, \"option\": {\"reboot-on-upgrade-failure\": \"5\"}, \"syslog\": {\"local\": {\"facility\": {\"all\": {\"level\": \"info\"}, \"local7\": {\"level\": \"debug\"}}}}}"
        ],
        [
            ""
        ]
    ]
}
ok: [vyos150f] => {
    "out.stdout_lines": [
        [
            "\u001b[?2004l",
            "",
            "Version:          VyOS 999.202609232109",
            "Release train:    rolling",
            "Release flavor:   generic",
            "",
            "Built by:         root@5c6f33deda03",
            "Built on:         Wed 23 Sep 2026 21:09 UTC",
            "Build UUID:       79c1218a-a160-471f-be34-5457df2f902d",
            "Build commit ID:  ",
            "",
            "Architecture:     x86_64",
            "Boot via:         installed image",
            "System type:      KVM guest",
            "Secure Boot:      n/a (BIOS)",
            "",
            "Hardware vendor:  QEMU",
            "Hardware model:   Standard PC (Q35 + ICH9, 2009)",
            "Hardware S/N:     ",
            "Hardware UUID:    d2e36f3b-6d62-42a9-a96d-5ed80b1d22be",
            "",
            "Copyright:        VyOS maintainers and contributors"
        ],
        [
            "\u001b[?2004l",
            "",
            "{\"interfaces\": {\"ethernet\": {\"eth0\": {\"address\": [\"dhcp\"], \"hw-id\": \"52:54:00:23:2b:f5\", \"offload\": {\"gro\": {}, \"gso\": {}, \"sg\": {}, \"tso\": {}}}, \"eth1\": {\"hw-id\": \"52:54:00:58:d3:75\"}, \"eth2\": {\"hw-id\": \"52:54:00:92:2d:c4\"}}, \"loopback\": {\"lo\": {}}}, \"service\": {\"ntp\": {\"allow-client\": {\"address\": [\"127.0.0.0/8\", \"169.254.0.0/16\", \"10.0.0.0/8\", \"172.16.0.0/12\", \"192.168.0.0/16\", \"::1/128\", \"fe80::/10\", \"fc00::/7\"]}, \"server\": {\"time1.vyos.net\": {}, \"time2.vyos.net\": {}, \"time3.vyos.net\": {}}}, \"ssh\":{}},  system\": {\"config-management\": {\"commit-revisions\": \"100\"}, \"console\": {\"device\": {\"ttyS0\": {\"speed\": \"115200\"}}}, \"host-name\": \"vyos\", \"login\": {\"operator-group\": {\"default\": {\"command-policy\": {\"allow\": [\"*\"]}}}, \"user\": {\"vyos\": {\"authentication\": {\"encrypted-password\": \"$6$rounds=656000$q0FD5MJaMRm87nr5$gkuCFtura8g2v.rB5ZV5nge16mfFWprmMztJ93NhMit9oiz3/UBX2C6xQLGmHdFPORbZUjIZixjU4EW8Z8iWM.\", \"plaintext-password\": \"\"}}}}, \"option\": {\"reboot-on-upgrade-failure\": \"5\"}, \"syslog\": {\"local\": {\"facility\": {\"al \": {\"level\":\"info\"}, \"local7\": {\"level\": \"debug\"}}}}}}"
        ],
        [
            "\u001b[?2004l"
        ]
    ]
}

TASK [assert] ****************************************************************************************************************************************************************************************
[ERROR]: Task failed: Action failed: Assertion failed
Origin: /home/d368409/work/work12.vyos/lab/ansible/vyos-vbash.yaml:13:7

11       register: out
12     - debug: var=out.stdout_lines
13     - assert:
         ^ column 7

fatal: [vyos150f]: FAILED! => {
    "assertion": "'2004' not in (out.stdout | join)",
    "changed": false,
    "evaluated_to": false,
    "msg": "Assertion failed"
}
ok: [vyos150] => {
    "changed": false,
    "msg": "All assertions passed"
}

PLAY RECAP *******************************************************************************************************************************************************************************************
vyos150                    : ok=3    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
vyos150f                   : ok=2    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0

2004 appears on rolling only, and the JSON corruption appears on both. I’ve now measured where that corruption sits, using your two outputs with the API key masked:

JSON length corrupted char index (0-based) original → got

JSON length corrupted char index (0-based) original → got

1.5.0 LTS 1024 512 m → space
rolling 1080 512 " → space
rolling 1080 1024 l → space |

The corruption is exactly at multiples of 512, which matches the set terminal width 512 the vyos terminal plugin sends in on_open_shell. The first character of each wrapped line is replaced by a space, and the total length stays the same.

Most likely mechanism

At the right margin, the terminal driver or pager emits space, backspace, real char (" \x08X") to force the wrap. TerminalBase.ansi_re contains \x08., which deletes the backspace together with the following character. That leaves the space and loses the real character, which is exactly the pattern above. Because vyos.py builds TerminalBase.ansi_re + [...], the base \x08. runs before anything vyos adds

evgmol changed the task status from Open to Confirmed.Sun, Oct 25, 10:05 PM
Viacheslav triaged this task as Normal priority.