Repository navigation
##[error]The string contains invalid characters. Invalid XML name: #529
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Description:
setup-java step fails with ##[error]The string contains invalid characters. Invalid XML name:
Task version:
Could reproduce error with version v3.6.0 and above.
With version actions/setup-java@v3.5.1 there is no error.
Platform:
- Ubuntu
- macOS
- Windows
Runner type:
- Hosted
- Self-hosted
Repro steps:
Workflow file with setup-java step
jobs:
ci:
name: CI
runs-on:
- self-hosted
- default-runner
timeout-minutes: 30
steps:
- uses: actions/checkout@v3.5.3
with:
fetch-depth: 0
- name: set up jdk
uses: actions/setup-java@v3.6.0
with:
java-version: '17'
distribution: 'temurin'
- name: gradlew test
run: ./gradlew test --continue --parallel --info '-Dfile.encoding=UTF-8'
Expected behavior:
No error such that subsequent steps can be executed.
Actual behavior:
There is an error in log and subsequent are not executed.
2023-08-21T12:21:22.4632025Z ##[debug]Loading env
2023-08-21T12:21:22.4634396Z ##[group]Run actions/setup-java@v3.6.0
2023-08-21T12:21:22.4634601Z with:
2023-08-21T12:21:22.4634722Z java-version: 17
2023-08-21T12:21:22.4634829Z distribution: temurin
2023-08-21T12:21:22.4634955Z java-package: jdk
2023-08-21T12:21:22.4635088Z check-latest: false
2023-08-21T12:21:22.4635614Z server-id: github
2023-08-21T12:21:22.4635731Z server-username: GITHUB_ACTOR
2023-08-21T12:21:22.4635883Z server-password: GITHUB_TOKEN
2023-08-21T12:21:22.4636043Z overwrite-settings: true
2023-08-21T12:21:22.4636208Z job-status: success
2023-08-21T12:21:22.4636383Z token: ***
2023-08-21T12:21:22.4636476Z env:
2023-08-21T12:21:22.4636614Z GRADLE_OPTS: -Dorg.gradle.jvmargs=-Xmx4g
2023-08-21T12:21:22.4636820Z GITHUB_TOKEN: ***
2023-08-21T12:21:22.4637096Z ##[endgroup]
2023-08-21T12:21:22.5708128Z ::group::Installed distributions
2023-08-21T12:21:22.5708325Z ##[group]Installed distributions
2023-08-21T12:21:22.5730894Z ##[debug]isExplicit: 17.0.7-7
2023-08-21T12:21:22.5731686Z ##[debug]explicit? true
2023-08-21T12:21:22.5738375Z Resolved Java 17.0.7+7 from tool-cache
2023-08-21T12:21:22.5738640Z Setting Java 17.0.7+7 as the default
2023-08-21T12:21:22.5761239Z Creating toolchains.xml for JDK version 17 from temurin
2023-08-21T12:21:22.5875183Z ##[error]The string contains invalid characters. Invalid XML name: ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
2023-08-21T12:21:22.5880056Z ##[debug]Node Action run completed with exit code 1
2023-08-21T12:21:22.5881972Z ##[debug]JAVA_HOME='C:\actions-runner\_work\_tool\Java_Temurin-Hotspot_jdk\17.0.7-7\x64'
2023-08-21T12:21:22.5882195Z ##[debug]JAVA_HOME_17_X64='C:\actions-runner\_work\_tool\Java_Temurin-Hotspot_jdk\17.0.7-7\x64'
2023-08-21T12:21:22.5883650Z ##[debug]Set output distribution = Temurin-Hotspot
2023-08-21T12:21:22.5883870Z ##[debug]Set output path = C:\actions-runner\_work\_tool\Java_Temurin-Hotspot_jdk\17.0.7-7\x64
2023-08-21T12:21:22.5884100Z ##[debug]Set output version = 17.0.7+7
2023-08-21T12:21:22.5885422Z ##[debug]Finishing: set up jdk
Additional Comments:
The build workflow ran successfully for the last time on Friday 18 August. Today, August 21, the error appeared for the first time and consistently.
Maybe it was because we referenced actions/setup-java@v3 and not explicitly a specific version.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Activity
IvanZosimov commentedon Aug 22, 2023
Hi, @cyrillzadra 👋 Thanks for the issue, we will take a look! Could you please provide us with the link to the failed run ?
IvanZosimov commentedon Aug 22, 2023
@cyrillzadra, do you have a
toolchains.xmlfile in your repo? Could we have a glance at it?cyrillzadra commentedon Aug 22, 2023
Hi .. I dont have a toolchains.xml in my repo. But there was one in user home of the service user running github action. This file seems to be corrupted. It contained only NULL Strings.
I deleted toolchains.xml and restarted github action workflow. There were no more errors. Is it possible that toolchain got changed this way by setup-java?
IvanZosimov commentedon Aug 23, 2023
Thanks for the answer, @cyrillzadra! We didn't have such problems yet, maybe the file was corrupted by another application. Now, as the problem is solved, I'm closing this issue. If you face it again, feel free to reopen the issue and ping me.
cyrillzadra commentedon Aug 23, 2023
Thanks for your help. Its perfect to me.
One thing I recognized. Every time build runs setup-java adds a new toolchain element to toolchains.xml. Even it already exists.
IvanZosimov commentedon Aug 23, 2023
@cyrillzadra, thanks for taking our attention to it ❤️. Currently it's how the action works and it seems like a small bug which can become problematic namely on the self-hosted runners. I'll create a bug report out of your comment.