Skip to content

Support collect - #1632

Draft
mattiaswal wants to merge 15 commits into
mainfrom
support-collect
Draft

mattiaswal wants to merge 15 commits into
mainfrom
support-collect

Conversation

@mattiaswal

Copy link
Copy Markdown
Contributor

Description

Checklist

Tick relevant boxes, this PR is-a or has-a:

  • Bugfix
    • Regression tests
    • ChangeLog updates (for next release)
  • Feature
    • YANG model change => revision updated?
    • Regression tests added?
    • ChangeLog updates (for next release)
    • Documentation added?
  • Test changes
    • Checked in changed Readme.adoc (make test-spec)
    • Added new test to group Readme.adoc and yaml file
  • Code style update (formatting, renaming)
  • Refactoring (please detail in commit messages)
  • Build related changes
  • Documentation content changes
    • ChangeLog updated (for major changes)
  • Other (please describe):

@mattiaswal
mattiaswal force-pushed the support-collect branch 2 times, most recently from 4381677 to f3fbfa2 Compare September 17, 2026 12:32
The support script was installed by the bin package, and its -p option
relied on gpg being in the image only as a side effect of podman pulling
in libgpgme.  Give it a package of its own with an encrypt option that
selects gnupg2, enabled in all non-minimal defconfigs, so the dependency
is explicit.  The WebUI calls the tool, so it selects the package.

Signed-off-by: Mattias Walström <lazzer@gmail.com>
One wedged command stalled the whole collection, and the EXIT trap
removed the log a failed run needed, which is why #1303 closed without a
root cause.  -o FILE writes the archive to a file so a dropped session
does not lose the only copy.

Signed-off-by: Mattias Walström <lazzer@gmail.com>
Lets clients that only speak the management protocol collect support
data.  Archives up to 16 MiB come back base64 encoded, larger ones stay
on the device, and the RPC is nacm:default-deny-all like install-bundle
since the archive carries password hashes and logs.

Signed-off-by: Mattias Walström <lazzer@gmail.com>
No transport could read an RPC reply, and ssh ran with LogLevel QUIET,
which turned a dead transport into a bare exit code 255.  That is why the
support_collect flake in #1303 never got a root cause.

Signed-off-by: Mattias Walström <lazzer@gmail.com>
Streaming the archive over ssh made a dead transport look like a failed
collection, and the collection.log fallback could never work since the
tool removes the file.

Signed-off-by: Mattias Walström <lazzer@gmail.com>
The status check in rpc_output() was dead code, so callers only saw the
status line.  The reason is in the body, which is how support_collect
tells a device without gpg from a real failure.

Signed-off-by: Mattias Walström <lazzer@gmail.com>
sysrepo raises it when the callback finishes after the caller's timeout
has expired, and the handler ran the whole collection a second time,
with confd blocked for the duration.

Signed-off-by: Mattias Walström <lazzer@gmail.com>
libxml2 refuses text nodes over 10 MB and netconf_client's receive
thread dies silently on the error, so a support-collect archive over
about 7.5 MB timed out after 120 s with no message at all.  That is
the failure on alder, where the logs at the end of a full run push the
archive past that.

Signed-off-by: Mattias Walström <lazzer@gmail.com>
libxml2 stops at 10 MB text nodes, so a stock lxml or ncclient cannot
receive an archive above about 7.5 MB without XML_PARSE_HUGE.

Signed-off-by: Mattias Walström <lazzer@gmail.com>
It was in gpg's argv, readable by any local process while the archive
was being written.  Hand it over on a private descriptor, give gpg a
throwaway home so its agent stays out of /root, and read the prompted
line verbatim.

Signed-off-by: Mattias Walström <lazzer@gmail.com>
The event session's user is confd's own, root, the NETCONF username
travels as originator data.  An oversized archive stays in its 0700
directory instead of under a predictable name in the shared /tmp,
cleanup is recursive, and a password with a line break is rejected
since the tool reads one line.

Signed-off-by: Mattias Walström <lazzer@gmail.com>
Any exception passed as denied, a login failure included, and a host
without gpg silently skipped the decrypt step.

Signed-off-by: Mattias Walström <lazzer@gmail.com>
Exports a datastore without its secrets, the way NACM filters them for
a user without read access.  The models already mark what is secret,
so new ones are covered as they come.  The user password in ietf-system
predates the convention and is matched by name.

Signed-off-by: Mattias Walström <lazzer@gmail.com>
Private keys, password hashes and RADIUS secrets are of no use to
support and a hazard in transit.  Export the datastores with copy -r
and drop the environment dump.  --no-redact keeps them, the RPC always
redacts.

Signed-off-by: Mattias Walström <lazzer@gmail.com>
This is tracked by #1614
when it is fixed, this test should be removed, but for now,
we hide the issue. No need to stop tests for this issue, that
is tracked but unplanned.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant