timja / jenkins-gh-issues-poc-06-18

0 stars 0 forks source link

[JENKINS-26658] Add Windows command line (escaping %) for JNLP slave command #5840

Open timja opened 9 years ago

timja commented 9 years ago

If the JNLP slave command line contains percent-escaped characters, such as %20 for spaces in the slave name, it cannot be copied and pasted into the Windows cmd as is.

An additional line (Windows command line call) should be displayed if the URL contains % characters.


Originally reported by bananeweizen, imported from: Add Windows command line (escaping %) for JNLP slave command
  • status: Open
  • priority: Trivial
  • resolution: Unresolved
  • imported: 2022/01/10
timja commented 9 years ago

danielbeck:

Could you provide the error messages you get when running from the command line?

timja commented 9 years ago

danielbeck:

2. The same slave name worked fine with earlier versions of the Oracle JRE7.

To clarify, this is independent of Jenkins versions? Both the older JRE, which works, and the newer JRE, which does not, access the same Jenkins version?

timja commented 9 years ago

danielbeck:

Which is the newest known JRE 7 to still work?

timja commented 9 years ago

danielbeck:

Cannot reproduce on Jenkins 1.580.2 with 64-bit Java 1.7.0_75 from Oracle on Windows 8 using the command (as written on the slave's index page):

java -jar slave.jar -jnlpUrl http://jenkins/computer/JENKINS%2026658/slave-agent.jnlp -secret 28595d39427950fa9495fae866fe07c0fa5d2fcf93cdcf3ab451c7e9da22b185

Jan 28, 2015 1:11:37 PM hudson.remoting.jnlp.Main createEngine
INFO: Setting up slave: JENKINS 26658
Jan 28, 2015 1:11:37 PM hudson.remoting.jnlp.Main$CuiListener
INFO: Jenkins agent is running in headless mode.
Jan 28, 2015 1:11:37 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Locating server among http://jenkins/
Jan 28, 2015 1:11:37 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Connecting to jenkins:49735
Jan 28, 2015 1:11:37 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Handshaking
Jan 28, 2015 1:11:37 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Connected

timja commented 9 years ago

danielbeck:

Would be interesting to know the contents of the JNLP file, and which version of Jenkins (and slave.jar) you're using.

timja commented 9 years ago

bananeweizen:

When collecting your requested data, I found there is a totally different root cause. We have that command in a batch file, and Windows interprets the %2 from the escaped blank as batch parameter, replacing it with an empty string. Escaping with another percent sign in the batch file (i.e. blank%%20name) fixes everything.

So basically there is no bug in Jenkins. However, everyone just copying the command line of a slave with a blank in the name will easily run into the same trouble. Maybe a note could be added to the slave page? I'm fine if you just close the bug.

timja commented 9 years ago

danielbeck:

Rewrote the issue.