Title: The Corretto distribution fails to find existing versions when using a task cache · Issue #474 · actions/setup-java · GitHub
Open Graph Title: The Corretto distribution fails to find existing versions when using a task cache · Issue #474 · actions/setup-java
X Title: The Corretto distribution fails to find existing versions when using a task cache · Issue #474 · actions/setup-java
Description: Description: When using self-hosted runners on GHES with a tool cache, setup-java fails to find the cached version of the corretto distribution. This is due to Corretto using non-semver version numbers, e.g. for Java 17 the version is 17...
Open Graph Description: Description: When using self-hosted runners on GHES with a tool cache, setup-java fails to find the cached version of the corretto distribution. This is due to Corretto using non-semver version num...
X Description: Description: When using self-hosted runners on GHES with a tool cache, setup-java fails to find the cached version of the corretto distribution. This is due to Corretto using non-semver version num...
Opengraph URL: https://github.com/actions/setup-java/issues/474
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"The Corretto distribution fails to find existing versions when using a task cache ","articleBody":"**Description:**\r\nWhen using self-hosted runners on GHES with a tool cache, setup-java fails to find the cached version of the `corretto` distribution. This is due to Corretto using non-semver version numbers, e.g. for Java 17 the version is `17.0.6.10.1`\r\n\r\n**Task version:**\r\n3.3 and greater\r\n\r\n**Platform:**\r\n- [x] Ubuntu\r\n- [x] macOS\r\n- [x] Windows\r\n\r\n**Runner type:**\r\n- [ ] Hosted\r\n- [x] Self-hosted\r\n\r\n**Repro steps:**\r\nTo repro, build a task cache with a given version of Java, e.g.:\r\n```yaml\r\n - name: Setup Java\r\n uses: actions/setup-java@v3\r\n with:\r\n distribution: 'corretto'\r\n java-version: '17'\r\n```\r\n\r\nOnce the task cache has been build, run a job with the above step that uses the task cache. When you run the job setup-java will fail to find the cached version and and attempt to reach out to the internet. In our case this is blocked by a firewall rule. \r\n\u003cimg width=\"1303\" alt=\"Screenshot 2023-03-27 at 14 11 27\" src=\"https://user-images.githubusercontent.com/380725/227947805-4cb215eb-5572-40ab-bdf7-132191ded10d.png\"\u003e\r\n\r\nTo show that this is indeed an issue with the directory names on disk, the following can be done to make setup-java find it. In our case the Corretto Java version is `17.0.6.10.1`:\r\n\r\n```yaml\r\n - name: Fix Java Dir\r\n run: mv /opt/hostedtoolcache/Java_Corretto_jdk/17.0.6.10.1 /opt/hostedtoolcache/Java_Corretto_jdk/17.0.6\r\n\r\n - name: Setup Java\r\n uses: actions/setup-java@v3\r\n with:\r\n distribution: 'corretto'\r\n java-version: '17'\r\n```\r\nThe results of running this are as follows\r\n\u003cimg width=\"1303\" alt=\"Screenshot 2023-03-27 at 14 17 50\" src=\"https://user-images.githubusercontent.com/380725/227948632-da27635b-e21e-4f0b-8e0f-501ecd6a9ba8.png\"\u003e\r\n\r\n**Expected behavior:**\r\nThe setup-java action should correctly find cached versions of Corretto on disk\r\n\r\n**Actual behavior:**\r\nThe setup-java action fails to find cached versions of Corretto on disk and instead attempts to download a version from the internet.","author":{"url":"https://github.com/jamestoyer","@type":"Person","name":"jamestoyer"},"datePublished":"2023-03-27T13:20:23.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/474/setup-java/issues/474"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:9ee2575d-4727-db92-2dd1-31a884b41bc2 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8D08:332D5D:9DF9D0:D61B49:6A515D76 |
| html-safe-nonce | 12fc04862b38f1eee600adfab09eb32007ac9da5a3ed831911b5de494d2e9aa8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RDA4OjMzMkQ1RDo5REY5RDA6RDYxQjQ5OjZBNTE1RDc2IiwidmlzaXRvcl9pZCI6Ijg2ODM3NzE3MzkzNDYzOTQ0ODYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 3597c764ce8efba3a9cc035b912c2cff7defda526affd2ab851b6338692d8882 |
| hovercard-subject-tag | issue:1642033636 |
| github-keyboard-shortcuts | repository,issues,actions,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/actions/setup-java/474/issue_layout |
| twitter:image | https://opengraph.githubassets.com/80e1a97c4dbe18be5fc52cf9957ddf6ad506849a14bb29fce39b7cd801074fcf/actions/setup-java/issues/474 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/80e1a97c4dbe18be5fc52cf9957ddf6ad506849a14bb29fce39b7cd801074fcf/actions/setup-java/issues/474 |
| og:image:alt | Description: When using self-hosted runners on GHES with a tool cache, setup-java fails to find the cached version of the corretto distribution. This is due to Corretto using non-semver version num... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jamestoyer |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| go-import | github.com/actions/setup-java git https://github.com/actions/setup-java.git |
| octolytics-dimension-user_id | 44036562 |
| octolytics-dimension-user_login | actions |
| octolytics-dimension-repository_id | 196057608 |
| octolytics-dimension-repository_nwo | actions/setup-java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 196057608 |
| octolytics-dimension-repository_network_root_nwo | actions/setup-java |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 2eeb434949a926fad21064b4d395a54759f7a0b2 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width