Skip to content

common/version: strip trailing newline from vendor release file - #68111

Merged
Naveenaidu merged 1 commit into
ceph:mainfrom
Naveenaidu:wip-naveen-strip-vendor-release-newline
Apr 7, 2026
Merged

Naveenaidu merged 1 commit into
ceph:mainfrom
Naveenaidu:wip-naveen-strip-vendor-release-newline

Conversation

@Naveenaidu

@Naveenaidu Naveenaidu commented Mar 30, 2026 •

Copy link
Copy Markdown
Contributor

Closes: https://tracker.ceph.com/issues/75802

read_vendor_release_file() reads /etc/ceph_version which may have a trailing newline, causing ceph version -f json to produce invalid JSON output. Strip trailing \n and \r characters before returning the content.

 > ceph versions -f json | jq    
parse error: Invalid string: control characters from U+0000 through U+001F must be escaped at line 3, column 1
> ceph versions -f json | cat -A
{"mon":{"ceph version 20.2.1-115.el9cp (5d4ea10f129b94db1b3b02d14189990b87cf2e1a) tentacle (stable - RelWithDebInfo) release 9.1.0$
":3},"mgr":{"ceph version 20.2.1-115.el9cp (5d4ea10f129b94db1b3b02d14189990b87cf2e1a) tentacle (stable - RelWithDebInfo) release 9.1.0$
":3},"osd":{"ceph version 20.2.1-115.el9cp (5d4ea10f129b94db1b3b02d14189990b87cf2e1a) tentacle (stable - RelWithDebInfo) release 9.1.0$
":24},"mds":{"ceph version 20.2.1-115.el9cp (5d4ea10f129b94db1b3b02d14189990b87cf2e1a) tentacle (stable - RelWithDebInfo) release 9.1.0$
":3},"rgw":{"ceph version 20.2.1-115.el9cp (5d4ea10f129b94db1b3b02d14189990b87cf2e1a) tentacle (stable - RelWithDebInfo) release 9.1.0$
":3},"overall":{"ceph version 20.2.1-115.el9cp (5d4ea10f129b94db1b3b02d14189990b87cf2e1a) tentacle (stable - RelWithDebInfo) release 9.1.0$

The bug got introduced in this commit: 541439b

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

read_vendor_release_file() reads /etc/ceph_version which may have a
trailing newline, causing "ceph version" to produce invalid JSON output.
Strip trailing \n and \r characters before returning the content.

Signed-off-by: Naveen Naidu <[email protected]>
@Naveenaidu Naveenaidu self-assigned this Mar 30, 2026
@Naveenaidu
Naveenaidu requested a review from bill-scales March 30, 2026 16:32
@Naveenaidu

Copy link
Copy Markdown
Contributor Author

jenkins test api

@Naveenaidu

Copy link
Copy Markdown
Contributor Author

jenkins test make check arm64

@Naveenaidu

Copy link
Copy Markdown
Contributor Author

@Naveenaidu
Naveenaidu merged commit 047d3ee into ceph:main Apr 7, 2026
20 of 26 checks passed
@Naveenaidu

Naveenaidu commented Apr 8, 2026 •

Copy link
Copy Markdown
Contributor Author

The commit has been cherry-picked into an existing tentacle backport PR: #67693, because this fixes the issue caused by the previous change.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants