tabeyti / jenkins-jack

Jack into your Jenkins to execute Pipeline scripts, provide Pipeline step autocompletions, pull Shared Library step documenation, run console groovy scripts across multiple nodes, and more! Honestly, not that much more.
Other
100 stars 32 forks source link

Could not connect to the remote Jenkins #59

Open Wasp3r opened 3 years ago

Wasp3r commented 3 years ago

Hello,

I have an error trying to connect to my remote Jenkins. It looks like an issue that was already solved: https://github.com/tabeyti/jenkins-jack/issues/43 I've installed vsix mentioned in this issue, upgraded to 1.1.3 but nothing helped. I see Nodes, but nothing more.

image image

fabianosan commented 3 years ago

I have the same issue, the extension connects to Jenkins instance, load nodes/agents information, but can't load jobs and pipelines!

After an investigation, I found tha the problem is with the jenkins API call from the extension, when Jenkins was installed in some new web servers, like Apache TomCat 7+ for Windows Server and others, that do some RFC standard validations and if the http call not meet this validations, an error 400 is throw.

Here is more information about the issue and a workaround solution until the extension is fixed: https://stackoverflow.com/questions/41053653/tomcat-8-is-not-able-to-handle-get-request-with-in-query-parameters

image

Edit: Adding "relaxedQueryChars" attribute to the server.xml worked for me :

<Connector ............... relaxedQueryChars="[]|{}^\`"<>" />

https://stackoverflow.com/questions/41053653/tomcat-8-is-not-able-to-handle-get-request-with-in-query-parameters/51212677#51212677

And here is the Developer Tools console output: StatusCodeError: 400 - "<!doctype html><html lang=\"en\">HTTP Status 400 – Bad Request<style type=\"text/css\">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}

HTTP Status 400 – Bad Request

<hr class=\"line\" />

Type Exception Report

Message Invalid character found in the request target [/JENKINSCI/api/json?tree=jobs[name,fullName,url,buildable,inQueue,description,jobs[name,fullName,url,buildable,inQueue,description,jobs[name,fullName,url,buildable,inQueue,description]]]]. The valid characters are defined in RFC 7230 and RFC 3986

Description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).

Exception

java.lang.IllegalArgumentException: Invalid character found in the request target [/JENKINSCI/api/json?tree=jobs[name,fullName,url,buildable,inQueue,description,jobs[name,fullName,url,buildable,inQueue,description,jobs[name,fullName,url,buildable,inQueue,description]]]]. The valid characters are defined in RFC 7230 and RFC 3986\r\n\torg.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:490)\r\n\torg.apache.coyote.http11.Http11Processor.service(Http11Processor.java:261)\r\n\torg.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)\r\n\torg.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:888)\r\n\torg.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1597)\r\n\torg.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)\r\n\tjava.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)\r\n\tjava.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)\r\n\torg.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)\r\n\tjava.lang.Thread.run(Unknown Source)\r\n

Note The full stack trace of the root cause is available in the server logs.

<hr class=\"line\" />

Apache Tomcat/9.0.41

" at new StatusCodeError (c:\Users\.vscode\extensions\tabeyti.jenkins-jack-1.1.5\node_modules\request-promise-core\lib\errors.js:32:15) at Request.plumbing.callback (c:\Users\.vscode\extensions\tabeyti.jenkins-jack-1.1.5\node_modules\request-promise-core\lib\plumbing.js:104:33) at Request.RP$callback [as _callback] (c:\Users\.vscode\extensions\tabeyti.jenkins-jack-1.1.5\node_modules\request-promise-core\lib\plumbing.js:46:31) at Request.self.callback (c:\Users\.vscode\extensions\tabeyti.jenkins-jack-1.1.5\node_modules\request\request.js:185:22) at Request.emit (events.js:315:20) at Request. (c:\Users\.vscode\extensions\tabeyti.jenkins-jack-1.1.5\node_modules\request\request.js:1161:10) at Request.emit (events.js:315:20) at IncomingMessage. (c:\Users\.vscode\extensions\tabeyti.jenkins-jack-1.1.5\node_modules\request\request.js:1083:12) at Object.onceWrapper (events.js:421:28) at IncomingMessage.emit (events.js:327:22) at endReadableNT (internal/streams/readable.js:1327:12) at processTicksAndRejections (internal/process/task_queues.js:80:21)

solvingj commented 3 years ago

@fabianosan What can be done in JenkinsJack to work around or fix this?

jmarandet commented 2 years ago

same kind of issue, the plugin is not working anymore. VSCode 1.65.2 Jenkins 2.332.1

Gexar commented 2 years ago

Same problem here VSCode 1.64.2 Jenkins 2.263.3

hoppfrosch commented 1 year ago

Problem still exists here

Summary: On startup, connection to stored remote Jenkins fails - unless the connection parameters are correct