Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Snapshot creation fails with very long description #5843

Open
Tracked by #5971
mook-as opened this issue Oct 26, 2023 · 2 comments
Open
Tracked by #5971

Snapshot creation fails with very long description #5843

mook-as opened this issue Oct 26, 2023 · 2 comments

Comments

@mook-as
Copy link
Contributor

mook-as commented Oct 26, 2023

Actual Behavior

When a snapshot is created with a very long description, the operation fails. When done from the UI, it fails to parse the returned error.

Steps to Reproduce

  1. Run perl -e 'print "a" x 32768' and put the result in the clipboard.
  2. Create a snapshot in the UI, using the copied (32KB) text as the description.

Result

snapshot error dialog

Expected Behavior

The snapshot should be successfully created.

Additional Information

I could not duplicate this issue on macOS.

Running this on Windows (PowerShell) shows:

> rdctl snapshot create snap2 --description "$("a" * 32768)" --json
Program 'rdctl.exe' failed to run: The filename or extension is too longAt line:1 char:1
+ rdctl snapshot create snap2 --description "$("a" * 32768)" --json
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.
At line:1 char:46
+ rdctl snapshot create snap2 --description "$("a" * 32768)" --json
+                                              ~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (:) [], ApplicationFailedException
    + FullyQualifiedErrorId : NativeCommandFailed

So it's possible this has to do with maximum command line length.

Rancher Desktop Version

1.10.0-566-g9034e36d (1.11 RC1)

Rancher Desktop K8s Version

N/A

Which container engine are you using?

containerd (nerdctl)

What operating system are you using?

Windows

Operating System / Build Version

Windows 11 Pro 22H2 (Build 22621.2428)

What CPU architecture are you using?

x64

Linux only: what package format did you use to install Rancher Desktop?

None

Windows User Only

None.

@jandubois
Copy link
Member

jandubois commented Oct 26, 2023

So it's possible this has to do with maximum command line length.

Yes, this is a limitation of the CreateProcess API:

[in, out, optional] lpCommandLine

The command line to be executed.

The maximum length of this string is 32,767 characters, including the Unicode terminating null character.

I think we should add a --description-from-stdin option as an alternative to providing it via the commandline.

@jandubois
Copy link
Member

I think we should add a --description-from-stdin option as an alternative to providing it via the commandline.

This will be done by #5881, so the app should make use of it once it becomes available.

@gaktive gaktive modified the milestones: 1.12, 1.13 Nov 15, 2023
@gaktive gaktive removed this from the 1.13 milestone Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants