Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No valid crumb was included in the request #2

Open
davidobrien1985 opened this issue Oct 3, 2016 · 3 comments
Open

No valid crumb was included in the request #2

davidobrien1985 opened this issue Oct 3, 2016 · 3 comments

Comments

@davidobrien1985
Copy link

Hi,

packer builds up to the point where it tries to install the plugins.
Fails with this error:

    amazon-ebs: Jenkins is up! Downloading plugins
    amazon-ebs: 150K .......... .......... .......... .......... .......... 23% 36.3M 0s
    amazon-ebs: There is some bug with the plugin installer so we have to follow procedure here https://gist.github.com/rowan-m/1026918
    amazon-ebs: 200K .......... .......... .......... .......... .......... 29% 6.31M 0s
    amazon-ebs: 250K .......... .......... .......... .......... .......... 34% 54.4M 0s
    amazon-ebs: 300K .......... .......... .......... .......... .......... 40% 15.2M 0s
    amazon-ebs: 350K .......... .......... .......... .......... .......... 46% 6.17M 0s
    amazon-ebs: 400K .......... .......... .......... .......... .......... 52%  155M 0s
    amazon-ebs: 450K .......... .......... .......... .......... .......... 58%  176M 0s
    amazon-ebs: 500K .......... .......... .......... .......... .......... 64%  181M 0s
    amazon-ebs: 550K .......... .......... .......... .......... .......... 69%  183M 0s
    amazon-ebs: 600K .......... .......... .......... .......... .......... 75%  156M 0s
    amazon-ebs: 650K .......... .......... .......... .......... .......... 81%  181M 0s
    amazon-ebs: 700K .......... .......... .......... .......... .......... 87%  181M 0s
    amazon-ebs: 750K .......... .......... .......... .......... .......... 93%  178M 0s
    amazon-ebs: 800K .......... .......... .......... .......... .......... 98%  159M 0s
    amazon-ebs: 850K .........                                             100%  145M=0.03s
    amazon-ebs:
    amazon-ebs: 2016-10-03 19:48:30 (27.0 MB/s) - ‘jenkins-cli.jar’ saved [879628/879628]
    amazon-ebs:
    amazon-ebs: % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
    amazon-ebs: Dload  Upload   Total   Spent    Left  Speed
    amazon-ebs: 100   264  100   264    0     0    608      0 --:--:-- --:--:-- --:--:--   608
    amazon-ebs: 100   248  100   248    0     0    383      0 --:--:-- --:--:-- --:--:--   383
    amazon-ebs: 100   253  100   253    0     0    208      0  0:00:01  0:00:01 --:--:--     0
    amazon-ebs: 100 1090k  100 1090k    0     0  56547      0  0:00:19  0:00:19 --:--:-- 53136
    amazon-ebs: % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
    amazon-ebs: Dload  Upload   Total   Spent    Left  Speed
    amazon-ebs: 100 1090k  100   384  100 1090k   1274  3619k --:--:-- --:--:-- --:--:-- 3621k
    amazon-ebs: <html>
    amazon-ebs: <head>
    amazon-ebs: <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    amazon-ebs: <title>Error 403 No valid crumb was included in the request</title>
    amazon-ebs: </head>
    amazon-ebs: <body><h2>HTTP ERROR 403</h2>
    amazon-ebs: <p>Problem accessing /updateCenter/byId/default/postBack. Reason:
    amazon-ebs: <pre>    No valid crumb was included in the request</pre></p><hr><i><small>Powered by Jetty://</small></i><hr/>
    amazon-ebs:
    amazon-ebs: </body>
    amazon-ebs: </html>
    amazon-ebs:
    amazon-ebs: ERROR: anonymous is missing the Overall/Read permission
==> amazon-ebs: Terminating the source AWS instance...

Have you seen this before and know how to fix this?

Cheers
David

@philbert
Copy link
Owner

philbert commented Oct 4, 2016

What version of jenkins are you running? I believe this code should still work for Jenkins 1.x, but not for 2.x.

If you're using 1.x then you can run packer with --debug and when it breaks, login into Jenkins and checkout the Global Security Options and see if the flag "Prevent Cross Site Request Forgery exploits" is checked.

If it's checked then that is probably what is causing the 403.

@davidobrien1985
Copy link
Author

Ah right.
Well, I've not changed anything, just ran it as is and hit this issue.
If packer is just downloading the latest then that is probably Jenkins 2.

@philbert
Copy link
Owner

philbert commented Oct 4, 2016

It's whatever version ubuntu is packaging in 14.04.
https://github.com/philbert/jenkins-autobuilder/blob/master/scripts/jenkins-install.sh#L10

At a guess it's probably still 1.x. I believe that it is likely this change which causes the problem and was introduced after my last commit in this repo.

If you want to get it working I'd suggest 2 different way to go about it:

  1. Find where in the jenkins config.xml the csrf check can be disabled and add those lines before starting the service.
  2. The better way would be to keep the csrf check in place and use something else than localhost here when trying to install the plugins. Just make sure you don't leave anything behind that might break the portability of the ami you're building.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants