Re: Upgrades past 2.266, can't log in to Jenkins

2021-03-09 Thread 'al...@puredanger.com' via Jenkins Users
Answering my own question, I did an experiment and tried adding a new user 
(while working) and upgrading and could still log in. Based on that, I 
updated my user password while working and upgraded, and it worked. So 
maybe something about how the old passwords were stored/encrypted.

Anyways, that got me over the hump at least.

On Tuesday, March 9, 2021 at 1:28:27 PM UTC-6 al...@puredanger.com wrote:

> I asked about this a couple months ago but did not have time to really dig 
> into it then.
>
> I am currently on Jenkins version 2.265 with the latest version of all 
> plugins (that I can update). When I upgrade to 2.266+ (have tried with 
> latest), the server restarts but my user login no longer works ("Invalid 
> username or password"). If I manually roll back to 2.265, everything works 
> again. I assume this is related to 
> https://github.com/jenkinsci/jep/tree/master/jep/227.
>
> * No warnings or errors in the logs on server startup or when login fails
> * The server is up and working normally afaict (public viewable stuff 
> works, it's detecting scm changes, doing builds, etc)
> * Using: Jenkin's own user database
> * Using: Project-based Matrix Authorization Strategy 
> * Plugins: I have some plugins installed of course but it's hard for me to 
> imagine what plugin could be affecting logging in. I've looked at the 
> plugin compatibility list for 227 (
> https://github.com/jenkinsci/jep/blob/master/jep/227/compatibility.adoc) 
> and compared to my plugins but unclear what could be the issue. I use 
> Credentials and Matrix Authorization Strategy plugins but those are marked 
> as compatible. Some plugins I have installed but with unknown compatibility 
> that might possibly be related:
>   * Authentication Tokens API Plugin (don't think I'm actually using this)
>   * Cloudbees AWS Credentials Plugin
>   * Credentials Binding Plugin
>   * SSH Credentials Plugin
>
> How do I fix or debug this? It's easy to flip between working and broken 
> states by just swapping wars but I'm not sure how to tell what's not 
> working or how to fix it.
>
> Thanks!
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/13f284ec-c49d-4d6e-94b8-caaa16a1b795n%40googlegroups.com.


Upgrades past 2.266, can't log in to Jenkins

2021-03-09 Thread 'al...@puredanger.com' via Jenkins Users
I asked about this a couple months ago but did not have time to really dig 
into it then.

I am currently on Jenkins version 2.265 with the latest version of all 
plugins (that I can update). When I upgrade to 2.266+ (have tried with 
latest), the server restarts but my user login no longer works ("Invalid 
username or password"). If I manually roll back to 2.265, everything works 
again. I assume this is related to 
https://github.com/jenkinsci/jep/tree/master/jep/227.

* No warnings or errors in the logs on server startup or when login fails
* The server is up and working normally afaict (public viewable stuff 
works, it's detecting scm changes, doing builds, etc)
* Using: Jenkin's own user database
* Using: Project-based Matrix Authorization Strategy 
* Plugins: I have some plugins installed of course but it's hard for me to 
imagine what plugin could be affecting logging in. I've looked at the 
plugin compatibility list for 227 
(https://github.com/jenkinsci/jep/blob/master/jep/227/compatibility.adoc) 
and compared to my plugins but unclear what could be the issue. I use 
Credentials and Matrix Authorization Strategy plugins but those are marked 
as compatible. Some plugins I have installed but with unknown compatibility 
that might possibly be related:
  * Authentication Tokens API Plugin (don't think I'm actually using this)
  * Cloudbees AWS Credentials Plugin
  * Credentials Binding Plugin
  * SSH Credentials Plugin

How do I fix or debug this? It's easy to flip between working and broken 
states by just swapping wars but I'm not sure how to tell what's not 
working or how to fix it.

Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/b90b3213-d2fa-4a3c-8669-8c80bc70f8can%40googlegroups.com.


readJson, JsonSlurper or JQ

2021-03-09 Thread Jheison Rodriguez

Hi there

Does anyone know if there is any advantage between using Jenkins 
pipeline Step 'readJSON' and 'JsonSlurper'. I'm asking because in best 
practices page the suggestion is to avoid JsonSlurper but they don't 
mention nothing about readJson step. I want to figure out what way 
should I go forward with the last one or with the use of JQ?


https://www.jenkins.io/doc/book/pipeline/pipeline-best-practices/#avoiding-complex-groovy-code-in-pipelines

--
You received this message because you are subscribed to the Google Groups "Jenkins 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/fdf045c3-865e-c748-f2ad-09ee632efcbb%40gmail.com.


RE: Using withEnv with withCredentials

2021-03-09 Thread Reinhold Füreder
Sorry, Björn, but I think I didn’t get it:

  *   Is your suggestion to use?
 *   
withEnv([“http_proxy=https://${PROXY_CREDENTIALS}@proxy-endpoint.com:3128”]) {
  *   But isn’t that what kelvSYC also tried and “gets flagged as unsafe by 
Jenkins”
 *   
withCredentials([usernameColonPassword(credentialsId:’proxy-credentials’, 
variable: ‘PROXY_CREDENTIALS')]) {
def url = 
“https://${env.PROXY_CREDENTIALS}@proxy-endpoint.com:3128”
withEnv([“http_proxy=${url}”]) {

I think the (ugly) workaround would be (1) to not use “withEnv” step and (2) 
assemble the “http_proxy” env variable (=> shell variable) only later in the 
shell? Something like:

http_proxy=https://${env.PROXY_CREDENTIALS}@proxy-endpoint.com:3128
 

☹

Cu Reinhold


From: 'Björn Pedersen' via Jenkins Users 
Sent: Dienstag, 9. März 2021 08:10
To: Jenkins Users 
Subject: Re: Using withEnv with withCredentials

Used : 
withEnv([‘http_proxy=https://${PROXY_CREDENTIALS}@proxy-endpoint.com:3128']) {

Note the single quotes, this needs to be double-quoted for the replacement to 
happen.

Björn


kelvSYC schrieb am Montag, 8. März 2021 um 22:29:00 UTC+1:
Suppose I have a username and password credential that I use with a 
withCredentials step, and I wish to use it to construct a URL for use with the 
http_proxy environment variable. Currently I have this:

withCredentials([usernameColonPassword(credentialsId:’proxy-credentials’, 
variable: ‘PROXY_CREDENTIALS')]) {
def url = 
“https://${env.PROXY_CREDENTIALS}@proxy-endpoint.com:3128”
withEnv([“http_proxy=${url}”]) {
// Do something
}
}

This gets flagged as unsafe by Jenkins (likely rightly), so I’m wondering what 
safe way there is to do the same thing.

Something like the following doesn’t work for me:

withCredentials([usernameColonPassword(credentialsId:’proxy-credentials’, 
variable: ‘PROXY_CREDENTIALS')]) {
withEnv([‘http_proxy=https://${PROXY_CREDENTIALS}@proxy-endpoint.com:3128']) {
// Do something
}
}

All it does is that the http_proxy variable is populated with the literal 
${PROXY_CREDENTIALS} string instead of the value therein.

Any assistance in this would be appreciated.
--
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/2e09f1ff-d7d7-4ba3-a84d-2455dfe1d5acn%40googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/VI1PR01MB66388D2B93134A56C68D6331F7929%40VI1PR01MB6638.eurprd01.prod.exchangelabs.com.