samrocketman / jenkins-bootstrap-jervis

An automated Jenkins CI environment which provisions agent infrastructure on the fly per build.
Apache License 2.0
75 stars 30 forks source link

Python SyntaxError / No Valid Crumb during install #15

Closed nelson-liu closed 7 years ago

nelson-liu commented 7 years ago

Thanks for this project, it looks great! I tried using the bootstrap script to get started, and I ran into the following during installation. Not sure if it's expected or not, so I figured i might as well raise an issue. For the reference, I'm able to log into jenkins and it seems to work (haven't run anything yet, though).

$ ./jervis_bootstrap.sh
Downloading specific versions of Jenkins and plugins...
:getjenkins
:getplugins UP-TO-DATE

BUILD SUCCESSFUL

Total time: 3.741 secs

This build could be faster, please consider using the Gradle Daemon: https://docs.gradle.org/2.13/userguide/gradle_daemon.html
Jenkins is running.
Waiting for http://localhost:8080/jnlpJars/jenkins-cli.jar to become available.ready.
  File "<string>", line 1
    import sys,json;exec "try:\n  j=json.load(sys.stdin)\n  print str(j[\"useSecurity\"]).lower()\nexcept:\n  pass"
                                                                                                                  ^
SyntaxError: invalid syntax
Authentication required...DONE
  File "<string>", line 1
    import sys,json;exec "try:\n  j=json.load(sys.stdin)\n  print str(j[\"useCrumbs\"]).lower()\nexcept:\n  pass"
                                                                                                                ^
SyntaxError: invalid syntax
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Error 403 No valid crumb was included in the request</title>
</head>
<body><h2>HTTP ERROR 403</h2>
<p>Problem accessing /scriptText. Reason:
<pre>    No valid crumb was included in the request</pre></p><hr><i><small>Powered by Jetty://</small></i><hr/>

</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Error 403 No valid crumb was included in the request</title>
</head>
<body><h2>HTTP ERROR 403</h2>
<p>Problem accessing /scriptText. Reason:
<pre>    No valid crumb was included in the request</pre></p><hr><i><small>Powered by Jetty://</small></i><hr/>

</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Error 403 No valid crumb was included in the request</title>
</head>
<body><h2>HTTP ERROR 403</h2>
<p>Problem accessing /scriptText. Reason:
<pre>    No valid crumb was included in the request</pre></p><hr><i><small>Powered by Jetty://</small></i><hr/>

</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Error 403 No valid crumb was included in the request</title>
</head>
<body><h2>HTTP ERROR 403</h2>
<p>Problem accessing /scriptText. Reason:
<pre>    No valid crumb was included in the request</pre></p><hr><i><small>Powered by Jetty://</small></i><hr/>

</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Error 403 No valid crumb was included in the request</title>
</head>
<body><h2>HTTP ERROR 403</h2>
<p>Problem accessing /scriptText. Reason:
<pre>    No valid crumb was included in the request</pre></p><hr><i><small>Powered by Jetty://</small></i><hr/>

</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Error 403 No valid crumb was included in the request</title>
</head>
<body><h2>HTTP ERROR 403</h2>
<p>Problem accessing /scriptText. Reason:
<pre>    No valid crumb was included in the request</pre></p><hr><i><small>Powered by Jetty://</small></i><hr/>

</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Error 403 No valid crumb was included in the request</title>
</head>
<body><h2>HTTP ERROR 403</h2>
<p>Problem accessing /scriptText. Reason:
<pre>    No valid crumb was included in the request</pre></p><hr><i><small>Powered by Jetty://</small></i><hr/>

</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Error 403 No valid crumb was included in the request</title>
</head>
<body><h2>HTTP ERROR 403</h2>
<p>Problem accessing /scriptText. Reason:
<pre>    No valid crumb was included in the request</pre></p><hr><i><small>Powered by Jetty://</small></i><hr/>

</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Error 403 No valid crumb was included in the request</title>
</head>
<body><h2>HTTP ERROR 403</h2>
<p>Problem accessing /scriptText. Reason:
<pre>    No valid crumb was included in the request</pre></p><hr><i><small>Powered by Jetty://</small></i><hr/>

</body>
</html>
Jenkins is ready.  Visit ****
User: admin
Password: ***
samrocketman commented 7 years ago

What version of Python is it using? It was originally written for Python 2.x.

samrocketman commented 7 years ago

I'm about to overhaul it anyways which will take away a lot of the issues you describe.

nelson-liu commented 7 years ago

That explains -- I was using 3.x. Feel free to close if you don't think this is an issue.

nelson-liu commented 7 years ago

Sounds good, looking forward!

samrocketman commented 7 years ago

Going to replace a lot of the bash with https://github.com/samrocketman/home/blob/master/bin/jenkins-call-url

samrocketman commented 7 years ago

This issue has been resolved. Please fetch the latest and try again.