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

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

Open
TLASLRDOPSTEAM opened this issue Feb 5, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@TLASLRDOPSTEAM
Copy link

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:

@TLASLRDOPSTEAM TLASLRDOPSTEAM added the bug Something isn't working label Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant