Skip to content

[BUG] Files with Special Characters in Store Cause copy and serve registry to Fail #411

@TLASLRDOPSTEAM

Description

@TLASLRDOPSTEAM

Environmental Info:

Hauler Version:

  • 1.1.1

Describe the Bug:

  • Files added to the store with names starting with a special character cause failures when using the hauler store copy command to transfer them to a registry or when serving the registry with hauler store serve registry.

Steps to Reproduce:

  • Create a directory and add a file with a special character in its name:
mkdir app
echo "commit: $GIT_COMMIT" > app/.metadata
hauler store add file app/.metadata 

Check store contents:

hauler store info

Output:

+-----------------------------------+-------+-------------+----------+---------+
| REFERENCE                         | TYPE  | PLATFORM    | # LAYERS | SIZE    |
+-----------------------------------+-------+-------------+----------+---------+
| hauler/.metadata:latest           | file  | -           |        1 | 21 B    |
| install/local/registry.tar:latest | file  | -           |        1 | 26.0 MB |
| library/registry:2.8.3            | image | linux/amd64 |        5 | 10.1 MB |
|                                   | sigs  | -           |        2 | 609 B   |
+-----------------------------------+-------+-------------+----------+---------+
|                                                            TOTAL   | 36.1 MB |
+-----------------------------------+-------+-------------+----------+---------+

Attempt to copy the store to a registry:

hauler store copy registry://registry.lab.local:5000

Output:

2025-02-04 21:16:19 INF hauler/.metadata:latest
2025-02-04 21:16:19 ERR Error: remote write: POST https://registry.lab.local:5000/v2/hauler/.metadata/blobs/uploads/: unexpected status code 404 Not Found: 404 page not found
2025-02-04 21:16:19 ERR
2025-02-04 21:16:19 ERR main.go:74: error during command execution: remote write: POST https://registry.lab.local:5000/v2/hauler/.metadata/blobs/uploads/: unexpected status code 404 Not Found: 404 page not found
...
2025-02-04 21:16:19 ERR exit status 1

Attempt to serve the registry:

hauler store serve registry

Output:

2025-02-04 21:35:45 INF hauler/.metadata:latest
2025-02-04 21:35:45 ERR Error: remote write: POST http://127.0.0.1:37409/v2/hauler/.metadata/blobs/uploads/: unexpected status code 404 Not Found: 404 page not found
2025-02-04 21:35:45 ERR
2025-02-04 21:35:45 ERR main.go:74: error during command execution: remote write: POST http://127.0.0.1:37409/v2/hauler/.metadata/blobs/uploads/: unexpected status code 404 Not Found: 404 page not found
Error: exit status 1
Usage:
  hauler store serve registry [flags]
  ...
2025-02-04 21:35:45 ERR exit status 1

Expected Behavior:

  • Files in general should not be copied to or served from a registry, as they are not valid OCI resources.
  • Files with special characters in their names should be explicitly excluded from hauler store copy and hauler store serve registry operations. If handling such files is unsupported, validation should prevent them from being added to the store in the first place.

Actual Behavior:

  • Non-OCI resources are copied into the registry or served, and Files with special characters in their names may crash the command

Additional Context:

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingsize/SDenotes an issue/PR requiring a relatively small amount of work

    Type

    No fields configured for Bug.

    Projects

    Status

    Backlog

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions