We have two factor authentication in Jenkins server and I'm trying to execute
create-node command using personal access token.
java -jar jenkins-cli.jar -s "https://URL" -auth username:token create-node "test"
this command is giving below error however if i remove the 2FA from jenkins and pass the username:password in -auth everything is working fine.
Observation : except create-node all other commands are working fine using personal access token.
Unexpected exception occurred while performing create-node command.
java.io.InterruptedIOException
at java.base/java.io.PipedInputStream.read(PipedInputStream.java:328)
at java.base/java.io.PipedInputStream.read(PipedInputStream.java:377)
at java.base/java.io.BufferedInputStream.fill(BufferedInputStream.java:244)
at java.base/java.io.BufferedInputStream.read(BufferedInputStream.java:263)
at java.base/java.io.FilterInputStream.read(FilterInputStream.java:82)
at java.base/java.io.PushbackInputStream.read(PushbackInputStream.java:135)
at com.thoughtworks.xstream.core.util.XmlHeaderAwareReader.getHeader(XmlHeaderAwareReader.java:79)
at com.thoughtworks.xstream.core.util.XmlHeaderAwareReader.<init>(XmlHeaderAwareReader.java:61)
at com.thoughtworks.xstream.io.xml.AbstractXppDriver.createReader(AbstractXppDriver.java:65)