scala / scala-jenkins-infra

A Chef cookbook that manages Scala's CI infrastructure.
https://scala-ci.typesafe.com
Apache License 2.0
14 stars 17 forks source link

figure out how to do REST calls (e.g. to mass-delete old jobs) #257

Closed SethTisue closed 4 years ago

SethTisue commented 4 years ago

the method I used to use (documented at https://github.com/scala/scala-jenkins-infra/blob/master/doc/maintenance.md#monitoring-disk-space) has stopped working

SethTisue commented 4 years ago

the error I get is:

[99/99]: https://scala-ci.typesafe.com/job/scala-2.11.x-integrate-community-build/1799/doDelete --> <stdout>
--_curl_--https://scala-ci.typesafe.com/job/scala-2.11.x-integrate-community-build/1799/doDelete
<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 No valid crumb was included in the request</h2>
<table>
<tr><th>URI:</th><td>/job/scala-2.11.x-integrate-community-build/1799/doDelete</td></tr>
<tr><th>STATUS:</th><td>403</td></tr>
<tr><th>MESSAGE:</th><td>No valid crumb was included in the request</td></tr>
<tr><th>SERVLET:</th><td>Stapler</td></tr>
</table>
<hr><a href="http://eclipse.org/jetty">Powered by Jetty:// 9.4.30.v20200611</a><hr/>
SethTisue commented 4 years ago

checking the "Enable proxy compatibility" box at https://scala-ci.typesafe.com/configureSecurity/ didn't help

(this was one of the tips at https://github.com/spinnaker/spinnaker/issues/2067)

SethTisue commented 4 years ago

also tried going to https://scala-ci.typesafe.com/user/sethtisue/configure and generating an API token there (instead of using a token generated on GitHub) and when I try to use it the token use count on that page does increment (e.g. "Used 99 time(s)") but the result page says: "Access Denied: sethtisue is missing the Overall/Read permission"

SethTisue commented 4 years ago

hmm maybe the Strict Crumb Issuer plugin would help (https://stackoverflow.com/a/60386839/86485)

SethTisue commented 4 years ago

installed Strict Crumb Issuer, under "CSRF Protection" changed crumb issuer setting to "Strict Crumb Issuer" and unchecked "Check the session ID" and.... it didn't help 😢

SethTisue commented 4 years ago

well, this is turning into a time sink

rather than mess with this REST API stuff any further, I checked the "Discard old builds" checkbox in the config for all of the community build jobs, and set it to 90 days

not sure when it will take effect. I guess check back in a few days on e.g. https://scala-ci.typesafe.com/view/scala-2.11.x/job/scala-2.11.x-integrate-community-build/1701/ to see whether it has disappeared

at present https://scala-ci.typesafe.com/computer/ shows jenkins-master has 4.85 GB free, the goal of this work is to see that number go up

SethTisue commented 4 years ago

44.66 GB free, I guess we're good :-)