You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using jf.exe on a Jenkins build server to download artifacts using a spec file as input every now and then a failing download occurs, with a message:
03:00:37 [Error] Failed to close reader: remove C:\Users\userA\AppData\Local\Temp\jfrog.cli.temp.-1736906327-1915232773: The process cannot access the file because it is being used by another process.
03:00:37 [Info] Trace ID for JFrog Platform logs: ff38bc27579ea9b3
03:00:37 [Error] download finished with errors, please review the logs
Due to this the download fails. The failing download can more or less happen for any artifact that is being downloaded.
Current behavior
The error message seems to come from the jfrog-client-go repo, contentreader.go:
// Cleanup the reader data.
func (cr *ContentReader) Close() error {
for _, filePath := range cr.filesPaths {
if filePath == "" {
continue
}
if err := errorutils.CheckError(os.Remove(filePath)); err != nil {
return errors.New("Failed to close reader: " + err.Error())
}
}
cr.filesPaths = nil
return nil
}
In order to make sure this is not interference of another tool (e.g. virus scanner) ProcessMonitor was executed until the issue occurred. This showed that only jf.exe was accessing the file when it happens - the contentreader tries to remove the file but some other thread still seems to have it open. It seems to be a race condition that only happens on rare occasions, most of the times no issue occurs. It also only seems to occur on Windows, it cannot be reproduced using jf on Linux.
The temp file itself that is reported in the error is still available on the machine that ran the command (since it could not be deleted), its contents do not look suspicious:
Unfortunately there is no easy way to reproduce it. It simply happens on a Jenkins build server every now and then, breaking the build pipeline. In order to investigate builds were triggered manually until the issue occurred. Just using jf.exe rt dl --spec <spec>.json
should also reproduce it, but the occurrence is low.
Expected behavior
The download does not fail on trying to remove a temp file that jfrog-cli (jf.exe) has created by itself.
JFrog CLI version
2.73.0
Operating system type and version
Windows 11 23H2
JFrog Artifactory version
7.77.14
JFrog Xray version
N.A.
The text was updated successfully, but these errors were encountered:
Describe the bug
When using jf.exe on a Jenkins build server to download artifacts using a spec file as input every now and then a failing download occurs, with a message:
03:00:37 [Error] Failed to close reader: remove C:\Users\userA\AppData\Local\Temp\jfrog.cli.temp.-1736906327-1915232773: The process cannot access the file because it is being used by another process.
03:00:37 [Info] Trace ID for JFrog Platform logs: ff38bc27579ea9b3
03:00:37 [Error] download finished with errors, please review the logs
Due to this the download fails. The failing download can more or less happen for any artifact that is being downloaded.
Current behavior
The error message seems to come from the jfrog-client-go repo, contentreader.go:
In order to make sure this is not interference of another tool (e.g. virus scanner) ProcessMonitor was executed until the issue occurred. This showed that only jf.exe was accessing the file when it happens - the contentreader tries to remove the file but some other thread still seems to have it open. It seems to be a race condition that only happens on rare occasions, most of the times no issue occurs. It also only seems to occur on Windows, it cannot be reproduced using jf on Linux.
The temp file itself that is reported in the error is still available on the machine that ran the command (since it could not be deleted), its contents do not look suspicious:
Reproduction steps
Unfortunately there is no easy way to reproduce it. It simply happens on a Jenkins build server every now and then, breaking the build pipeline. In order to investigate builds were triggered manually until the issue occurred. Just using
jf.exe rt dl --spec <spec>.json
should also reproduce it, but the occurrence is low.
Expected behavior
The download does not fail on trying to remove a temp file that jfrog-cli (jf.exe) has created by itself.
JFrog CLI version
2.73.0
Operating system type and version
Windows 11 23H2
JFrog Artifactory version
7.77.14
JFrog Xray version
N.A.
The text was updated successfully, but these errors were encountered: