jfrog/jfrog-cli

Dangling symlinks cause upload errors with wildcards in filespecs

creid-arista opened this issue · 0 comments

Describe the bug

When attempting to upload via a filespec that includes a pattern with a wildcard, if the current directory or any child directories contain dangling symlinks the upload will fail. This is regardless of whether or not the dangling symlink matches the pattern.

Current behavior

[Debug] Usage Report: Sending info...
[Debug] Sending HTTP GET request to: .../artifactory/api/system/version
[Error] stat broken.symlink: no such file or directory
[Error] stat broken.symlink: no such file or directory
[Debug] Uploaded 0 artifacts.
[Error] stat broken.symlink: no such file or directory
[Debug] Artifactory response: 200 OK
[Debug] JFrog Artifactory version is: 7.63.10
[Debug] Sending HTTP POST request to: .../artifactory/api/system/usage

Reproduction steps

Create the following structure:

.
├── a-test.txt
├── broken.symlink -> a-file.txt
└── upload.filespec

upload.filespec:

{
    "files": [
        {
            "pattern": "./*-test.txt",
            "target": "generic-test/",
            "props": "name=Test File"
        }
    ]
}

Run jfrog rt u --spec=upload.filespec

Expected behavior

Upload the relevant file and ignore the irrelevant broken symlink.

JFrog CLI version

2.67.0

Operating system type and version

AlmaLinux 9.4

JFrog Artifactory version

No response

JFrog Xray version

No response