Skip to content

Conversation

@papertigers
Copy link
Contributor

@papertigers papertigers commented Nov 13, 2025

I noticed we were unable to save a support bundle when passing an output location.

root@oxz_switch1:~# omdb nexus support-bundles list
note: Nexus URL not specified.  Will pick one from DNS.
note: using DNS server for subnet fd00:1122:3344::/48
note: (if this is not right, use --dns-server to specify an alternate DNS server)
note: using Nexus URL http://[fd00:1122:3344:102::5]:12232
ID                                   TIME_CREATED                   REASON_FOR_CREATION     REASON_FOR_FAILURE STATE  USER_COMMENT
e3adf9b8-f16a-4d89-b8c9-d1de6e888b89 2025-11-12 16:38:21.171665 UTC Created by internal API -                  Active -


root@oxz_switch1:~# omdb nexus support-bundles download -o /root/support-bundle.zip e3adf9b8-f16a-4d89-b8c9-d1de6e888b89
note: Nexus URL not specified.  Will pick one from DNS.
note: using DNS server for subnet fd00:1122:3344::/48
note: (if this is not right, use --dns-server to specify an alternate DNS server)
note: using Nexus URL http://[fd00:1122:3344:102::5]:12232
Error: Invalid argument (os error 22)

I spent some time with DTrace and truss but I couldn't find any calls to open(2) where an actual EINVAL was being returned. After some further inspection it turns out Rust is making up this EINVAL on it's own rather then passing the open flags to the open(2) call.

    fn get_creation_mode(&self) -> io::Result<c_int> {
        match (self.write, self.append) {
            (true, false) => {}
            (false, false) => {
                if self.truncate || self.create || self.create_new {
                    return Err(Error::from_raw_os_error(libc::EINVAL));
                }
            }
            (_, true) => {
                if self.truncate && !self.create_new {
                    return Err(Error::from_raw_os_error(libc::EINVAL));
                }
            }
        }

Created using jj-spr 1.3.6-beta.1
Copy link
Contributor

@wfchandler wfchandler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch, thanks!

@papertigers papertigers merged commit 5060045 into main Nov 14, 2025
16 checks passed
@papertigers papertigers deleted the spr/papertigers/fix-omdb-support-bundles-download-output branch November 14, 2025 17:20
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.

4 participants