Skip to content

Durable mkdir using oras pull #1457

Closed as duplicate
Closed as duplicate

Description

@wfil-sym

What happened in your environment?

Error: failed to extract tar to C:\temp\org_platypus-hatchery: mkdir C:\temp\org_platypus-hatchery\dashboards\Inflation - US ZOO: NonAvian Data (Reptiles, Amphibians, etc): The directory name is invalid.

(There are two problems here, first are invalid characters, the colon, in the directory name. oras could possibly defensively escape the colon with something like whatever is used in html, whatever works. The second problem is a bit more fundamental, where the user will have used a descriptive long directory name in the original application, in this case Grafana. For me, it would be sufficient to address this second problem.)

What did you expect to happen?

orcas pull should have at least done
mkdir "C:\temp\org_platypus-hatchery\dashboards\Inflation - US ZOO NonAvian Data (Reptiles, Amphibians, etc)"
(put double quotes around the windows directory name and maybe remove invalid characters)
As for the other problem, the vendor Grafana has been informed.

How can we reproduce it?

orcas pull a registry containing

  • long directory names with spaces
  • names with invalid characters (done with grafana)

What is the version of your ORAS CLI?

C:\temp>oras version
Version: 1.2.0
Go version: go1.22.3
Git commit: dcef719
Git tree state: clean

What is your OS environment?

WIndows 10

Are you willing to submit PRs to fix it?

  • Yes, I am willing to fix it.

Activity

  1. added
    bug
    triage
    on Jul 25, 2024
  2. changed the title [-]Durable mkdir using orcas pull[/-] [+]Durable mkdir using oras pull[/+] on Jul 30, 2024
  3. shizhMSFT commented on Jul 30, 2024

    @shizhMSFT
    Contributor

    Linking #1159 as a potential workaround.

  4. shizhMSFT commented on Jul 30, 2024

    @shizhMSFT
    Contributor

    Tested with tar in Windows 11, invalid characters like : in the file name is converted to _ in windows.

  5. shizhMSFT commented on Jul 30, 2024

    @shizhMSFT
    Contributor

    Repo steps:
    On Linux with Bash:

    $ echo hello world > "hello: world"
    $ ls
    'hello: world'
    $ tar cf hello.tar hello\:\ world

    Copy hello.tar to Windows. On windows with PowerShell,

    > tar.exe xvf .\hello.tar
    x hello: world
    > dir
    
    
        Directory: D:\Test
    
    
    Mode                 LastWriteTime         Length Name
    ----                 -------------         ------ ----
    -a----         7/30/2024   1:53 PM          10240 hello.tar
    -a----         7/30/2024   1:52 PM             12 hello_ world
  6. FeynmanZhou commented on Jul 30, 2024

    @FeynmanZhou
    Member

    Linking #1159 as a potential workaround.

    @mushka-stara If ORAS allows to customize file/directory name in oras pull, will it resolve your issue?

  7. qweeah commented on Jul 30, 2024

    @qweeah
    Contributor

    It's hard to cover all edge cases for pathing, e.g. a Linux user may create a file named C:\Users\my\file and on windows it will always be parsed as absolute path. Rather than adding special handling for OS specific characters, I suggest 1) content producer should remove those characters before pushing via oras or 2) content consumer should utlize facilities like #1159 to customize pulled artifacts.

  8. added this to the future milestone on Jul 30, 2024
  9. added
    question
    duplicate
    and removed
    triage
    bug
    on Jul 30, 2024
  10. wfil-sym commented on Jul 30, 2024

    @wfil-sym
    Author

    @FeynmanZhou custom directory or file name would work well
    @shizhMSFT WIndows 11 name substitution with _ also good, easy to explain
    @qweeah in contact with contact producer, so far no answer.
    I have advised our users to use Linux for now, though our company is moving to more Windows 😢 for end-user computing
    Thanks very much for looking at the problem

  11. TerryHowe commented on Oct 22, 2026

    @TerryHowe
    Member

    Duplicate of #1159. Customizing the pulled file/directory name is the agreed way to handle names that are invalid on the local OS. Closing to track it there.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicatequestion

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions