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

The process cannot access the file because it is being used by another process #48

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

Comments

@Alinoe22
Copy link

Describe the bug

When running the following command:

environment {
	JFROG_CLI_TEMP_DIR="$WORKSPACE/jfrog-temp/"
  }

jf "rt build-add-dependencies --project=proj --from-rt=true --server-id=artifactory --spec=./release-bundle.json MyBundle 58"

More often than not I have this error:

Failed to close reader: remove D:\Jenkins\workspace\MyJob/jfrog-temp/jfrog.cli.temp.-1739798442-2443638522: The process cannot access the file because it is being used by another process.

It sometimes work, which makes me think there is a race condition somewhere.

Current behavior

The jfrog plugin fails with this log:

[2025-02-17T13:20:03.914Z] [MyJob] $ D:\Jenkins\tools\io.jenkins.plugins.jfrog.JfrogInstallation\jfrog-cli\jf.exe -v
[2025-02-17T13:20:04.896Z] [MyJob] $ cmd.exe /C "D:\Jenkins\tools\io.jenkins.plugins.jfrog.JfrogInstallation\jfrog-cli\jf.exe c add artifactory --user=my_user --password-stdin --url=https://artifactory.domain.net/ --artifactory-url=https://artifactory.domain.net/artifactory --distribution-url=https://artifactory.domain.net/distribution --xray-url=https://artifactory.domain.net/xray --interactive=false --overwrite=true && exit %%ERRORLEVEL%%"

[2025-02-17T13:20:05.274Z] [MyJob] $ cmd.exe /C "D:\Jenkins\tools\io.jenkins.plugins.jfrog.JfrogInstallation\jfrog-cli\jf.exe rt build-add-dependencies --project=proj --from-rt=true --server-id=artifactory --spec=./release-bundle.json MyBundle 58 && exit %%ERRORLEVEL%%"

[2025-02-17T13:20:05.763Z] 13:20:05 [Info] Running Build Add Dependencies command...
[2025-02-17T13:20:05.810Z] 13:20:05 [Info] Searching items related to a build...
[2025-02-17T13:20:35.836Z] 13:20:35 [Info] Searching items related to a build...
[2025-02-17T13:20:36.086Z] 13:20:36 [Info] Searching items related to a build...
...
[2025-02-17T13:20:42.762Z] 13:20:42 [Error] Failed to close reader: remove D:\Jenkins\workspace\MyJob/jfrog-temp/jfrog.cli.temp.-1739798442-2443638522: The process cannot access the file because it is being used by another process.
[2025-02-17T13:20:42.763Z] 13:20:42 [Info] Trace ID for JFrog Platform logs: 88e4a11d7bf86906
[2025-02-17T13:20:42.763Z] 13:20:42 [Error] Failed to close reader: remove D:\Jenkins\workspace\MyJob/jfrog-temp/jfrog.cli.temp.-1739798442-2443638522: The process cannot access the file because it is being used by another process.
Couldn't execute 'jf' command. RuntimeException: Running 'jf' command failed with exit code 1

Reproduction steps

environment {
	JFROG_CLI_TEMP_DIR="$WORKSPACE/jfrog-temp/"
  }

jf "rt build-add-dependencies --project=proj --from-rt=true --server-id=artifactory --spec=./release-bundle.json MyBundle 58"

with release-bundle.json having many builds defned:

{
  "files": [
    {
      "build": "Build1",
      "project": "proj",
      "target": "modules/"
    },
    {
      "build": "Build2",
      "project": "proj",
      "target": "modules/"
    },
    {
      "build": "Build3",
      "project": "proj",
      "target": "modules/"
    },
    {
      "build": "Build4",
      "project": "proj",
      "target": "modules/"
    },
...
 ]
}

Note that it doesn't just happen with build-add-dependencies, it can also happen with download

Expected behavior

The commands succeed without failing on access to temporary files.

JFrog plugin version

1.5.8

JFrog CLI version

2.73.2

Operating system type and version

Windows 10 10.0.19045 Build 19045

JFrog Artifactory version

7.98.13

JFrog Xray version

N/A

@Alinoe22 Alinoe22 added the bug Something isn't working label Feb 17, 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