Why does Jenkins need to read the memory of lsass.exe?

2023-08-17 Thread Amedee Van Gasse
Hi,

Security question here.

Is there any reason why Jenkins would ever need to request the content of 
c:\windows\system32\lsass.exe (Local Security Authority Subsystem Service)?

The endpoint protection on the Jenkins device is denying Jenkins access to 
lsass.exe, and the devs are unable to tell me why their favorite automation 
tool needs to do an activity that is highly suspicious in terms of 
security. Adversaries may attempt to access credential material stored in 
the process memory of the Local Security Authority Subsystem Service.

I was hoping that the community could help me here. I have no direct access 
to the Jenkins device, I only see suspicious events being reported by the 
endpoint security software.

-- 
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/9c7d6725-e509-4cba-a456-a822fcd221d2n%40googlegroups.com.


Re: How to get rid of noisy warning "No suitable checks publisher found"

2021-05-19 Thread Amedee Van Gasse
If anyone is still going to answer this question, go ahead, but after a 
month we've given up and just accept that the messages are there.

On Monday, April 19, 2021 at 3:14:02 PM UTC+2 Amedee Van Gasse wrote:

> One of the Jenkins plugins dragged in the *Checks API* as a dependency 
> and now *EVERY* build has this annoying message at the bottom:
>
> [Checks API] No suitable checks publisher found.
>
> This does not fail any build by itself. It's just annoying noise and I 
> don't want it.
>
> And now each time a build fails for any other reason, my developers tell 
> me 
> *"It seems that we have problems with build on foobar machine with 'No 
> suitable checks publisher found' error again"*
> which is incorrect, the actual error is just above or below that warning.
>
> This is a waste of time, I never want to see that warning again. How do I 
> get rid of it?
>
> I can't uninstall *Checks API*, it's grayed out. *JUnit* and *Warnings 
> Next Generation* need it as a dependency.
>
> * Jenkins: 2.277.2
> * Checks API: 1.7.0
>

-- 
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/374b1a47-2256-40f0-ad88-38e8c789c9f0n%40googlegroups.com.


Re: Provision EC2 node: gets destroyed as soon as it is ready

2021-05-07 Thread Amedee Van Gasse
, 2021 6:31:01 PM hudson.plugins.ec2.EC2Cloud
INFO: Connecting to ec2-52-29-72-22.eu-central-1.compute.amazonaws.com on 
port 22, with timeout 1.
May 07, 2021 6:31:09 PM hudson.plugins.ec2.EC2Cloud
INFO: No SSH key verification (ssh-ed25519 
78:ed:18:5b:52:00:76:72:8e:ae:73:69:3c:69:31:dd) for connections to EC2 
(eu-central-1 Windows) - Windows (i-02435726c827f7a6a)
May 07, 2021 6:31:09 PM hudson.plugins.ec2.EC2Cloud
INFO: Connected via SSH.
May 07, 2021 6:31:09 PM hudson.plugins.ec2.EC2Cloud
INFO: connect fresh as root
May 07, 2021 6:31:09 PM hudson.plugins.ec2.EC2Cloud
INFO: Connecting to ec2-52-29-72-22.eu-central-1.compute.amazonaws.com on 
port 22, with timeout 1.
May 07, 2021 6:31:13 PM hudson.plugins.ec2.EC2Cloud
INFO: No SSH key verification (ssh-ed25519 
78:ed:18:5b:52:00:76:72:8e:ae:73:69:3c:69:31:dd) for connections to EC2 
(eu-central-1 Windows) - Windows (i-02435726c827f7a6a)
May 07, 2021 6:31:13 PM hudson.plugins.ec2.EC2Cloud
INFO: Connected via SSH.
May 07, 2021 6:31:13 PM hudson.plugins.ec2.EC2Cloud
INFO: Creating tmp directory (C:\\Windows\\Temp\\) if it does not exist
 [91mNew-Item:  [91mAn item with the specified name C:\Windows\Temp already 
exists. [0m
May 07, 2021 6:31:28 PM hudson.plugins.ec2.EC2Cloud
INFO: Verifying: java -fullversion
openjdk full version "11.0.11+9"
May 07, 2021 6:31:32 PM hudson.plugins.ec2.EC2Cloud
INFO: Verifying: which scp
/c/Windows/System32/OpenSSH/scp
May 07, 2021 6:31:34 PM hudson.plugins.ec2.EC2Cloud
INFO: Copying remoting.jar to: C:\\Windows\\Temp\\
May 07, 2021 6:31:35 PM hudson.plugins.ec2.EC2Cloud
INFO: Launching remoting agent (via Trilead SSH2 Connection):  java 
-Dfile.encoding=UTF-8 -jar C:\\Windows\\Temp\\/remoting.jar -workDir 
C:\Users\jenkins





HTTP ERROR 404 Not Found

URI: 
/computer/EC2%20(eu-central-1%20Windows)%20-%20Windows%20(i-02435726c827f7a6a)/logText/progressiveHtml
STATUS: 404
MESSAGE: Not Found
SERVLET: Stapler

On Friday, May 7, 2021 at 6:17:34 PM UTC+2 Amedee Van Gasse wrote:

> I have added an EC2 cloud with the intention of using Windows instances.
> The Windows AMI is configured to use SSH connection, not WinRM.
> When I provision a Windows instance, I see it starting in the AWS console, 
> and I see this in the Jenkins console:
>
> May 07, 2021 5:45:42 PM INFO hudson.plugins.ec2.EC2Cloud log
> Connecting to ec2-18-197-156-192.eu-central-1.compute.amazonaws.com on 
> port 22, with timeout 1.
> May 07, 2021 5:45:52 PM INFO hudson.plugins.ec2.EC2Cloud log
> Failed to connect via ssh: The kexTimeout (1 ms) expired.
> May 07, 2021 5:45:52 PM INFO hudson.plugins.ec2.EC2Cloud log
> Waiting for SSH to come up. Sleeping 5.
> May 07, 2021 5:45:57 PM INFO hudson.plugins.ec2.EC2Cloud log
> Connecting to ec2-18-197-156-192.eu-central-1.compute.amazonaws.com on 
> port 22, with timeout 1.
> May 07, 2021 5:45:57 PM INFO hudson.plugins.ec2.EC2Cloud log
> Failed to connect via ssh: There was a problem while connecting to 
> ec2-18-197-156-192.eu-central-1.compute.amazonaws.com:22
> May 07, 2021 5:45:57 PM INFO hudson.plugins.ec2.EC2Cloud log
> Waiting for SSH to come up. Sleeping 5.
>
> (repeat many times)
> This is normal of course, as long as the instance is still starting.
>
> After a while, I see in the AWS console that the instance is Running.
> And immediately, it gets terminated.
>
> I also see this in the Jenkins log, which may or may not be relevant:
>
> May 07, 2021 5:50:52 PM INFO hudson.plugins.ec2.EC2OndemandSlave 
> lambda$terminate$0
> Terminated EC2 instance (terminated): i-0c82439628de13743
> May 07, 2021 5:50:52 PM INFO hudson.plugins.ec2.EC2OndemandSlave 
> lambda$terminate$0
> Removed EC2 instance from jenkins master: i-0c82439628de13743
>
> I may add more log snippets as I try to figure this out.
>

-- 
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/16dfd82c-276f-4e37-a318-47363f79850cn%40googlegroups.com.


Provision EC2 node: gets destroyed as soon as it is ready

2021-05-07 Thread Amedee Van Gasse
I have added an EC2 cloud with the intention of using Windows instances.
The Windows AMI is configured to use SSH connection, not WinRM.
When I provision a Windows instance, I see it starting in the AWS console, 
and I see this in the Jenkins console:

May 07, 2021 5:45:42 PM INFO hudson.plugins.ec2.EC2Cloud log
Connecting to ec2-18-197-156-192.eu-central-1.compute.amazonaws.com on port 
22, with timeout 1.
May 07, 2021 5:45:52 PM INFO hudson.plugins.ec2.EC2Cloud log
Failed to connect via ssh: The kexTimeout (1 ms) expired.
May 07, 2021 5:45:52 PM INFO hudson.plugins.ec2.EC2Cloud log
Waiting for SSH to come up. Sleeping 5.
May 07, 2021 5:45:57 PM INFO hudson.plugins.ec2.EC2Cloud log
Connecting to ec2-18-197-156-192.eu-central-1.compute.amazonaws.com on port 
22, with timeout 1.
May 07, 2021 5:45:57 PM INFO hudson.plugins.ec2.EC2Cloud log
Failed to connect via ssh: There was a problem while connecting to 
ec2-18-197-156-192.eu-central-1.compute.amazonaws.com:22
May 07, 2021 5:45:57 PM INFO hudson.plugins.ec2.EC2Cloud log
Waiting for SSH to come up. Sleeping 5.

(repeat many times)
This is normal of course, as long as the instance is still starting.

After a while, I see in the AWS console that the instance is Running.
And immediately, it gets terminated.

I also see this in the Jenkins log, which may or may not be relevant:

May 07, 2021 5:50:52 PM INFO hudson.plugins.ec2.EC2OndemandSlave 
lambda$terminate$0
Terminated EC2 instance (terminated): i-0c82439628de13743
May 07, 2021 5:50:52 PM INFO hudson.plugins.ec2.EC2OndemandSlave 
lambda$terminate$0
Removed EC2 instance from jenkins master: i-0c82439628de13743

I may add more log snippets as I try to figure this out.

-- 
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/7a223f14-cd33-4722-9424-997158bb4fb8n%40googlegroups.com.


How to get rid of noisy warning "No suitable checks publisher found"

2021-04-19 Thread Amedee Van Gasse
One of the Jenkins plugins dragged in the *Checks API* as a dependency and 
now *EVERY* build has this annoying message at the bottom:

[Checks API] No suitable checks publisher found.

This does not fail any build by itself. It's just annoying noise and I 
don't want it.

And now each time a build fails for any other reason, my developers tell me 
*"It seems that we have problems with build on foobar machine with 'No 
suitable checks publisher found' error again"*
which is incorrect, the actual error is just above or below that warning.

This is a waste of time, I never want to see that warning again. How do I 
get rid of it?

I can't uninstall *Checks API*, it's grayed out. *JUnit* and *Warnings Next 
Generation* need it as a dependency.

* Jenkins: 2.277.2
* Checks API: 1.7.0

-- 
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/bc4c4a56-a6ab-4ae2-a945-e219ec4ef49an%40googlegroups.com.


Re: Possible bug in EC2 plugin: check of SSH key may be too strict (confirmation needed before filing bug report)

2021-04-16 Thread Amedee Van Gasse
It's not just ed25519. (and you were right about AWS not supporting it)

I created a rsa key with length 8192, and the private key was also

-BEGIN OPENSSH PRIVATE KEY-

This was accepted by Jenkins as a valid key, and also by AWS itself, but it 
wasn't accepted by the EC2 plugin.
So I had to replace OPENSSH with RSA again.
So my pull request is still valid. :)

Could it be that more recent versions of ssh-keygen have replaced RSA with 
OPENSSH?


On Wednesday, April 14, 2021 at 1:05:32 AM UTC+2 Thomas Matthijs wrote:

> Currently AWS doesn't support ed25519 (at least last time i checked in 
> 2020)
> People been asking for a few year, but maybe the plugin should accept
> them already, hopefully only a matter of time till aws does
>
> On Tue, 13 Apr 2021 at 11:49, Amedee Van Gasse
>  wrote:
> >
> > So I went ahead and submitted a pull request anyway:
> > https://github.com/jenkinsci/ec2-plugin/pull/595
> >
> > I'm sure it's not all up to standards but as it is my first 
> contribution, I assume that the Jenkins community will be very happy to 
> explain me where it can be improved. :-)
> >
> > On Tuesday, April 13, 2021 at 11:19:16 AM UTC+2 Amedee Van Gasse wrote:
> >>
> >> I have a question about https://github.com/jenkinsci/ec2-plugin. It 
> may be a bug, but I'd like to have confirmation before I try to find out 
> how to file a bug report.
> >>
> >> In 
> https://github.com/jenkinsci/ec2-plugin/blob/master/src/main/java/hudson/plugins/ec2/EC2Cloud.java
>  
> there is the following validation in doCheckSshKeysCredentialsId:
> >>
> >> boolean hasStart = false, hasEnd = false;
> >> BufferedReader br = new BufferedReader(new StringReader(privateKey));
> >> String line;
> >> while ((line = br.readLine()) != null) {
> >> if (line.equals("-BEGIN RSA PRIVATE KEY-"))
> >> hasStart = true;
> >> if (line.equals("-END RSA PRIVATE KEY-"))
> >> hasEnd = true;
> >> }
> >> if (!hasStart)
> >> return FormValidation.error("This doesn't look like a private key at 
> all");
> >> if (!hasEnd)
> >> return FormValidation
> >> .error("The private key is missing the trailing 'END RSA PRIVATE KEY' 
> marker. Copy error?");
> >>
> >> I have generated an ed25519 key, with
> >>
> >> ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519
> >>
> >> SSH version:
> >> OpenSSH_8.4p1 Ubuntu-5ubuntu1, OpenSSL 1.1.1j 16 Feb 2021
> >>
> >> This key looks like
> >>
> >> -BEGIN OPENSSH PRIVATE KEY-
> >> (...)
> >> -END OPENSSH PRIVATE KEY-
> >>
> >> I can successfully use this key to connect to manually started 
> instances (with Manage Nodes -> Add New Node).
> >>
> >> I can not use this key to connect to an instance started by the EC2 
> plugin. The EC2 plugin tells me "This doesn't look like a private key at 
> all".
> >>
> >> It appears as if the validation is too strict.
> >>
> >> Workaround:
> >> In the private key file, I replaced
> >> -BEGIN OPENSSH PRIVATE KEY-
> >> (...)
> >> -END OPENSSH PRIVATE KEY-
> >>
> >> with
> >> -BEGIN RSA PRIVATE KEY-
> >> (...)
> >> -END RSA PRIVATE KEY-
> >>
> >>
> >> Can someone confirm if this is an actual bug, or is the problem at my 
> end?
> >> If it is a bug, then how do I proceed to file a bug report? The repo at 
> https://github.com/jenkinsci/ec2-plugin only has pull requests, no issue 
> tracker.
> >
> > --
> > 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-use...@googlegroups.com.
> > To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jenkinsci-users/3abaa47f-7d0a-442f-ad7f-c12c57d7cc6en%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/cc104a69-6b24-4c78-af9e-bae5e5bb0f7bn%40googlegroups.com.


Re: EC2 provision: A problem occurred while processing the request

2021-04-15 Thread Amedee Van Gasse
I got it sorted with help on Stack 
Overflow: 
https://stackoverflow.com/questions/67079854/jenkins-ec2-plugin-instances-not-starting/67104641#67104641
Missing subnet.

On Wednesday, April 14, 2021 at 10:05:08 AM UTC+2 Amedee Van Gasse wrote:

> When provisioning a configured EC2 cloud (in the nodes page in Jenkins 
> when you hit the provision via  button), I get this error:
>
>  Oops!
> A problem occurred while processing the request.
>
> Logging ID=8ead3651-3809-4a47-984c-e0e494c705bb
>

-- 
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/bea70625-e2c3-49d6-a0cc-51f3543fffb7n%40googlegroups.com.


Global Tool Configuration: Groovy installer uses wrong URL

2021-04-14 Thread Amedee Van Gasse
I wanted to share a Slack message that a colleague sent me today.

--
@here as an FYI, in the *Global Tool Configuration* on *Jenkins*, I have 
renamed the *2.5.6* Groovy installer to *2.5.6-old* and added a new *2.5.6* 
Groovy 
installer with the download link hard-coded (
https://groovy.jfrog.io/artifactory/dist-release-local/groovy-zips/apache-groovy-binary-2.5.6.zip
)
For some reason the old 2.5.6 installer (and other installers as well as I 
experienced the same issue with *2.5.0*) try to download from 
https://groovy.jfrog.io/artifactory/dist-release-local/groovy-zips/pache-groovy-binary-2.5.0.zip
https://jenkins.***/job/***/7671/console:
ERROR: Failed to download 
https://groovy.jfrog.io/artifactory/dist-release-local/groovy-zips/pache-groovy-binary-2.5.0.zip
 
from agent; will retry from master
--

Maybe someone may want to look into this?
We use Jenkins 2.277.2 and Groovy plugin 2.3.

-- 
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/590a3321-0a5f-4b64-b9a4-42ba98c4258an%40googlegroups.com.


EC2 provision: A problem occurred while processing the request

2021-04-14 Thread Amedee Van Gasse
When provisioning a configured EC2 cloud (in the nodes page in Jenkins when 
you hit the provision via  button), I get this error:

 Oops!
A problem occurred while processing the request.

Logging ID=8ead3651-3809-4a47-984c-e0e494c705bb

-- 
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/237cee44-b3c5-4556-be5d-bd04cd8de247n%40googlegroups.com.


EC2 plugin: instances not starting

2021-04-13 Thread Amedee Van Gasse
$JENKINS_URL/configureClouds/

Add new cloud: *Amazon EC2*
Name: *Amazon EC2 eu-central-1*
Amazon EC2 Credentials: *AKIA...*
Region: *eu-central-1*
EC2 Key Pair's Private Key: *ubuntu*
Test connection: *success*
Advanced...
Instance Cap: *3*
No delay provisioning: *checked*
Add AMI
Description: *Linux node*
AMI ID: *ami-0293...*
Check AMI: *05052029...*
Instance Type: *T3aMedium*
EBS Optimized: *checked*
Monitoring: *checked*
T2 Unlimited: *checked*
Security group names: *sg-0c2d...* (opens SSH port 22)
Remote FS root: *./jenkins*
Remote user: *ubuntu*
AMI Type: *unix*
Labels: *aws ubuntu linux*
Usage: *Use this node as much as possible*
Idle termination time: *30*
Advanced...
Number of executors: *2*
Stop/Disconnect on Idle Timeout: *checked*
Minimum number of instances: *1*
Minimum number of spare instances: *0*
Instance cap: *10*
Block device mapping: */dev/sda1=snap-0eadbe3f...:200:true:gp2, 
/dev/sdb=ephemeral0, /dev/sdc=ephemeral1*
Associate Public IP: *checked*
Connection Strategy: *Public DNS*
Host Key Verification Strategy: *off*
Maximum Total Uses: *10*
Environment variables: *checked*
(not listing all environment variables)
Tool locations: *checked*
(not listing all tool locations)

With this configuration, I would expect that at least 1 EC2 instance would 
be started, but no instance is started. What do I need to change?

-- 
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/a7d7be6c-d531-495f-af2c-defaf2cebcf2n%40googlegroups.com.


EC2 plugin: Connection strategy field fails on every change

2021-04-13 Thread Amedee Van Gasse
Whenever you change the value of the *Connection strategy field*, its 
validation fails with: *Could not find selected connection strategy*.

It looks like the same error as described 
in https://issues.jenkins.io/browse/JENKINS-61161 
and https://github.com/jenkinsci/ec2-plugin/pull/538, however that PR is 
already merged.

I am using EC2 plugin version 1.56 and I still get that error.

How do I get rid of this error?

-- 
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/e28a6e74-a45d-4f63-b7fd-352deefa89a0n%40googlegroups.com.


Re: Possible bug in EC2 plugin: check of SSH key may be too strict (confirmation needed before filing bug report)

2021-04-13 Thread Amedee Van Gasse
Oh wow, my PR is merged already, I did not expect that!

On Tuesday, April 13, 2021 at 11:49:11 AM UTC+2 Amedee Van Gasse wrote:

> So I went ahead and submitted a pull request anyway:
> https://github.com/jenkinsci/ec2-plugin/pull/595
>
> I'm sure it's not all up to standards but as it is my first contribution, 
> I assume that the Jenkins community will be very happy to explain me where 
> it can be improved. :-)
>
> On Tuesday, April 13, 2021 at 11:19:16 AM UTC+2 Amedee Van Gasse wrote:
>
>> I have a question about https://github.com/jenkinsci/ec2-plugin. It may 
>> be a bug, but I'd like to have confirmation before I try to find out how to 
>> file a bug report.
>>
>> In 
>> https://github.com/jenkinsci/ec2-plugin/blob/master/src/main/java/hudson/plugins/ec2/EC2Cloud.java
>>  
>> there is the following validation in doCheckSshKeysCredentialsId:
>>
>> boolean hasStart = false, hasEnd = false;
>> BufferedReader br = new BufferedReader(new StringReader(privateKey));
>> String line;
>> while ((line = br.readLine()) != null) {
>> if (line.equals("-BEGIN RSA PRIVATE KEY-"))
>> hasStart = true;
>> if (line.equals("-END RSA PRIVATE KEY-"))
>> hasEnd = true;
>> }
>> if (!hasStart)
>> return FormValidation.error("This doesn't look like a private key at 
>> all");
>> if (!hasEnd)
>> return FormValidation
>> .error("The private key is missing the trailing 'END RSA 
>> PRIVATE KEY' marker. Copy error?");
>>
>> I have generated an *ed25519* key, with
>>
>> ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519
>>
>> SSH version:
>> *OpenSSH_8.4p1 Ubuntu-5ubuntu1, OpenSSL 1.1.1j  16 Feb 2021*
>>
>> This key looks like
>>
>> -BEGIN OPENSSH PRIVATE KEY-
>> (...)
>> -END OPENSSH PRIVATE KEY-
>>
>> I can successfully use this key to connect to manually started instances 
>> (with *Manage Nodes* -> *Add New Node*).
>>
>> I can not use this key to connect to an instance started by the EC2 
>> plugin. The EC2 plugin tells me *"This doesn't look like a private key 
>> at all"*.
>>
>> It appears as if the validation is too strict.
>>
>> Workaround:
>> In the private key file, I replaced
>> -BEGIN OPENSSH PRIVATE KEY-
>> (...)
>> -END OPENSSH PRIVATE KEY-
>>
>> with
>> -BEGIN RSA PRIVATE KEY-
>> (...)
>> -END RSA PRIVATE KEY-
>>
>>
>> Can someone confirm if this is an actual bug, or is the problem at my end?
>> If it is a bug, then how do I proceed to file a bug report? The repo at 
>> https://github.com/jenkinsci/ec2-plugin only has pull requests, no issue 
>> tracker.
>>
>

-- 
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/76960146-538c-49ee-8df9-d2e9cdcdd925n%40googlegroups.com.


Re: Possible bug in EC2 plugin: check of SSH key may be too strict (confirmation needed before filing bug report)

2021-04-13 Thread Amedee Van Gasse
So I went ahead and submitted a pull request anyway:
https://github.com/jenkinsci/ec2-plugin/pull/595

I'm sure it's not all up to standards but as it is my first contribution, I 
assume that the Jenkins community will be very happy to explain me where it 
can be improved. :-)

On Tuesday, April 13, 2021 at 11:19:16 AM UTC+2 Amedee Van Gasse wrote:

> I have a question about https://github.com/jenkinsci/ec2-plugin. It may 
> be a bug, but I'd like to have confirmation before I try to find out how to 
> file a bug report.
>
> In 
> https://github.com/jenkinsci/ec2-plugin/blob/master/src/main/java/hudson/plugins/ec2/EC2Cloud.java
>  
> there is the following validation in doCheckSshKeysCredentialsId:
>
> boolean hasStart = false, hasEnd = false;
> BufferedReader br = new BufferedReader(new StringReader(privateKey));
> String line;
> while ((line = br.readLine()) != null) {
> if (line.equals("-BEGIN RSA PRIVATE KEY-"))
> hasStart = true;
> if (line.equals("-END RSA PRIVATE KEY-"))
> hasEnd = true;
> }
> if (!hasStart)
> return FormValidation.error("This doesn't look like a private key at 
> all");
> if (!hasEnd)
> return FormValidation
> .error("The private key is missing the trailing 'END RSA 
> PRIVATE KEY' marker. Copy error?");
>
> I have generated an *ed25519* key, with
>
> ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519
>
> SSH version:
> *OpenSSH_8.4p1 Ubuntu-5ubuntu1, OpenSSL 1.1.1j  16 Feb 2021*
>
> This key looks like
>
> -BEGIN OPENSSH PRIVATE KEY-
> (...)
> -END OPENSSH PRIVATE KEY-
>
> I can successfully use this key to connect to manually started instances 
> (with *Manage Nodes* -> *Add New Node*).
>
> I can not use this key to connect to an instance started by the EC2 
> plugin. The EC2 plugin tells me *"This doesn't look like a private key at 
> all"*.
>
> It appears as if the validation is too strict.
>
> Workaround:
> In the private key file, I replaced
> -BEGIN OPENSSH PRIVATE KEY-
> (...)
> -END OPENSSH PRIVATE KEY-
>
> with
> -BEGIN RSA PRIVATE KEY-
> (...)
> -END RSA PRIVATE KEY-
>
>
> Can someone confirm if this is an actual bug, or is the problem at my end?
> If it is a bug, then how do I proceed to file a bug report? The repo at 
> https://github.com/jenkinsci/ec2-plugin only has pull requests, no issue 
> tracker.
>

-- 
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/3abaa47f-7d0a-442f-ad7f-c12c57d7cc6en%40googlegroups.com.


Possible bug in EC2 plugin: check of SSH key may be too strict (confirmation needed before filing bug report)

2021-04-13 Thread Amedee Van Gasse
I have a question about https://github.com/jenkinsci/ec2-plugin. It may be 
a bug, but I'd like to have confirmation before I try to find out how to 
file a bug report.

In 
https://github.com/jenkinsci/ec2-plugin/blob/master/src/main/java/hudson/plugins/ec2/EC2Cloud.java
 
there is the following validation in doCheckSshKeysCredentialsId:

boolean hasStart = false, hasEnd = false;
BufferedReader br = new BufferedReader(new StringReader(privateKey));
String line;
while ((line = br.readLine()) != null) {
if (line.equals("-BEGIN RSA PRIVATE KEY-"))
hasStart = true;
if (line.equals("-END RSA PRIVATE KEY-"))
hasEnd = true;
}
if (!hasStart)
return FormValidation.error("This doesn't look like a private key at 
all");
if (!hasEnd)
return FormValidation
.error("The private key is missing the trailing 'END RSA 
PRIVATE KEY' marker. Copy error?");

I have generated an *ed25519* key, with

ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519

SSH version:
*OpenSSH_8.4p1 Ubuntu-5ubuntu1, OpenSSL 1.1.1j  16 Feb 2021*

This key looks like

-BEGIN OPENSSH PRIVATE KEY-
(...)
-END OPENSSH PRIVATE KEY-

I can successfully use this key to connect to manually started instances 
(with *Manage Nodes* -> *Add New Node*).

I can not use this key to connect to an instance started by the EC2 plugin. 
The EC2 plugin tells me *"This doesn't look like a private key at all"*.

It appears as if the validation is too strict.

Workaround:
In the private key file, I replaced
-BEGIN OPENSSH PRIVATE KEY-
(...)
-END OPENSSH PRIVATE KEY-

with
-BEGIN RSA PRIVATE KEY-
(...)
-END RSA PRIVATE KEY-


Can someone confirm if this is an actual bug, or is the problem at my end?
If it is a bug, then how do I proceed to file a bug report? The repo 
at https://github.com/jenkinsci/ec2-plugin only has pull requests, no issue 
tracker.

-- 
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/26dd4e46-c712-4b98-9559-d929c129bd06n%40googlegroups.com.


Re: Jenkins does not install one particular CustomTool (already tried: extract ZIP, shell script)

2021-03-08 Thread Amedee Van Gasse
Case closed.

I'm now pre-installing the tool on the node using Ansible, which installs 
it in C:\Program Files instead of 
C:\Users\jenkins\tools\com.cloudbees.jenkins.plugins.customtools.CustomTool\
.
Then I'm setting the path to the custom tool on the node configuration.
That works.

On Friday, March 5, 2021 at 8:39:38 PM UTC+1 Amedee Van Gasse wrote:

> I have defined a Custom Tool Tesseract, which extracts a ZIP file.
>
> In my Scripted Pipeline, I have this code:
>
> withEnv([
> "gsExec=$gsPath",
> "compareExec=$comparePath",
> "Path+TESSERACT=${tool name: 'Tesseract', type: 
> 'com.cloudbees.jenkins.plugins.customtools.CustomTool'}"
> ]) {
> configFileProvider([configFile(fileId: 
> GeneralVariables.mavenGlobalSettings, variable: 'MAVEN_SETTINGS')]) {
> withMaven(jdk: GeneralVariables.JDK_VERSION, maven: 
> GeneralVariables.Maven) {
> sh 'echo $PATH'
> sh "mvn --global-settings ${MAVEN_SETTINGS.replace '\\', '/'} 
> --no-transfer-progress --batch-mode install " +
> "--activate-profiles test -DgsExec=\"$gsPath\" 
> -DcompareExec=\"$comparePath\" -Dmaven.repo.local=.repository"
> }
> }
>
> In my Jenkins Console Log, I see this output:
>
> provisioning config files...
> copy managed file [MyGlobalSettings] to 
> file:/C:/Users/jenkins/workspace/run-cross-module-tests-java-QA-11580@tmp/config12082685466158235325tmp
> [withMaven] Options: []
> [withMaven] Available options: 
> [withMaven] using JDK installation jdk-8-oracle
> [withMaven] using Maven installation 'M3'
> + echo 
> /c/Users/jenkins/tools/hudson.model.JDK/jdk-8-oracle/bin:/c/Users/jenkins/workspace/run-cross-module-tests-java-QA-11580@tmp/withMavend1394d3e:/c/Users/jenkins/tools/com.cloudbees.jenkins.plugins.customtools.CustomTool/Tesseract/Tesseract-OCR:/mingw64/bin:/c/program
>  
> files/powershell/7:/c/Program 
> Files/ImageMagick-7.0.11-Q16-HDRI:/c/Windows/system32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0:/c/Windows/System32/OpenSSH:/c/Program
>  
> Files/Amazon/cfn-bootstrap:/c/ProgramData/chocolatey/bin:/c/Program 
> Files/OpenSSH-Win64:/c/Program 
> Files/dotnet:/cmd:/mingw64/bin:/usr/bin:/c/Program 
> Files/OpenJDK/openjdk-11.0.10_9/bin:/c/ProgramData/chocolatey/lib/maven/apache-maven-3.6.3/bin:/c/Program
>  
> Files/PowerShell/7:/c/Program 
> Files/OpenJDK/openjdk-8u282-b08/bin:/c/Program 
> Files/nodejs:/bin:/c/Windows/system32/config/systemprofile/AppData/Local/Microsoft/WindowsApps:/c/Users/jenkins/AppData/Local/Microsoft/WindowsApps
> /c/Users/jenkins/tools/hudson.model.JDK/jdk-8-oracle/bin:/c/Users/jenkins/workspace/run-cross-module-tests-java-QA-11580@tmp/withMavend1394d3e:/c/Users/jenkins/tools/com.cloudbees.jenkins.plugins.customtools.CustomTool/Tesseract/Tesseract-OCR:/mingw64/bin:/c/program
>  
> files/powershell/7:/c/Program 
> Files/ImageMagick-7.0.11-Q16-HDRI:/c/Windows/system32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0:/c/Windows/System32/OpenSSH:/c/Program
>  
> Files/Amazon/cfn-bootstrap:/c/ProgramData/chocolatey/bin:/c/Program 
> Files/OpenSSH-Win64:/c/Program 
> Files/dotnet:/cmd:/mingw64/bin:/usr/bin:/c/Program 
> Files/OpenJDK/openjdk-11.0.10_9/bin:/c/ProgramData/chocolatey/lib/maven/apache-maven-3.6.3/bin:/c/Program
>  
> Files/PowerShell/7:/c/Program 
> Files/OpenJDK/openjdk-8u282-b08/bin:/c/Program 
> Files/nodejs:/bin:/c/Windows/system32/config/systemprofile/AppData/Local/Microsoft/WindowsApps:/c/Users/jenkins/AppData/Local/Microsoft/WindowsApps
> + mvn --global-settings 
> C:/Users/jenkins/workspace/run-cross-module-tests-java-QA-11580@tmp/config12082685466158235325tmp
>  
> --no-transfer-progress --batch-mode install --activate-profiles test 
> '-DgsExec=C:/Program Files/gs/gs9.53.3/bin/gswin64c.exe' 
> '-DcompareExec=C:/Program Files/ImageMagick-7.0.11-Q16-HDRI/compare.bat' 
> -Dmaven.repo.local=.repository
>
> The PATH variable contains the Tesseract directory, 
> /c/Users/jenkins/tools/com.cloudbees.jenkins.plugins.customtools.CustomTool/Tesseract/Tesseract-OCR
> .
>
> I don't see anything in the log that actually tells me that a CustomTool 
> is actually installed.
>
> Further down in the logging, I see that Tesseract isn't found:
>
> ***REDACTED***.tesseract4.TesseractHelper ERROR Command failed: Cannot run 
> program "tesseract": CreateProcess error=2, The system cannot find the file 
> specified
> ***REDACTED***.tesseract4.Tesseract4ExecutableOcrEngine ERROR Tesseract 
> failed. Please check that tesseract is installed and provided path to 
> tesseract executable directory is correct
>
> Indeed, when I verify th

Re: jenkins and bash

2021-03-06 Thread Amedee Van Gasse
Put this as the first line in your shell scripts:

#!/bin/bash -ex

-e exits the script immediately if a command exits with a non-zero status.
-x echos the current line in the script when it's executed.

My best guess is that an error occurs in your script, which is silently 
ignored by Bash, but at the end of the script you still have a non-zero 
status.
Jenkins checks for that non-zero status and fails.


Secondly, verify your scripts with https://www.shellcheck.net/
You can use ShellCheck online, install it on your local machine, and even 
integrate it with most major editors.
Make sure that ShellCheck says "No issues detected!"


Without actually seeing the code of your shell scripts, it's at this point 
not possible to give you any further debugging tips.

Hope this helps!

-- 
Amedee
On Friday, March 5, 2021 at 6:12:03 PM UTC+1 gil.j...@gmail.com wrote:

> I have set up several jenkins jobs that do nothing more than execute bas 
> scripts, howevwe The bash scripts run fine and complete with no errors in 
> the but jenkins runs and gets errors is there a right way to debug this?

-- 
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/4d10cdf6-de13-43bf-a581-76d775ff51aen%40googlegroups.com.


Jenkins does not install one particular CustomTool (already tried: extract ZIP, shell script)

2021-03-05 Thread Amedee Van Gasse
I have defined a Custom Tool Tesseract, which extracts a ZIP file.

In my Scripted Pipeline, I have this code:

withEnv([
"gsExec=$gsPath",
"compareExec=$comparePath",
"Path+TESSERACT=${tool name: 'Tesseract', type: 
'com.cloudbees.jenkins.plugins.customtools.CustomTool'}"
]) {
configFileProvider([configFile(fileId: 
GeneralVariables.mavenGlobalSettings, variable: 'MAVEN_SETTINGS')]) {
withMaven(jdk: GeneralVariables.JDK_VERSION, maven: 
GeneralVariables.Maven) {
sh 'echo $PATH'
sh "mvn --global-settings ${MAVEN_SETTINGS.replace '\\', '/'} 
--no-transfer-progress --batch-mode install " +
"--activate-profiles test -DgsExec=\"$gsPath\" 
-DcompareExec=\"$comparePath\" -Dmaven.repo.local=.repository"
}
}

In my Jenkins Console Log, I see this output:

provisioning config files...
copy managed file [MyGlobalSettings] to 
file:/C:/Users/jenkins/workspace/run-cross-module-tests-java-QA-11580@tmp/config12082685466158235325tmp
[withMaven] Options: []
[withMaven] Available options: 
[withMaven] using JDK installation jdk-8-oracle
[withMaven] using Maven installation 'M3'
+ echo 
/c/Users/jenkins/tools/hudson.model.JDK/jdk-8-oracle/bin:/c/Users/jenkins/workspace/run-cross-module-tests-java-QA-11580@tmp/withMavend1394d3e:/c/Users/jenkins/tools/com.cloudbees.jenkins.plugins.customtools.CustomTool/Tesseract/Tesseract-OCR:/mingw64/bin:/c/program
 
files/powershell/7:/c/Program 
Files/ImageMagick-7.0.11-Q16-HDRI:/c/Windows/system32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0:/c/Windows/System32/OpenSSH:/c/Program
 
Files/Amazon/cfn-bootstrap:/c/ProgramData/chocolatey/bin:/c/Program 
Files/OpenSSH-Win64:/c/Program 
Files/dotnet:/cmd:/mingw64/bin:/usr/bin:/c/Program 
Files/OpenJDK/openjdk-11.0.10_9/bin:/c/ProgramData/chocolatey/lib/maven/apache-maven-3.6.3/bin:/c/Program
 
Files/PowerShell/7:/c/Program 
Files/OpenJDK/openjdk-8u282-b08/bin:/c/Program 
Files/nodejs:/bin:/c/Windows/system32/config/systemprofile/AppData/Local/Microsoft/WindowsApps:/c/Users/jenkins/AppData/Local/Microsoft/WindowsApps
/c/Users/jenkins/tools/hudson.model.JDK/jdk-8-oracle/bin:/c/Users/jenkins/workspace/run-cross-module-tests-java-QA-11580@tmp/withMavend1394d3e:/c/Users/jenkins/tools/com.cloudbees.jenkins.plugins.customtools.CustomTool/Tesseract/Tesseract-OCR:/mingw64/bin:/c/program
 
files/powershell/7:/c/Program 
Files/ImageMagick-7.0.11-Q16-HDRI:/c/Windows/system32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0:/c/Windows/System32/OpenSSH:/c/Program
 
Files/Amazon/cfn-bootstrap:/c/ProgramData/chocolatey/bin:/c/Program 
Files/OpenSSH-Win64:/c/Program 
Files/dotnet:/cmd:/mingw64/bin:/usr/bin:/c/Program 
Files/OpenJDK/openjdk-11.0.10_9/bin:/c/ProgramData/chocolatey/lib/maven/apache-maven-3.6.3/bin:/c/Program
 
Files/PowerShell/7:/c/Program 
Files/OpenJDK/openjdk-8u282-b08/bin:/c/Program 
Files/nodejs:/bin:/c/Windows/system32/config/systemprofile/AppData/Local/Microsoft/WindowsApps:/c/Users/jenkins/AppData/Local/Microsoft/WindowsApps
+ mvn --global-settings 
C:/Users/jenkins/workspace/run-cross-module-tests-java-QA-11580@tmp/config12082685466158235325tmp
 
--no-transfer-progress --batch-mode install --activate-profiles test 
'-DgsExec=C:/Program Files/gs/gs9.53.3/bin/gswin64c.exe' 
'-DcompareExec=C:/Program Files/ImageMagick-7.0.11-Q16-HDRI/compare.bat' 
-Dmaven.repo.local=.repository

The PATH variable contains the Tesseract directory, 
/c/Users/jenkins/tools/com.cloudbees.jenkins.plugins.customtools.CustomTool/Tesseract/Tesseract-OCR
.

I don't see anything in the log that actually tells me that a CustomTool is 
actually installed.

Further down in the logging, I see that Tesseract isn't found:

***REDACTED***.tesseract4.TesseractHelper ERROR Command failed: Cannot run 
program "tesseract": CreateProcess error=2, The system cannot find the file 
specified
***REDACTED***.tesseract4.Tesseract4ExecutableOcrEngine ERROR Tesseract 
failed. Please check that tesseract is installed and provided path to 
tesseract executable directory is correct

Indeed, when I verify the directories on the node itself, I see that the 
Tesseract directory is missing:

ls 
C:\Users\jenkins\tools\com.cloudbees.jenkins.plugins.customtools.CustomTool\ 

Directory: 
C:\Users\jenkins\tools\com.cloudbees.jenkins.plugins.customtools.CustomTool 

Mode LastWriteTime Length Name
 - -- 
d3/5/2021  6:39 PMInspectHeaders

So let me repeat this very clearly: the PATH value is correct, but the 
actual directory does not exist.

InspectHeaders is the only CustomTool that is installed (earlier in the 
pipeline, with a shell script). Tesseract, which should be extracted from a 
ZIP file, is not installed.

I have several other nodes: on Linux, it is successfully installed with apt-get 
install; and on another Windows node, it is 

Re: How to add additional mysql-connector after installing dependency-check in Jenkins Global Tool Configuration

2021-02-23 Thread Amedee Van Gasse
Never mind, I wound up writing an entire batch script directly inside the 
Jenkins Global Tool Configuration:

if exist 
C:\Jenkins\tools\org.jenkinsci.plugins.DependencyCheck.tools.DependencyCheckInstallation\Dependency_Check\dependency-check\bin\dependency-check.bat
 
(
echo "Dependency Check is already installed"
) else (
powershell -Command "Invoke-WebRequest 
https:///files/tools/dependency-check/dependency-check-6.1.1-release.zip
 
-OutFile dependency-check-6.1.1-release.zip"
powershell Expand-Archive 'dependency-check-6.1.1-release.zip' -Force 
-DestinationPath 
'C:\Jenkins\tools\org.jenkinsci.plugins.DependencyCheck.tools.DependencyCheckInstallation\Dependency_Check'
powershell -Command "Invoke-WebRequest 
https:///files/tools/dependency-check/mysql-connector-java-8.0.22.jar
 
-OutFile dependency-check/plugins/mysql-connector-java-8.0.22.jar"
del *.zip
)

It's as ugly as the night, but it works.

If anyone has an idea for a more elegant solution, please enlighten me.
On Tuesday, February 23, 2021 at 4:33:48 PM UTC+1 Amedee Van Gasse wrote:

> I'm going to use dependency-check on Jenkins to check a .NET build.
>
> I have added a Dependency-Check installation to Jenkins' Global Tool 
> Configuration.
> I'm using an install from dl.bintray.com.
>
> In my Jenkins Pipeline, I have:
>
> environment {
> DEPENDENCY_CHECK = tool name: 'Dependency Check', type: 
> 'org.jenkinsci.plugins.DependencyCheck.tools.DependencyCheckInstallation'
> }
>
> and
>
> stage('Dependency Check') {
> steps {
> println 'Dependency Check'
> println DEPENDENCY_CHECK.toString()
> }
> }
>
> (Just for now)
>
> Can confirm:
> * In the build log I see
> Unpacking 
> https://dl.bintray.com/jeremy-long/owasp/dependency-check-6.1.1-release.zip 
> to 
> C:\Jenkins\tools\org.jenkinsci.plugins.DependencyCheck.tools.DependencyCheckInstallation\Dependency_Check
>  
> on 
> * In the build log I see  
> *14:53:23* Dependency Check 
> *14:53:23*
>  
> C:\Jenkins\tools\org.jenkinsci.plugins.DependencyCheck.tools.DependencyCheckInstallation\Dependency_Check
> * On the build node, a new directory 
> C:\Jenkins\tools\org.jenkinsci.plugins.DependencyCheck.tools.DependencyCheckInstallation\Dependency_Check
>  contains 
> the correct files.
>
>
> Now.
>
> I'm using a local database in MySQL, so I need to put an additional file 
> mysql-connector-java-8.0.22.jar inside a plugins folder in the 
> installation folder.
> How do I do that in the Jenkins Global Tool Configuration? If I add a 
> second installer to copy the mysql jar, then it only installs that one 
> single jar file.
>
>

-- 
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/ce8d8dad-a383-499b-946a-a4dc7e6fc8cdn%40googlegroups.com.


How to add additional mysql-connector after installing dependency-check in Jenkins Global Tool Configuration

2021-02-23 Thread Amedee Van Gasse
I'm going to use dependency-check on Jenkins to check a .NET build.

I have added a Dependency-Check installation to Jenkins' Global Tool 
Configuration.
I'm using an install from dl.bintray.com.

In my Jenkins Pipeline, I have:

environment {
DEPENDENCY_CHECK = tool name: 'Dependency Check', type: 
'org.jenkinsci.plugins.DependencyCheck.tools.DependencyCheckInstallation'
}

and

stage('Dependency Check') {
steps {
println 'Dependency Check'
println DEPENDENCY_CHECK.toString()
}
}

(Just for now)

Can confirm:
* In the build log I see
Unpacking 
https://dl.bintray.com/jeremy-long/owasp/dependency-check-6.1.1-release.zip to 
C:\Jenkins\tools\org.jenkinsci.plugins.DependencyCheck.tools.DependencyCheckInstallation\Dependency_Check
 
on 
* In the build log I see  
*14:53:23* Dependency Check 
*14:53:23*
 
C:\Jenkins\tools\org.jenkinsci.plugins.DependencyCheck.tools.DependencyCheckInstallation\Dependency_Check
* On the build node, a new directory 
C:\Jenkins\tools\org.jenkinsci.plugins.DependencyCheck.tools.DependencyCheckInstallation\Dependency_Check
 contains 
the correct files.


Now.

I'm using a local database in MySQL, so I need to put an additional file 
mysql-connector-java-8.0.22.jar inside a plugins folder in the installation 
folder.
How do I do that in the Jenkins Global Tool Configuration? If I add a 
second installer to copy the mysql jar, then it only installs that one 
single jar file.

-- 
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/39b2e0ad-6d04-415a-a310-4e1865ac0eabn%40googlegroups.com.


Re: remove square bracket regexp in ansible playbook

2021-02-23 Thread Amedee Van Gasse
You're probably mistaken in your mailing lists, this is the Jenkins mailing 
list.
I thing you should ask over at https://groups.google.com/g/ansible-project 
(ansible-proj...@googlegroups.com)

On Monday, February 22, 2021 at 10:31:38 AM UTC+1 sakshira...@gmail.com 
wrote:

> hi all,
>
> i am new to ansible and need some advise.
> i am merging 2 lists from 2 different files and i am getting result which 
> is seperated by square bracket. 
>
> how i can remove square bracket from the file using regexp in ansible 
> playbook. 
>
> please advise. i am using lineinfile module for regep:
>
> name: Remove extra characters 
>   lineinfile :
> path: "../ip_address.txt"
> state: absent
> regexp: '^$' 
> #regexp: '^([ ]+)[^\n]+$'
> #replace: '\g<1>0.0.0.0'
> #shell: | 
> # cat ../ip_address.txt | sed 's/[][]//g'
> #regexp: ('^(.*[\\=/])')
>

-- 
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/51175a9e-9df6-42e0-8461-f7eb9a01a13cn%40googlegroups.com.


Custom Tool plugin: Enable Versions - where is the accurate documentation?

2021-02-23 Thread Amedee Van Gasse
I want to install a custom tool.
There is a checkbox "Enable Versions", and I thought, this tool may have 
multiple versions some day, let's try this.
Then a very, very complicated configuration appeared, with does not match 
the screenshots 
on https://github.com/jenkinsci/custom-tools-plugin/blob/master/README.md
I googled for "jenkins custom tool enable versions" but didn't find 
anything useful.

So I am not going to use versions of custom tools. If I ever need another 
version of a custom tool, then I'll just define it as a second custom tool.

So my question is, has anyone in the Jenkins ecosystem ever used versions 
of custom tools? And made documentation? A step-by-step walk-through with a 
real functioning example that actual people can follow? In particular in 
conjunction with a Pipeline, either Scripted or Declarative.

-- 
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/e828d251-d991-42bc-98fc-54fc541d2280n%40googlegroups.com.


Re: How to delete the old name of a renamed repository in an organization folder (multibranch pipeline)

2021-02-23 Thread Amedee Van Gasse
I care about history, so I'll wait.

On Thursday, February 18, 2021 at 5:52:09 PM UTC+1 Harry G. wrote:

> If you cannot delete on disk, I see only 2 options left:
> - wait until the bug is fixed 
> https://issues.jenkins.io/browse/JENKINS-64894 - might take some time I 
> guess 
> - if you don't care about build history, delete and recreate the entire 
> multibranch project and re-scan
>
> amedee@gmail.com schrieb am Mittwoch, 17. Februar 2021 um 19:25:24 
> UTC+1:
>
>> Here at my end the display name of the old repo is not changed.
>> Other than that, same symptoms.
>>
>> I do not have access to the disk that contains the Jenkins folders, as 
>> this is a server managed by our hosting company, and currently I do not 
>> feel comfortable with them digging deep down into the Jenkins internals.
>>
>> On Wed, Feb 17, 2021 at 6:18 PM 'Harry G.' via Jenkins Users <
>> jenkins...@googlegroups.com> wrote:
>>
>>> We have the same issue. 
>>> Dropdown delete only works for disabled branches, not for repos.
>>> And it's even worse: Jenkins recognizes the new repo name and also 
>>> renames the display name, which looks like duplicated folders if you don't 
>>> check the URL!
>>>
>>> The only workaround I see currently is to delete the folder on disk and 
>>> reload config from disk.
>>>
>>> As this seems to be a clear bug, I filed it now: 
>>> https://issues.jenkins.io/browse/JENKINS-64894
>>> This is more serious as it sounds, as it is very confusing for the users 
>>> because of the duplicate folder with same display name. 
>>> Mark Waite schrieb am Mittwoch, 17. Februar 2021 um 15:55:26 UTC+1:
>>>
>>>> I've used the "Delete" selection from the dropdown menu to remove 
>>>> individual builds (like the disabled PR jobs that are visible on 
>>>> ci.jenkins.io) and pull request jobs.  Maybe that would work for 
>>>> disabled organization folder jobs as well?
>>>>
>>>> On Wed, Feb 17, 2021 at 6:32 AM Amedee Van Gasse  
>>>> wrote:
>>>>
>>>>> I have a Bitbucket project organization folder.
>>>>> Each repository inside the project is a multibranch pipeline.
>>>>>
>>>>> A few weeks ago one of the repositories inside the project was renamed.
>>>>> The old repository name is still shown in Jenkins, as disabled.
>>>>>
>>>>> How do I remove the old repository name?
>>>>> I have already done multiple scans of the organization folder.
>>>>>
>>>>> -- 
>>>>> 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-use...@googlegroups.com.
>>>>> To view this discussion on the web visit 
>>>>> https://groups.google.com/d/msgid/jenkinsci-users/fe34c100-5d4e-4fc8-87a0-4646f94905c9n%40googlegroups.com
>>>>>  
>>>>> <https://groups.google.com/d/msgid/jenkinsci-users/fe34c100-5d4e-4fc8-87a0-4646f94905c9n%40googlegroups.com?utm_medium=email_source=footer>
>>>>> .
>>>>>
>>>> -- 
>>>
>> You received this message because you are subscribed to a topic in the 
>>> Google Groups "Jenkins Users" group.
>>> To unsubscribe from this topic, visit 
>>> https://groups.google.com/d/topic/jenkinsci-users/TcGPnRFZZvA/unsubscribe
>>> .
>>> To unsubscribe from this group and all its topics, send an email to 
>>> jenkinsci-use...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/jenkinsci-users/adcf1da2-254c-4f22-877c-6b5ee0ba8704n%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/jenkinsci-users/adcf1da2-254c-4f22-877c-6b5ee0ba8704n%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>>
>>
>>
>> -- 
>> Amedee Van Gasse
>> Email: ame...@vangasse.eu
>> Calendar: amedee@gmail.com
>> Phone: +32 485 805 674
>> Twitter: @amedee
>>
>

-- 
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/65f23d04-3845-4f7c-936f-da1c444c6cf0n%40googlegroups.com.


Re: How to delete the old name of a renamed repository in an organization folder (multibranch pipeline)

2021-02-17 Thread Amedee Van Gasse
Here at my end the display name of the old repo is not changed.
Other than that, same symptoms.

I do not have access to the disk that contains the Jenkins folders, as this
is a server managed by our hosting company, and currently I do not feel
comfortable with them digging deep down into the Jenkins internals.

On Wed, Feb 17, 2021 at 6:18 PM 'Harry G.' via Jenkins Users <
jenkinsci-users@googlegroups.com> wrote:

> We have the same issue.
> Dropdown delete only works for disabled branches, not for repos.
> And it's even worse: Jenkins recognizes the new repo name and also renames
> the display name, which looks like duplicated folders if you don't check
> the URL!
>
> The only workaround I see currently is to delete the folder on disk and
> reload config from disk.
>
> As this seems to be a clear bug, I filed it now:
> https://issues.jenkins.io/browse/JENKINS-64894
> This is more serious as it sounds, as it is very confusing for the users
> because of the duplicate folder with same display name.
> Mark Waite schrieb am Mittwoch, 17. Februar 2021 um 15:55:26 UTC+1:
>
>> I've used the "Delete" selection from the dropdown menu to remove
>> individual builds (like the disabled PR jobs that are visible on
>> ci.jenkins.io) and pull request jobs.  Maybe that would work for
>> disabled organization folder jobs as well?
>>
>> On Wed, Feb 17, 2021 at 6:32 AM Amedee Van Gasse 
>> wrote:
>>
>>> I have a Bitbucket project organization folder.
>>> Each repository inside the project is a multibranch pipeline.
>>>
>>> A few weeks ago one of the repositories inside the project was renamed.
>>> The old repository name is still shown in Jenkins, as disabled.
>>>
>>> How do I remove the old repository name?
>>> I have already done multiple scans of the organization folder.
>>>
>>> --
>>> 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-use...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/jenkinsci-users/fe34c100-5d4e-4fc8-87a0-4646f94905c9n%40googlegroups.com
>>> <https://groups.google.com/d/msgid/jenkinsci-users/fe34c100-5d4e-4fc8-87a0-4646f94905c9n%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>>
>> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Jenkins Users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/jenkinsci-users/TcGPnRFZZvA/unsubscribe.
> To unsubscribe from this group and all its topics, 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/adcf1da2-254c-4f22-877c-6b5ee0ba8704n%40googlegroups.com
> <https://groups.google.com/d/msgid/jenkinsci-users/adcf1da2-254c-4f22-877c-6b5ee0ba8704n%40googlegroups.com?utm_medium=email_source=footer>
> .
>


-- 
Amedee Van Gasse
Email: ame...@vangasse.eu
Calendar: amedee.vanga...@gmail.com
Phone: +32 485 805 674
Twitter: @amedee

-- 
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/CALhozi8_AE7jxJxXGaVhCTtM7xqbe_BALrYRbuHH18_iD1egXg%40mail.gmail.com.


Re: How to delete the old name of a renamed repository in an organization folder (multibranch pipeline)

2021-02-17 Thread Amedee Van Gasse
Doesn't work. There is no Delete.

On Wed, Feb 17, 2021 at 3:55 PM Mark Waite 
wrote:

> I've used the "Delete" selection from the dropdown menu to remove
> individual builds (like the disabled PR jobs that are visible on
> ci.jenkins.io) and pull request jobs.  Maybe that would work for disabled
> organization folder jobs as well?
>
> On Wed, Feb 17, 2021 at 6:32 AM Amedee Van Gasse <
> amedee.vanga...@gmail.com> wrote:
>
>> I have a Bitbucket project organization folder.
>> Each repository inside the project is a multibranch pipeline.
>>
>> A few weeks ago one of the repositories inside the project was renamed.
>> The old repository name is still shown in Jenkins, as disabled.
>>
>> How do I remove the old repository name?
>> I have already done multiple scans of the organization folder.
>>
>> --
>> 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/fe34c100-5d4e-4fc8-87a0-4646f94905c9n%40googlegroups.com
>> <https://groups.google.com/d/msgid/jenkinsci-users/fe34c100-5d4e-4fc8-87a0-4646f94905c9n%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Jenkins Users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/jenkinsci-users/TcGPnRFZZvA/unsubscribe.
> To unsubscribe from this group and all its topics, 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/CAO49JtGHb0VorAsxyqBu1oRpu%3DrsoB9HzknvLOrQFhd5kft2OQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/jenkinsci-users/CAO49JtGHb0VorAsxyqBu1oRpu%3DrsoB9HzknvLOrQFhd5kft2OQ%40mail.gmail.com?utm_medium=email_source=footer>
> .
>


-- 
Amedee Van Gasse
Email: ame...@vangasse.eu
Calendar: amedee.vanga...@gmail.com
Phone: +32 485 805 674
Twitter: @amedee

-- 
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/CALhozi_42jqbKmovxaZv7gGByzMcEJiY8fEBW4dUy3jFq1dQTQ%40mail.gmail.com.


How to delete the old name of a renamed repository in an organization folder (multibranch pipeline)

2021-02-17 Thread Amedee Van Gasse
I have a Bitbucket project organization folder.
Each repository inside the project is a multibranch pipeline.

A few weeks ago one of the repositories inside the project was renamed.
The old repository name is still shown in Jenkins, as disabled.

How do I remove the old repository name?
I have already done multiple scans of the organization folder.

-- 
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/fe34c100-5d4e-4fc8-87a0-4646f94905c9n%40googlegroups.com.


Re: System Groovy Script: hudson.*, jenkins.* and org.jenkinsci.* imports are not found in IntelliJ IDEA

2021-02-16 Thread Amedee Van Gasse
Oh? I didn't know that Maven also did Groovy.
You learn something new every day, don't ya?

For now I did something with Gradle. Don't know if it actually works 
because I have never used Gradle before, and I already had the jars in my 
lib folder. But anyway, as long as it #worksforme, it's good enough.

Thanks!

On Tuesday, February 16, 2021 at 2:32:05 PM UTC+1 yannick...@gmail.com 
wrote:

> Hello, maybe you could you use maven to declare the dependencies instead 
> of downloading them manually. 
> The IDE will download jars and resolve imports automatically, this is what 
> I do when I develop shared library for example.
>
> On Tue, Feb 16, 2021 at 1:47 PM Amedee Van Gasse  
> wrote:
>
>> I am happy to report that after adding the following jars to my lib 
>> folder, I no longer have errors:
>>
>> jenkins-core-2.263.3.jar  workflow-api-2.41.jar  
>> workflow-cps-2.87.jar  workflow-job-2.40.jar  
>> workflow-step-api-2.23.jar
>> jenkins-core-2.263.3-javadoc.jar  workflow-api-2.41-javadoc.jar  
>> workflow-cps-2.87-javadoc.jar  workflow-job-2.40-javadoc.jar  
>> workflow-step-api-2.23-javadoc.jar
>> jenkins-core-2.263.3-sources.jar  workflow-api-2.41-sources.jar  
>> workflow-cps-2.87-sources.jar  workflow-job-2.40-sources.jar  
>> workflow-step-api-2.23-sources.jar
>>
>> The unfortunate part is that I still have to manually hunt down the 
>> correct jars and add them to git, but at least I can finally start with 
>> coding!
>> On Tuesday, February 16, 2021 at 1:21:23 PM UTC+1 Amedee Van Gasse wrote:
>>
>>> Answering my own question for at least the hudson.* and jenkins.* 
>>> imports:
>>>
>>> * download jenkins-core for my Jenkins version from 
>>> https://repo.jenkins-ci.org/ (in my case: version 2.263.3, so I need 
>>> https://repo.jenkins-ci.org/releases/org/jenkins-ci/main/jenkins-core/2.263.3/jenkins-core-2.263.3.jar
>>> )
>>> * save the jar in a directory lib
>>> * add the jar as a library to my project
>>>
>>> Now, at least for the hudson and jenkins imports, IntelliJ doesn't 
>>> complain.
>>> I think I'll have to repeat for the Workflow plugin?
>>>
>>> Now, I know that this is the really old fashioned way of doing it, from 
>>> the days of yore from before dependency management.
>>> I'd prefer not to have the lib folder with jars added to git.
>>>
>>> What would be a nice dependency management ish way of doing it?
>>>
>>>
>>> On Tuesday, February 16, 2021 at 1:08:01 PM UTC+1 Amedee Van Gasse wrote:
>>>
>>>> Following up on my previous question about a System Groovy Script.
>>>>
>>>> I have a .groovy file in a git repo.
>>>> I have cloned the git repo to my pc.
>>>> I have opened the directory in IntelliJ IDEA.
>>>>
>>>> Now I get a lot of red text. None of the imports are found.
>>>> It looks like this:
>>>>
>>>> import hudson.model.*;
>>>> import hudson.util.*;
>>>> import jenkins.model.*;
>>>> import hudson.FilePath.FileCallable;
>>>> import hudson.slaves.OfflineCause;
>>>> import hudson.node_monitors.*;
>>>> import org.jenkinsci.plugins.workflow.job.WorkflowRun
>>>> import org.jenkinsci.plugins.workflow.flow.FlowExecution;
>>>> import org.jenkinsci.plugins.workflow.graph.FlowGraphWalker;
>>>> import org.jenkinsci.plugins.workflow.graph.FlowNode;
>>>> import org.jenkinsci.plugins.workflow.graph.StepStartNode;
>>>> import org.jenkinsci.plugins.workflow.cps.nodes.StepStartNode;
>>>> import org.jenkinsci.plugins.workflow.actions.WorkspaceAction
>>>>
>>>> How do I configure IntelliJ IDEA so that I no longer have red alerts on 
>>>> the imports?
>>>>
>>>> For the record: I did not write this code. I have been asked to 
>>>> maintain it, and fix a bug.
>>>> It's my professional opinion that all code should be under version 
>>>> control, and I don't want to edit the code directly on the Jenkins web 
>>>> pages but in a IDE so that I have syntax checking, autocomplete, and all 
>>>> the other usual conveniences.
>>>>
>>>> You are allowed to assume that there are only 3 files in the 
>>>> repository: a .groovy file, a .gitattributes and a .gitignore. I do know 
>>>> how to write code in the Groovy language, but I don't know how to set up a 
>>>> Groovy project. As an analogy: I know how to fly a 

Re: System Groovy Script: hudson.*, jenkins.* and org.jenkinsci.* imports are not found in IntelliJ IDEA

2021-02-16 Thread Amedee Van Gasse
I am happy to report that after adding the following jars to my lib folder, 
I no longer have errors:

jenkins-core-2.263.3.jar  workflow-api-2.41.jar  
workflow-cps-2.87.jar  workflow-job-2.40.jar  
workflow-step-api-2.23.jar
jenkins-core-2.263.3-javadoc.jar  workflow-api-2.41-javadoc.jar  
workflow-cps-2.87-javadoc.jar  workflow-job-2.40-javadoc.jar  
workflow-step-api-2.23-javadoc.jar
jenkins-core-2.263.3-sources.jar  workflow-api-2.41-sources.jar  
workflow-cps-2.87-sources.jar  workflow-job-2.40-sources.jar  
workflow-step-api-2.23-sources.jar

The unfortunate part is that I still have to manually hunt down the correct 
jars and add them to git, but at least I can finally start with coding!
On Tuesday, February 16, 2021 at 1:21:23 PM UTC+1 Amedee Van Gasse wrote:

> Answering my own question for at least the hudson.* and jenkins.* imports:
>
> * download jenkins-core for my Jenkins version from 
> https://repo.jenkins-ci.org/ (in my case: version 2.263.3, so I need 
> https://repo.jenkins-ci.org/releases/org/jenkins-ci/main/jenkins-core/2.263.3/jenkins-core-2.263.3.jar
> )
> * save the jar in a directory lib
> * add the jar as a library to my project
>
> Now, at least for the hudson and jenkins imports, IntelliJ doesn't 
> complain.
> I think I'll have to repeat for the Workflow plugin?
>
> Now, I know that this is the really old fashioned way of doing it, from 
> the days of yore from before dependency management.
> I'd prefer not to have the lib folder with jars added to git.
>
> What would be a nice dependency management ish way of doing it?
>
>
> On Tuesday, February 16, 2021 at 1:08:01 PM UTC+1 Amedee Van Gasse wrote:
>
>> Following up on my previous question about a System Groovy Script.
>>
>> I have a .groovy file in a git repo.
>> I have cloned the git repo to my pc.
>> I have opened the directory in IntelliJ IDEA.
>>
>> Now I get a lot of red text. None of the imports are found.
>> It looks like this:
>>
>> import hudson.model.*;
>> import hudson.util.*;
>> import jenkins.model.*;
>> import hudson.FilePath.FileCallable;
>> import hudson.slaves.OfflineCause;
>> import hudson.node_monitors.*;
>> import org.jenkinsci.plugins.workflow.job.WorkflowRun
>> import org.jenkinsci.plugins.workflow.flow.FlowExecution;
>> import org.jenkinsci.plugins.workflow.graph.FlowGraphWalker;
>> import org.jenkinsci.plugins.workflow.graph.FlowNode;
>> import org.jenkinsci.plugins.workflow.graph.StepStartNode;
>> import org.jenkinsci.plugins.workflow.cps.nodes.StepStartNode;
>> import org.jenkinsci.plugins.workflow.actions.WorkspaceAction
>>
>> How do I configure IntelliJ IDEA so that I no longer have red alerts on 
>> the imports?
>>
>> For the record: I did not write this code. I have been asked to maintain 
>> it, and fix a bug.
>> It's my professional opinion that all code should be under version 
>> control, and I don't want to edit the code directly on the Jenkins web 
>> pages but in a IDE so that I have syntax checking, autocomplete, and all 
>> the other usual conveniences.
>>
>> You are allowed to assume that there are only 3 files in the repository: 
>> a .groovy file, a .gitattributes and a .gitignore. I do know how to write 
>> code in the Groovy language, but I don't know how to set up a Groovy 
>> project. As an analogy: I know how to fly a plane, but I don't know how to 
>> take off or land.
>>
>>

-- 
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/215cec8c-1d63-42f3-b33e-29ae19646767n%40googlegroups.com.


Re: System Groovy Script: hudson.*, jenkins.* and org.jenkinsci.* imports are not found in IntelliJ IDEA

2021-02-16 Thread Amedee Van Gasse
Answering my own question for at least the hudson.* and jenkins.* imports:

* download jenkins-core for my Jenkins version 
from https://repo.jenkins-ci.org/ (in my case: version 2.263.3, so I 
need 
https://repo.jenkins-ci.org/releases/org/jenkins-ci/main/jenkins-core/2.263.3/jenkins-core-2.263.3.jar)
* save the jar in a directory lib
* add the jar as a library to my project

Now, at least for the hudson and jenkins imports, IntelliJ doesn't complain.
I think I'll have to repeat for the Workflow plugin?

Now, I know that this is the really old fashioned way of doing it, from the 
days of yore from before dependency management.
I'd prefer not to have the lib folder with jars added to git.

What would be a nice dependency management ish way of doing it?


On Tuesday, February 16, 2021 at 1:08:01 PM UTC+1 Amedee Van Gasse wrote:

> Following up on my previous question about a System Groovy Script.
>
> I have a .groovy file in a git repo.
> I have cloned the git repo to my pc.
> I have opened the directory in IntelliJ IDEA.
>
> Now I get a lot of red text. None of the imports are found.
> It looks like this:
>
> import hudson.model.*;
> import hudson.util.*;
> import jenkins.model.*;
> import hudson.FilePath.FileCallable;
> import hudson.slaves.OfflineCause;
> import hudson.node_monitors.*;
> import org.jenkinsci.plugins.workflow.job.WorkflowRun
> import org.jenkinsci.plugins.workflow.flow.FlowExecution;
> import org.jenkinsci.plugins.workflow.graph.FlowGraphWalker;
> import org.jenkinsci.plugins.workflow.graph.FlowNode;
> import org.jenkinsci.plugins.workflow.graph.StepStartNode;
> import org.jenkinsci.plugins.workflow.cps.nodes.StepStartNode;
> import org.jenkinsci.plugins.workflow.actions.WorkspaceAction
>
> How do I configure IntelliJ IDEA so that I no longer have red alerts on 
> the imports?
>
> For the record: I did not write this code. I have been asked to maintain 
> it, and fix a bug.
> It's my professional opinion that all code should be under version 
> control, and I don't want to edit the code directly on the Jenkins web 
> pages but in a IDE so that I have syntax checking, autocomplete, and all 
> the other usual conveniences.
>
> You are allowed to assume that there are only 3 files in the repository: a 
> .groovy file, a .gitattributes and a .gitignore. I do know how to write 
> code in the Groovy language, but I don't know how to set up a Groovy 
> project. As an analogy: I know how to fly a plane, but I don't know how to 
> take off or land.
>
>

-- 
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/918587c9-70dd-489d-83c8-e8b1d2820cf7n%40googlegroups.com.


System Groovy Script: hudson.*, jenkins.* and org.jenkinsci.* imports are not found in IntelliJ IDEA

2021-02-16 Thread Amedee Van Gasse
Following up on my previous question about a System Groovy Script.

I have a .groovy file in a git repo.
I have cloned the git repo to my pc.
I have opened the directory in IntelliJ IDEA.

Now I get a lot of red text. None of the imports are found.
It looks like this:

import hudson.model.*;
import hudson.util.*;
import jenkins.model.*;
import hudson.FilePath.FileCallable;
import hudson.slaves.OfflineCause;
import hudson.node_monitors.*;
import org.jenkinsci.plugins.workflow.job.WorkflowRun
import org.jenkinsci.plugins.workflow.flow.FlowExecution;
import org.jenkinsci.plugins.workflow.graph.FlowGraphWalker;
import org.jenkinsci.plugins.workflow.graph.FlowNode;
import org.jenkinsci.plugins.workflow.graph.StepStartNode;
import org.jenkinsci.plugins.workflow.cps.nodes.StepStartNode;
import org.jenkinsci.plugins.workflow.actions.WorkspaceAction

How do I configure IntelliJ IDEA so that I no longer have red alerts on the 
imports?

For the record: I did not write this code. I have been asked to maintain 
it, and fix a bug.
It's my professional opinion that all code should be under version control, 
and I don't want to edit the code directly on the Jenkins web pages but in 
a IDE so that I have syntax checking, autocomplete, and all the other usual 
conveniences.

You are allowed to assume that there are only 3 files in the repository: a 
.groovy file, a .gitattributes and a .gitignore. I do know how to write 
code in the Groovy language, but I don't know how to set up a Groovy 
project. As an analogy: I know how to fly a plane, but I don't know how to 
take off or land.

-- 
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/508faaef-497b-4914-b0d4-5522da131cf9n%40googlegroups.com.


How to get a System Groovy Script in Git

2021-02-15 Thread Amedee Van Gasse
Someone here at the company wrote a "System Groovy Script" that runs as a 
nightly job on master.
The code of the script, all 100 lines of it, is directly in the job 
configuration in the web interface.
I would like to get that code in a git repository, so that it's easy to 
roll back if needed, and also so that it is easier to read and write when I 
have the code open in IntelliJ.
What would be a "best practice" to do that?

I see that the Groovy plugin has only two options:
* code directly in the job config
* a groovy file, I assume somewhere in the job workspace, but that isn't 
specified.
Would I need another configuration before that? In "Source Code Management"?

How would you do it?

-- 
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/b5a6dc9d-0976-469c-8ae3-c17aaff05427n%40googlegroups.com.


Re: Set-Variable : Cannot process command because of one or more missing mandatory parameters: Name.

2021-02-12 Thread Amedee Van Gasse
I just noticed that there is still an error:

Set-Variable: Cannot process command because of one or more missing 
mandatory parameters: Name.

That is because in *Bash* (Linux) and *MS-DOS* (Windows), you can just type 
set to get a list of all environment variables.
However, in *PowerShell* (cross-platform), the equivalent command is ls Env: 
(including 
the colon : at the end!)
If you type set in PowerShell, it interprets that as the cmdlet Set-Variable, 
which expects a mandatory parameter -Name.

Fortunately this is not a fatal error for the Jenkins connection, because 
it's just a debugging statement.

-- 
Amedee

On Friday, February 12, 2021 at 11:42:12 AM UTC+1 Amedee Van Gasse wrote:

> I'm happy to report that Jenkins works fine with PowerShell 7!
>
>
> I have this in my connection log:
>
> [02/12/21 10:58:38] [SSH] SSH host key matches key seen previously for 
> this host. Connection will be allowed.
> [02/12/21 10:58:38] [SSH] Authentication successful.
> [02/12/21 10:58:50] [SSH] The remote user's environment is:
> [91mSet-Variable: [91mCannot process command because of one or more 
> missing mandatory parameters: Name. [0m
> [02/12/21 10:58:53] [SSH] Checking java version of 
> C:\Users\jenkins/jdk/bin/java
> [02/12/21 10:58:57] [SSH] C:\Users\jenkins/jdk/bin/java -version returned 
> 11.0.10.
> [02/12/21 10:58:57] [SSH] Starting sftp client.
> [02/12/21 10:58:58] [SSH] Copying latest remoting.jar...
> [02/12/21 10:58:59] [SSH] Copied 1,521,553 bytes.
> Expanded the channel window size to 4MB
> [02/12/21 10:58:59] [SSH] Starting agent process: cd "C:\Users\jenkins" && 
> C:\Users\jenkins/jdk/bin/java  -jar remoting.jar -workDir C:\Users\jenkins 
> -jar-cache C:\Users\jenkins/remoting/jarCache
> Feb 12, 2021 9:59:02 AM org.jenkinsci.remoting.engine.WorkDirManager 
> initializeWorkDir
> INFO: Using C:\Users\jenkins\remoting as a remoting work directory
> Feb 12, 2021 9:59:02 AM org.jenkinsci.remoting.engine.WorkDirManager 
> setupLogging
> INFO: Both error and output logs will be printed to 
> C:\Users\jenkins\remoting
> <===[JENKINS REMOTING CAPACITY]===>channel started
> Remoting version: 4.5
> This is a Windows agent
> WARNING: An illegal reflective access operation has occurred
> WARNING: Illegal reflective access by 
> org.jenkinsci.plugins.envinject.service.EnvInjectMasterEnvVarsSetter to 
> field java.lang.reflect.Field.modifiers
> WARNING: Please consider reporting this to the maintainers of 
> org.jenkinsci.plugins.envinject.service.EnvInjectMasterEnvVarsSetter
> WARNING: Use --illegal-access=warn to enable warnings of further illegal 
> reflective access operations
> WARNING: All illegal access operations will be denied in a future release
> Agent successfully connected and online
> The Agent is connected, disconnect it before to try to connect it again.
>
> The An illegal reflective access operation has occurred is probably 
> something something Java 11, and I always ignore such warnings.
> Maybe someone should consider reporting this to the maintainers of 
> org.jenkinsci.plugins.envinject.service.EnvInjectMasterEnvVarsSetter? :-)
>
>
> This is how I configured the node with Ansible:
>
> - name: Install Win32-OpenSSH service
>   win_chocolatey:
> name: openssh
> package_params: /SSHServerFeature
> state: present
>   ignore_errors: yes
>
> - name: Install Powershell Core
>   win_chocolatey:
> name: powershell-core
> state: present
>
> - name: Set the default SSH shell to PowerShell
>   win_regedit:
> path: HKLM:\SOFTWARE\OpenSSH
> name: DefaultShell
> data: C:\Program Files\PowerShell\7\pwsh.exe
>
> The ignore_errors: yes with openssh is because I use the same Ansible 
> playbook for Packer (which goes to AWS) and Vagrant (which is for testing 
> on my local machine), and the local VM already has SSH running and I 
> haven't bothered yet with debugging that, so I just ignore the error when 
> Chcoclatey can't install OpenSSH due to port 22 already in use.
>
> But anyway: for anyone not using Ansible: you need to set the registry key 
> HKLM:\SOFTWARE\OpenSSH to the full path of pwsh.exe.
> Powershell legacy and Powershell Core have a different executable name, 
> intentionally, so they can be used side-by-side.
>
> I hope this is useful for anyone.
>
> -- 
> Amedee
>
>
> On Thursday, February 11, 2021 at 11:32:53 AM UTC+1 Amedee Van Gasse wrote:
>
>> That would actually be great and very much appreciated.
>>
>>
>> I've been down the rabbit hole a bit further and found something that may 
>> be of interest.
>>
>> From what I've seen from the error, Jenkins sends compound shell commands 
>> to the node, with

Re: Set-Variable : Cannot process command because of one or more missing mandatory parameters: Name.

2021-02-12 Thread Amedee Van Gasse
I'm happy to report that Jenkins works fine with PowerShell 7!


I have this in my connection log:

[02/12/21 10:58:38] [SSH] SSH host key matches key seen previously for this 
host. Connection will be allowed.
[02/12/21 10:58:38] [SSH] Authentication successful.
[02/12/21 10:58:50] [SSH] The remote user's environment is:
 [91mSet-Variable:  [91mCannot process command because of one or more 
missing mandatory parameters: Name. [0m
[02/12/21 10:58:53] [SSH] Checking java version of 
C:\Users\jenkins/jdk/bin/java
[02/12/21 10:58:57] [SSH] C:\Users\jenkins/jdk/bin/java -version returned 
11.0.10.
[02/12/21 10:58:57] [SSH] Starting sftp client.
[02/12/21 10:58:58] [SSH] Copying latest remoting.jar...
[02/12/21 10:58:59] [SSH] Copied 1,521,553 bytes.
Expanded the channel window size to 4MB
[02/12/21 10:58:59] [SSH] Starting agent process: cd "C:\Users\jenkins" && 
C:\Users\jenkins/jdk/bin/java  -jar remoting.jar -workDir C:\Users\jenkins 
-jar-cache C:\Users\jenkins/remoting/jarCache
Feb 12, 2021 9:59:02 AM org.jenkinsci.remoting.engine.WorkDirManager 
initializeWorkDir
INFO: Using C:\Users\jenkins\remoting as a remoting work directory
Feb 12, 2021 9:59:02 AM org.jenkinsci.remoting.engine.WorkDirManager 
setupLogging
INFO: Both error and output logs will be printed to 
C:\Users\jenkins\remoting
<===[JENKINS REMOTING CAPACITY]===>channel started
Remoting version: 4.5
This is a Windows agent
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by 
org.jenkinsci.plugins.envinject.service.EnvInjectMasterEnvVarsSetter to 
field java.lang.reflect.Field.modifiers
WARNING: Please consider reporting this to the maintainers of 
org.jenkinsci.plugins.envinject.service.EnvInjectMasterEnvVarsSetter
WARNING: Use --illegal-access=warn to enable warnings of further illegal 
reflective access operations
WARNING: All illegal access operations will be denied in a future release
Agent successfully connected and online
The Agent is connected, disconnect it before to try to connect it again.

The An illegal reflective access operation has occurred is probably 
something something Java 11, and I always ignore such warnings.
Maybe someone should consider reporting this to the maintainers of 
org.jenkinsci.plugins.envinject.service.EnvInjectMasterEnvVarsSetter? :-)


This is how I configured the node with Ansible:

- name: Install Win32-OpenSSH service
  win_chocolatey:
name: openssh
package_params: /SSHServerFeature
state: present
  ignore_errors: yes

- name: Install Powershell Core
  win_chocolatey:
name: powershell-core
state: present

- name: Set the default SSH shell to PowerShell
  win_regedit:
path: HKLM:\SOFTWARE\OpenSSH
name: DefaultShell
data: C:\Program Files\PowerShell\7\pwsh.exe

The ignore_errors: yes with openssh is because I use the same Ansible 
playbook for Packer (which goes to AWS) and Vagrant (which is for testing 
on my local machine), and the local VM already has SSH running and I 
haven't bothered yet with debugging that, so I just ignore the error when 
Chcoclatey can't install OpenSSH due to port 22 already in use.

But anyway: for anyone not using Ansible: you need to set the registry key 
HKLM:\SOFTWARE\OpenSSH to the full path of pwsh.exe.
Powershell legacy and Powershell Core have a different executable name, 
intentionally, so they can be used side-by-side.

I hope this is useful for anyone.

-- 
Amedee


On Thursday, February 11, 2021 at 11:32:53 AM UTC+1 Amedee Van Gasse wrote:

> That would actually be great and very much appreciated.
>
>
> I've been down the rabbit hole a bit further and found something that may 
> be of interest.
>
> From what I've seen from the error, Jenkins sends compound shell commands 
> to the node, with "&&" as pipeline chain operator.
> "&&" has the same function in Bash as well as in MS-DOS.
> PowerShell Windows (up to version 5 I guess) doesn't know '&&', there you 
> have to use '-and'.
> However, PowerShell 7 (PowerShell Core, the open source cross-platform 
> version) does implement pipeline chain operators.
> See 
> https://docs.microsoft.com/en-us/powershell/scripting/whats-new/what-s-new-in-powershell-70?view=powershell-7
>
> I don't know if that will solve all of the issues with PowerShell, but 
> it's definitely worth giving a shot.
> I'll try it out and report back here.
>
> On Wednesday, February 10, 2021 at 8:05:15 PM UTC+1 slide wrote:
>
>> FYI, I started to look at this again and will hopefully have a PR soon.
>>
>> On Tue, Feb 9, 2021, 08:07 Slide  wrote:
>>
>>> That will cause problems, the ssh-agents-plugin is not set up to handle 
>>> PowerShell as the default shell. I looked into it a while back but didn't 
>>> make good progress.
>>>
>>> On Tue, Feb 9, 2021 at 2:45 AM Amedee Va

Re: Set-Variable : Cannot process command because of one or more missing mandatory parameters: Name.

2021-02-11 Thread Amedee Van Gasse
That would actually be great and very much appreciated.


I've been down the rabbit hole a bit further and found something that may 
be of interest.

>From what I've seen from the error, Jenkins sends compound shell commands 
to the node, with "&&" as pipeline chain operator.
"&&" has the same function in Bash as well as in MS-DOS.
PowerShell Windows (up to version 5 I guess) doesn't know '&&', there you 
have to use '-and'.
However, PowerShell 7 (PowerShell Core, the open source cross-platform 
version) does implement pipeline chain operators.
See 
https://docs.microsoft.com/en-us/powershell/scripting/whats-new/what-s-new-in-powershell-70?view=powershell-7

I don't know if that will solve all of the issues with PowerShell, but it's 
definitely worth giving a shot.
I'll try it out and report back here.

On Wednesday, February 10, 2021 at 8:05:15 PM UTC+1 slide wrote:

> FYI, I started to look at this again and will hopefully have a PR soon.
>
> On Tue, Feb 9, 2021, 08:07 Slide  wrote:
>
>> That will cause problems, the ssh-agents-plugin is not set up to handle 
>> PowerShell as the default shell. I looked into it a while back but didn't 
>> make good progress.
>>
>> On Tue, Feb 9, 2021 at 2:45 AM Amedee Van Gasse  
>> wrote:
>>
>>> FYI PowerShell is the default SSH shell on this machine.
>>>
>>> On Tuesday, February 9, 2021 at 10:27:38 AM UTC+1 Amedee Van Gasse wrote:
>>>
>>>> I got this when connecting to a Windows node, how do I fix this?
>>>>
>>>> [02/09/21 10:20:58] [SSH] SSH host key matches key seen previously for 
>>>> this host. Connection will be allowed.
>>>> [02/09/21 10:20:58] [SSH] Authentication successful.
>>>> [02/09/21 10:20:59] [SSH] The remote user's environment is:
>>>> Set-Variable : Cannot process command because of one or more missing 
>>>> mandatory parameters: Name.
>>>> At line:1 char:1
>>>> + set
>>>> + ~~~
>>>> + CategoryInfo  : InvalidArgument: (:) [Set-Variable], 
>>>> ParameterBindingException
>>>> + FullyQualifiedErrorId : 
>>>> MissingMandatoryParameter,Microsoft.PowerShell.Commands.SetVariableCommand
>>>>  
>>>> [02/09/21 10:21:00] [SSH] Checking java version of 
>>>> C:\Users\jenkins/jdk/bin/java
>>>> [02/09/21 10:21:01] [SSH] C:\Users\jenkins/jdk/bin/java -version 
>>>> returned 11.0.10.
>>>> [02/09/21 10:21:01] [SSH] Starting sftp client.
>>>> [02/09/21 10:21:01] [SSH] Copying latest remoting.jar...
>>>> [02/09/21 10:21:02] [SSH] Copied 1,521,553 bytes.
>>>> Expanded the channel window size to 4MB
>>>> [02/09/21 10:21:02] [SSH] Starting agent process: cd "C:\Users\jenkins" 
>>>> && C:\Users\jenkins/jdk/bin/java  -jar remoting.jar -workDir 
>>>> C:\Users\jenkins -jar-cache C:\Users\jenkins/remoting/jarCache
>>>> At line:1 char:23
>>>> + cd "C:\Users\jenkins" && C:\Users\jenkins/jdk/bin/java  -jar remoting 
>>>> ...
>>>> +   ~~
>>>> The token '&&' is not a valid statement separator in this version.
>>>> + CategoryInfo  : ParserError: (:) [], 
>>>> ParentContainsErrorRecordException
>>>> + FullyQualifiedErrorId : InvalidEndOfLine
>>>>  
>>>> Agent JVM has terminated. Exit code=1
>>>> [02/09/21 10:21:02] Launch failed - cleaning up connection
>>>> [02/09/21 10:21:02] [SSH] Connection closed.
>>>> SSHLauncher{host='ec2-3-123-229-137.eu-central-1.compute.amazonaws.com', 
>>>> port=22, credentialsId='b56e65e1-beb0-4ad3-bcaa-e9c7aea3c4f8', 
>>>> jvmOptions='', javaPath='', prefixStartSlaveCmd='', 
>>>> suffixStartSlaveCmd='', 
>>>> launchTimeoutSeconds=60, maxNumRetries=10, retryWaitTime=15, 
>>>> sshHostKeyVerificationStrategy=hudson.plugins.sshslaves.verifiers.ManuallyTrustedKeyVerificationStrategy,
>>>>  
>>>> tcpNoDelay=true, trackCredentials=true}
>>>> [02/09/21 10:21:02] [SSH] Opening SSH connection to 
>>>> ec2-3-123-229-137.eu-central-1.compute.amazonaws.com:22.
>>>> [02/09/21 10:21:03] [SSH] SSH host key matches key seen previously for 
>>>> this host. Connection will be allowed.
>>>> [02/09/21 10:21:03] [SSH] Authentication successful.
>>>> [02/09/21 10:21:03] [SSH] The remote user's environment is:
>>>> Set-Variable : Cannot process command because of one or more missing 
>>>> manda

java.lang.NoClassDefFoundError: Could not initialize class com.sun.proxy.$Proxy9

2021-02-11 Thread Amedee Van Gasse
Jenkins version: 2.263.3
Jenkins master: Linux
Jenkins node: Windows Server 2019
Job: multibranch pipeline with Maven build steps

Build fails with

hudson.remoting.Channel$CallSiteStackTrace: Remote call to 
aws-windows-eu-central-1
at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1800)
at 
hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:357)
at hudson.remoting.Channel.call(Channel.java:1001)
at hudson.FilePath.act(FilePath.java:1157)
at hudson.FilePath.act(FilePath.java:1146)
at org.jenkinsci.plugins.gitclient.Git.getClient(Git.java:121)
at hudson.plugins.git.GitSCM.createClient(GitSCM.java:907)
at hudson.plugins.git.GitSCM.createClient(GitSCM.java:838)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1291)
at 
org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:125)
at 
org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:93)
at 
org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:80)
at 
org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
java.lang.NoClassDefFoundError: Could not initialize class 
com.sun.proxy.$Proxy9
at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native 
Method)
at 
jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at 
jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:1022)
at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:1008)
at 
hudson.remoting.RemoteInvocationHandler.wrap(RemoteInvocationHandler.java:169)
at hudson.remoting.Channel.export(Channel.java:813)
at hudson.remoting.Channel.export(Channel.java:776)
at 
org.jenkinsci.plugins.gitclient.LegacyCompatibleGitAPIImpl.writeReplace(LegacyCompatibleGitAPIImpl.java:204)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at 
jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:566)
at java.io.ObjectStreamClass.invokeWriteReplace(ObjectStreamClass.java:1235)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1137)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:349)
at hudson.remoting.UserRequest._serialize(UserRequest.java:263)
at hudson.remoting.UserRequest.serialize(UserRequest.java:272)
at hudson.remoting.UserRequest.perform(UserRequest.java:222)
at hudson.remoting.UserRequest.perform(UserRequest.java:54)
at hudson.remoting.Request$2.run(Request.java:375)
at 
hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:73)
at java.util.concurrent.FutureTask.run(FutureTask.java:264)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.lang.Thread.run(Thread.java:834)
Caused: java.io.IOException: Remote call on aws-windows-eu-central-1 failed
at hudson.remoting.Channel.call(Channel.java:1007)
at hudson.FilePath.act(FilePath.java:1157)
at hudson.FilePath.act(FilePath.java:1146)
at org.jenkinsci.plugins.gitclient.Git.getClient(Git.java:121)
at hudson.plugins.git.GitSCM.createClient(GitSCM.java:907)
at hudson.plugins.git.GitSCM.createClient(GitSCM.java:838)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1291)
at 
org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:125)
at 
org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:93)
at 
org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:80)
at 
org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)



And in the node log:

SEVERE: Failed to load Jenkins.class
java.lang.NoClassDefFoundError: Could not initialize class 
com.thoughtworks.xstream.core.util.CompositeClassLoader
at 

Re: Set-Variable : Cannot process command because of one or more missing mandatory parameters: Name.

2021-02-09 Thread Amedee Van Gasse
FYI PowerShell is the default SSH shell on this machine.

On Tuesday, February 9, 2021 at 10:27:38 AM UTC+1 Amedee Van Gasse wrote:

> I got this when connecting to a Windows node, how do I fix this?
>
> [02/09/21 10:20:58] [SSH] SSH host key matches key seen previously for 
> this host. Connection will be allowed.
> [02/09/21 10:20:58] [SSH] Authentication successful.
> [02/09/21 10:20:59] [SSH] The remote user's environment is:
> Set-Variable : Cannot process command because of one or more missing 
> mandatory parameters: Name.
> At line:1 char:1
> + set
> + ~~~
> + CategoryInfo  : InvalidArgument: (:) [Set-Variable], 
> ParameterBindingException
> + FullyQualifiedErrorId : 
> MissingMandatoryParameter,Microsoft.PowerShell.Commands.SetVariableCommand
>  
> [02/09/21 10:21:00] [SSH] Checking java version of 
> C:\Users\jenkins/jdk/bin/java
> [02/09/21 10:21:01] [SSH] C:\Users\jenkins/jdk/bin/java -version returned 
> 11.0.10.
> [02/09/21 10:21:01] [SSH] Starting sftp client.
> [02/09/21 10:21:01] [SSH] Copying latest remoting.jar...
> [02/09/21 10:21:02] [SSH] Copied 1,521,553 bytes.
> Expanded the channel window size to 4MB
> [02/09/21 10:21:02] [SSH] Starting agent process: cd "C:\Users\jenkins" && 
> C:\Users\jenkins/jdk/bin/java  -jar remoting.jar -workDir C:\Users\jenkins 
> -jar-cache C:\Users\jenkins/remoting/jarCache
> At line:1 char:23
> + cd "C:\Users\jenkins" && C:\Users\jenkins/jdk/bin/java  -jar remoting ...
> +   ~~
> The token '&&' is not a valid statement separator in this version.
> + CategoryInfo  : ParserError: (:) [], 
> ParentContainsErrorRecordException
> + FullyQualifiedErrorId : InvalidEndOfLine
>  
> Agent JVM has terminated. Exit code=1
> [02/09/21 10:21:02] Launch failed - cleaning up connection
> [02/09/21 10:21:02] [SSH] Connection closed.
> SSHLauncher{host='ec2-3-123-229-137.eu-central-1.compute.amazonaws.com', 
> port=22, credentialsId='b56e65e1-beb0-4ad3-bcaa-e9c7aea3c4f8', 
> jvmOptions='', javaPath='', prefixStartSlaveCmd='', suffixStartSlaveCmd='', 
> launchTimeoutSeconds=60, maxNumRetries=10, retryWaitTime=15, 
> sshHostKeyVerificationStrategy=hudson.plugins.sshslaves.verifiers.ManuallyTrustedKeyVerificationStrategy,
>  
> tcpNoDelay=true, trackCredentials=true}
> [02/09/21 10:21:02] [SSH] Opening SSH connection to 
> ec2-3-123-229-137.eu-central-1.compute.amazonaws.com:22.
> [02/09/21 10:21:03] [SSH] SSH host key matches key seen previously for 
> this host. Connection will be allowed.
> [02/09/21 10:21:03] [SSH] Authentication successful.
> [02/09/21 10:21:03] [SSH] The remote user's environment is:
> Set-Variable : Cannot process command because of one or more missing 
> mandatory parameters: Name.
> At line:1 char:1
> + set
> + ~~~
> + CategoryInfo  : InvalidArgument: (:) [Set-Variable], 
> ParameterBindingException
> + FullyQualifiedErrorId : 
> MissingMandatoryParameter,Microsoft.PowerShell.Commands.SetVariableCommand
>  
> [02/09/21 10:21:04] [SSH] Checking java version of 
> C:\Users\jenkins/jdk/bin/java
> [02/09/21 10:21:04] [SSH] C:\Users\jenkins/jdk/bin/java -version returned 
> 11.0.10.
> [02/09/21 10:21:04] [SSH] Starting sftp client.
> [02/09/21 10:21:04] [SSH] Copying latest remoting.jar...
> Source agent hash is D866F0B482DB94F38E49B26B465D5DB5. Installed agent 
> hash is D866F0B482DB94F38E49B26B465D5DB5
> Verified agent jar. No update is necessary.
> Expanded the channel window size to 4MB
> [02/09/21 10:21:09] [SSH] Starting agent process: cd "C:\Users\jenkins" && 
> C:\Users\jenkins/jdk/bin/java  -jar remoting.jar -workDir C:\Users\jenkins 
> -jar-cache C:\Users\jenkins/remoting/jarCache
> At line:1 char:23
> + cd "C:\Users\jenkins" && C:\Users\jenkins/jdk/bin/java  -jar remoting ...
> +   ~~
> The token '&&' is not a valid statement separator in this version.
> + CategoryInfo  : ParserError: (:) [], 
> ParentContainsErrorRecordException
> + FullyQualifiedErrorId : InvalidEndOfLine
>  
> Agent JVM has terminated. Exit code=1
> [02/09/21 10:21:10] Launch failed - cleaning up connection
> [02/09/21 10:21:10] [SSH] Connection closed.
> connect timed out
> SSH Connection failed with IOException: "connect timed out", retrying in 
> 15 seconds. There are 2 more retries left.
> connect timed out
> SSH Connection failed with IOException: "connect timed out", retrying in 
> 15 seconds. There are 1 more retries left.
> connect timed out
> ERROR: Connection is not established!
> java.lang.IllegalStateException: Connection is not estab

Set-Variable : Cannot process command because of one or more missing mandatory parameters: Name.

2021-02-09 Thread Amedee Van Gasse
I got this when connecting to a Windows node, how do I fix this?

[02/09/21 10:20:58] [SSH] SSH host key matches key seen previously for this 
host. Connection will be allowed.
[02/09/21 10:20:58] [SSH] Authentication successful.
[02/09/21 10:20:59] [SSH] The remote user's environment is:
Set-Variable : Cannot process command because of one or more missing 
mandatory parameters: Name.
At line:1 char:1
+ set
+ ~~~
+ CategoryInfo  : InvalidArgument: (:) [Set-Variable], 
ParameterBindingException
+ FullyQualifiedErrorId : 
MissingMandatoryParameter,Microsoft.PowerShell.Commands.SetVariableCommand
 
[02/09/21 10:21:00] [SSH] Checking java version of 
C:\Users\jenkins/jdk/bin/java
[02/09/21 10:21:01] [SSH] C:\Users\jenkins/jdk/bin/java -version returned 
11.0.10.
[02/09/21 10:21:01] [SSH] Starting sftp client.
[02/09/21 10:21:01] [SSH] Copying latest remoting.jar...
[02/09/21 10:21:02] [SSH] Copied 1,521,553 bytes.
Expanded the channel window size to 4MB
[02/09/21 10:21:02] [SSH] Starting agent process: cd "C:\Users\jenkins" && 
C:\Users\jenkins/jdk/bin/java  -jar remoting.jar -workDir C:\Users\jenkins 
-jar-cache C:\Users\jenkins/remoting/jarCache
At line:1 char:23
+ cd "C:\Users\jenkins" && C:\Users\jenkins/jdk/bin/java  -jar remoting ...
+   ~~
The token '&&' is not a valid statement separator in this version.
+ CategoryInfo  : ParserError: (:) [], 
ParentContainsErrorRecordException
+ FullyQualifiedErrorId : InvalidEndOfLine
 
Agent JVM has terminated. Exit code=1
[02/09/21 10:21:02] Launch failed - cleaning up connection
[02/09/21 10:21:02] [SSH] Connection closed.
SSHLauncher{host='ec2-3-123-229-137.eu-central-1.compute.amazonaws.com', 
port=22, credentialsId='b56e65e1-beb0-4ad3-bcaa-e9c7aea3c4f8', 
jvmOptions='', javaPath='', prefixStartSlaveCmd='', suffixStartSlaveCmd='', 
launchTimeoutSeconds=60, maxNumRetries=10, retryWaitTime=15, 
sshHostKeyVerificationStrategy=hudson.plugins.sshslaves.verifiers.ManuallyTrustedKeyVerificationStrategy,
 
tcpNoDelay=true, trackCredentials=true}
[02/09/21 10:21:02] [SSH] Opening SSH connection to 
ec2-3-123-229-137.eu-central-1.compute.amazonaws.com:22.
[02/09/21 10:21:03] [SSH] SSH host key matches key seen previously for this 
host. Connection will be allowed.
[02/09/21 10:21:03] [SSH] Authentication successful.
[02/09/21 10:21:03] [SSH] The remote user's environment is:
Set-Variable : Cannot process command because of one or more missing 
mandatory parameters: Name.
At line:1 char:1
+ set
+ ~~~
+ CategoryInfo  : InvalidArgument: (:) [Set-Variable], 
ParameterBindingException
+ FullyQualifiedErrorId : 
MissingMandatoryParameter,Microsoft.PowerShell.Commands.SetVariableCommand
 
[02/09/21 10:21:04] [SSH] Checking java version of 
C:\Users\jenkins/jdk/bin/java
[02/09/21 10:21:04] [SSH] C:\Users\jenkins/jdk/bin/java -version returned 
11.0.10.
[02/09/21 10:21:04] [SSH] Starting sftp client.
[02/09/21 10:21:04] [SSH] Copying latest remoting.jar...
Source agent hash is D866F0B482DB94F38E49B26B465D5DB5. Installed agent hash 
is D866F0B482DB94F38E49B26B465D5DB5
Verified agent jar. No update is necessary.
Expanded the channel window size to 4MB
[02/09/21 10:21:09] [SSH] Starting agent process: cd "C:\Users\jenkins" && 
C:\Users\jenkins/jdk/bin/java  -jar remoting.jar -workDir C:\Users\jenkins 
-jar-cache C:\Users\jenkins/remoting/jarCache
At line:1 char:23
+ cd "C:\Users\jenkins" && C:\Users\jenkins/jdk/bin/java  -jar remoting ...
+   ~~
The token '&&' is not a valid statement separator in this version.
+ CategoryInfo  : ParserError: (:) [], 
ParentContainsErrorRecordException
+ FullyQualifiedErrorId : InvalidEndOfLine
 
Agent JVM has terminated. Exit code=1
[02/09/21 10:21:10] Launch failed - cleaning up connection
[02/09/21 10:21:10] [SSH] Connection closed.
connect timed out
SSH Connection failed with IOException: "connect timed out", retrying in 15 
seconds. There are 2 more retries left.
connect timed out
SSH Connection failed with IOException: "connect timed out", retrying in 15 
seconds. There are 1 more retries left.
connect timed out
ERROR: Connection is not established!
java.lang.IllegalStateException: Connection is not established!
at com.trilead.ssh2.Connection.getRemainingAuthMethods(Connection.java:988)
at 
com.cloudbees.jenkins.plugins.sshcredentials.impl.TrileadSSHPublicKeyAuthenticator.getRemainingAuthMethods(TrileadSSHPublicKeyAuthenticator.java:88)
at 
com.cloudbees.jenkins.plugins.sshcredentials.impl.TrileadSSHPublicKeyAuthenticator.canAuthenticate(TrileadSSHPublicKeyAuthenticator.java:80)
at 
com.cloudbees.jenkins.plugins.sshcredentials.SSHAuthenticator.newInstance(SSHAuthenticator.java:218)
at 
com.cloudbees.jenkins.plugins.sshcredentials.SSHAuthenticator.newInstance(SSHAuthenticator.java:171)
at hudson.plugins.sshslaves.SSHLauncher.openConnection(SSHLauncher.java:865)
at hudson.plugins.sshslaves.SSHLauncher$1.call(SSHLauncher.java:436)
at 

SSH connection issue with Host Key Verification Strategy

2021-01-12 Thread Amedee Van Gasse
Current Host Key Verification Strategy is Non Verifying Verification 
Strategy.
This works, but is not secure.

The agent is created using Packer, and Ansible as provisioner, and then 
started with Terraform.

This Ansible playbook uploads the files id_ed25519 and id_ed25519.pub to 
the .ssh directory of user jenkins.

---

- name: Add the user 'jenkins'
user:
name: jenkins
create_home: yes
home: /home/jenkins

- name: Copy SSH keys
copy:
src: ./files/.ssh
dest: /home/jenkins/
owner: jenkins
mode: 0600

- name: Set permissions on private key
file:
path: /home/jenkins/.ssh/id_ed25519
mode: 0400

- name: Set authorized key taken from file
ansible.posix.authorized_key:
user: jenkins
key: "{{ lookup('file', './files/.ssh/id_ed25519.pub') }}"
state: present
exclusive: True


In Jenkins, Manage Jenkins, Manage Credentials I have added a "SSH Username 
with private key". In the field Private Key I have put the content of 
id_ed25519.

In Jenkins, Manage Jenkins, Manage Nodes I have added a node:
* Launch agents via SSH
* Host: DNS name I get from Terraform or AWS console
* Credentials: the SSH username + private key from the previous step
* Host Key Verification Strategy:
--> Non verifying: works, but is not secure
--> Known hosts file: I have no access to files on the server, so I cannot 
use this
--> Manually provided key: I paste the contents of id_ed25519.pub. Results 
in WARNING: The SSH key for this host does not match the key required in 
the connection configuration. Connections will be denied until the host key 
matches the configuration key. Key exchange was not finished, connection is 
closed.
--> Manually trusted key: works, but couldn't I theoretically have a 
man-in-the-middle attack on the very first connection of a new node?

My questions are:
* Is Manually trusted key Verification Strategy, without "Require manual 
verification of initial connection", more secure than Non verifying 
Verification Strategy?
* What are the downsides of Manually trusted key Verification Strategy?
* How come Manually provided key Verification Strategy didn't work?

-- 
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/654c1ca0-0e62-4ad2-af11-d5d725958fadn%40googlegroups.com.


Re: Windows agent connected over ssh - requires elevation to install jdk-8-oracle

2020-12-18 Thread Amedee Van Gasse
Well, this has all been very interesting, and I am truly grateful for the 
time you took to write your answers.
I went with the backup plan - zipping the Oracle JDK 8 directory and then 
letting Jenkins get it from Artifactory. That works good enough for me.
I think that the conclusion is that the Oracle JDK installation executable 
is just something particularly nasty that has to be worked around...

On Friday, December 18, 2020 at 7:33:18 PM UTC+1 Mark Waite wrote:

> On Fri, Dec 18, 2020 at 10:29 AM Amedee Van Gasse  
> wrote:
>
>> The Oracle JDK is a requirement for a non-technical reason, and I am not 
>> at liberty to discuss the nature of those non-technical requirements on a 
>> public communication channel.
>> I know, that sounds more mysterious than it actually is. :-)
>>
>> An Oracle JDK license is only required for Oracle Java SE 11+, and for 
>> updates to Oracle Java SE 8 released after January 2019.
>> From which you can deduce that the exact JDK 8 version we use, is 8u221.
>>
>> We have jobs that have to run the same identical code on different JDK 
>> versions.
>> Past experiences (implementation changes in Collections, legacy code 
>> using sun.* imports,...) have learned us the hard lesson that we should not 
>> trust JDK compatibility between versions, so we run our code in parallel on 
>> _all_ JDK versions that we support.
>> I seriously hope that it stays a secret that there are about a dozen 
>> different JDK vendors/distributions these days, build times are already 
>> long enough as it is now with what we have...
>> Code snippet to illustrate:
>>
>> static javaVersions = ['jdk-8-oracle', 'jdk-11-openjdk', 
>> 'jdk-13-openjdk', 'jdk-14-openjdk', 'jdk-15-openjdk', 'jdk-16-openjdk']
>>
>>
>>
>> When you write "unpacked in a user directory", what does that mean 
>> exactly for you?
>> A) JDK is "installed" in advance on the agent, either manually 
>> (next-next-next-finish) or configuration management (Chef, Puppet, 
>> Ansible,...)
>> B) JDK is "installed" by Jenkins, 
>> using https://$JENKINS_URL/configureTools/ -> JDK installations
>>
>> We do B, but now you've got me thinking that you maybe do A?
>>
>
> That's correct.  The JDK that runs the agent is pre-installed on the agent 
> before the agent starts.  I install it with a shell script (Unix) or 
> PowerShell script (Windows) by unpacking the zip file provided by the 
> AdoptOpenJDK project.  Chef, Puppet, or Ansible would do that as well.
>  
>
>> Do you use only one single JDK version ever on each agent?
>>
>
> I run the agent with a single JDK.  When the controller is running with 
> JDK 8u275, I try my best to run the agent with JDK 8u275.  When 
> the controller is running with JDK 11.0.9, I try my best to run the agent 
> with JDK 11.0.9.
>
> Jenkins is rather forgiving of mismatches in JDK versions, but I prefer to 
> generally keep them matched.  In my specific case, the match is imperfect 
> since I have Raspbian agents that are "stuck" on 8u212, a FreeBSD 10 agent 
> that is "stuck" on 8u181, a FreeBSD 12 agent that is "stuck" on 8u242, and 
> an OpenBSD agent that is "stuck" on 8u252.   They are "stuck" there because 
> I've not found newer versions for those environments yet.
>
> I can run other JDK's as part of agent jobs with the Jenkins AdoptOpenJDK 
> tool installer plugin.  That plugin is similar to the Oracle JDK tool 
> installer plugin but provides AdoptOpenJDK rather than Oracle JDK.
>  
>
>>
>>
>> I wrote "installed", because that can either be
>> * Windows Installer, for Oracle JDK
>> * Extract zip file, for OpenJDK (for me, binaries from 
>> https://jdk.java.net/ or for you, from https://adoptopenjdk.net/)
>>
>> I haven't really seriously looked at the difference between OpenJDK and 
>> AdoptOpenJDK.
>>
>> -- 
>> Amedee Van Gasse
>> On Friday, December 18, 2020 at 2:39:32 PM UTC+1 Mark Waite wrote:
>>
>>> I use a WIndows Server 2019 ssh agent that has AdoptOpenJDK 8u275 
>>> unpacked in a user directory with JAVA_HOME set in the environment of that 
>>> user to use the AdoptOpenJDK 8u275 installation.  It seems like you should 
>>> not need the Oracle JDK at all if you use AdoptOpenJDK.  That avoids the 
>>> requirements for purchase of an Oracle JDK license and does not require 
>>> privilege escalation.  Is the Oracle JDK a requirement for some other 
>>> reason?
>>>
>>> When I run my Jenkins controller (Dockerized on Linux) on Java 11, t

Re: Windows agent connected over ssh - requires elevation to install jdk-8-oracle

2020-12-18 Thread Amedee Van Gasse
The Oracle JDK is a requirement for a non-technical reason, and I am not at 
liberty to discuss the nature of those non-technical requirements on a 
public communication channel.
I know, that sounds more mysterious than it actually is. :-)

An Oracle JDK license is only required for Oracle Java SE 11+, and for 
updates to Oracle Java SE 8 released after January 2019.
>From which you can deduce that the exact JDK 8 version we use, is 8u221.

We have jobs that have to run the same identical code on different JDK 
versions.
Past experiences (implementation changes in Collections, legacy code using 
sun.* imports,...) have learned us the hard lesson that we should not trust 
JDK compatibility between versions, so we run our code in parallel on _all_ 
JDK versions that we support.
I seriously hope that it stays a secret that there are about a dozen 
different JDK vendors/distributions these days, build times are already 
long enough as it is now with what we have...
Code snippet to illustrate:

static javaVersions = ['jdk-8-oracle', 'jdk-11-openjdk', 
'jdk-13-openjdk', 'jdk-14-openjdk', 'jdk-15-openjdk', 'jdk-16-openjdk']



When you write "unpacked in a user directory", what does that mean exactly 
for you?
A) JDK is "installed" in advance on the agent, either manually 
(next-next-next-finish) or configuration management (Chef, Puppet, 
Ansible,...)
B) JDK is "installed" by Jenkins, 
using https://$JENKINS_URL/configureTools/ -> JDK installations

We do B, but now you've got me thinking that you maybe do A?
Do you use only one single JDK version ever on each agent?


I wrote "installed", because that can either be
* Windows Installer, for Oracle JDK
* Extract zip file, for OpenJDK (for me, binaries from 
https://jdk.java.net/ or for you, from https://adoptopenjdk.net/)

I haven't really seriously looked at the difference between OpenJDK and 
AdoptOpenJDK.

-- 
Amedee Van Gasse
On Friday, December 18, 2020 at 2:39:32 PM UTC+1 Mark Waite wrote:

> I use a WIndows Server 2019 ssh agent that has AdoptOpenJDK 8u275 unpacked 
> in a user directory with JAVA_HOME set in the environment of that user to 
> use the AdoptOpenJDK 8u275 installation.  It seems like you should not need 
> the Oracle JDK at all if you use AdoptOpenJDK.  That avoids the 
> requirements for purchase of an Oracle JDK license and does not require 
> privilege escalation.  Is the Oracle JDK a requirement for some other 
> reason?
>
> When I run my Jenkins controller (Dockerized on Linux) on Java 11, the 
> Windows Server 2019 ssh agent is configured to use AdoptOpenJDK 11.0.9.1 
> unpacked in a user directory.
>
> Mark Waite
>
> On Fri, Dec 18, 2020 at 6:10 AM Amedee Van Gasse  
> wrote:
>
>> There was a thread here last month "Recommended way to setup a windows 
>> agent nowadays?"
>>
>> I have a (new) windows agent (Windows Server 2019) that is connected 
>> through SSH, as described in that thread. It's configured through Packer 
>> and Ansible, to avoid clickety-click Next-Next-Next-Finish.
>>
>> I have a user "jenkins" on Windows, who is a regular user, not an 
>> Administrator.
>>
>> When I start a job on this new agent, I get this error:
>>
>> *00:00:09.445* Installing 
>> C:\Users\jenkins\tools\hudson.model.JDK\jdk-8-oracle\jdk.exe 
>> *00:00:09.475* [jdk-8-oracle] $ 
>> C:\Users\jenkins\tools\hudson.model.JDK\jdk-8-oracle\jdk.exe /s 
>> ADDLOCAL="ToolsFeature" REBOOT=ReallySuppress 
>> INSTALLDIR=C:\Users\jenkins\tools\hudson.model.JDK\jdk-8-oracle /L 
>> C:\Users\jenkins\tools\hudson.model.JDK\install6146141972686424355log 
>> *00:00:10.064* ERROR: SEVERE ERROR occurs *00:00:10.064* 
>> org.jenkinsci.lib.envinject.EnvInjectException: java.io.IOException: Cannot 
>> run program "C:\Users\jenkins\tools\hudson.model.JDK\jdk-8-oracle\jdk.exe" 
>> (in directory "C:\Users\jenkins\tools\hudson.model.JDK\jdk-8-oracle"): 
>> CreateProcess error=740, The requested operation requires elevation
>>
>> In short, Jenkins launches the Oracle JDK 8 installer, to install in 
>> C:\Users\jenkins\tools\hudson.model.JDK\jdk-8-oracle, and it fails to do, 
>> because the Oracle installer program, jdk.exe, requires elevated privileges 
>> to be able to install JDK8.
>>
>> This contrasts with OpenJDK installers, which are just zip files that are 
>> extracted into the install directory and do not require elevated privileges.
>> (context: we have builds that need to run on more than one JDK, because 
>> legacy products)
>>
>> In Ye Olden Days I know that Java Web Start was used to connect windows 
>> agents, and that allows you to register Jenkins as a service, which then 
>> has the r

Windows agent connected over ssh - requires elevation to install jdk-8-orable

2020-12-18 Thread Amedee Van Gasse
There was a thread here last month "Recommended way to setup a windows 
agent nowadays?"

I have a (new) windows agent (Windows Server 2019) that is connected 
through SSH, as described in that thread. It's configured through Packer 
and Ansible, to avoid clickety-click Next-Next-Next-Finish.

I have a user "jenkins" on Windows, who is a regular user, not an 
Administrator.

When I start a job on this new agent, I get this error:

*00:00:09.445* Installing 
C:\Users\jenkins\tools\hudson.model.JDK\jdk-8-oracle\jdk.exe *00:00:09.475* 
[jdk-8-oracle] $ 
C:\Users\jenkins\tools\hudson.model.JDK\jdk-8-oracle\jdk.exe /s 
ADDLOCAL="ToolsFeature" REBOOT=ReallySuppress 
INSTALLDIR=C:\Users\jenkins\tools\hudson.model.JDK\jdk-8-oracle /L 
C:\Users\jenkins\tools\hudson.model.JDK\install6146141972686424355log 
*00:00:10.064* ERROR: SEVERE ERROR occurs *00:00:10.064* 
org.jenkinsci.lib.envinject.EnvInjectException: java.io.IOException: Cannot 
run program "C:\Users\jenkins\tools\hudson.model.JDK\jdk-8-oracle\jdk.exe" 
(in directory "C:\Users\jenkins\tools\hudson.model.JDK\jdk-8-oracle"): 
CreateProcess error=740, The requested operation requires elevation

In short, Jenkins launches the Oracle JDK 8 installer, to install in 
C:\Users\jenkins\tools\hudson.model.JDK\jdk-8-oracle, and it fails to do, 
because the Oracle installer program, jdk.exe, requires elevated privileges 
to be able to install JDK8.

This contrasts with OpenJDK installers, which are just zip files that are 
extracted into the install directory and do not require elevated privileges.
(context: we have builds that need to run on more than one JDK, because 
legacy products)

In Ye Olden Days I know that Java Web Start was used to connect windows 
agents, and that allows you to register Jenkins as a service, which then 
has the required elevated privileges to install software (I think, not 
sure, I'm basically a Linux user for the better part of 2 decades). But as 
we all know, Java Web Start is going the way of the dodo, and I feel more 
at ease if my Linux agents and my Windows agents are configured in exactly 
the same way.

I have a backup plan, and that is to extract the JDK8 installation 
directory from the Oracle installer, zip that, put it on our Artifactory 
server, and use the zip as an installer in Global Tool Configuration. 
Before I do that, I would like to hear if others have encountered this 
issue before and how they have solved it.

-- 
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/dd38ac37-1952-48a7-aafd-19fd3cd092d4n%40googlegroups.com.


Jenkins Pipeline - wait for non-job items (ComputedFolder, Multibranch Pipeline Project)

2020-12-08 Thread Amedee Van Gasse
I'm using multibranch pipelines projects in Jenkins.
I let Jenkins index new branches.
I need Jenkins to wait until indexing of a multibranch pipeline project is 
complete.

This is my current code:

def triggerScanMultibranchPipeline(projectDir, repo) {
def multibranchProject = Jenkins.instance.getItemByFullName 
"$projectDir/$repo"
multibranchProject.scheduleBuild()
while (multibranchProject == null || 
multibranchProject.isDisabled()) {
sleep 1000 //1000 milliseconds = 1 second
}
sleep time: 1, unit: 'SECONDS'
}

Already tried:

* change (second) sleep to 30 seconds

This increases duration of the build each time 
`triggerScanMultibranchPipeline` is called.

I cannot use `"wait: true"` for the indexing to complete, because waiting 
for non-job items is not supported.
See 
https://github.com/jenkinsci/pipeline-build-step-plugin/blob/pipeline-build-step-2.13/src/main/java/org/jenkinsci/plugins/workflow/support/steps/build/BuildTriggerStepExecution.java#L80

How can I let Jenkins wait until the branch indexing of the Multibranch 
Pipeline Project is complete?

-- 
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/c1131785-c31d-427d-b0e7-b16e7873d2e7n%40googlegroups.com.


Re: How to start, in a Jenkinsfile, a multibranch job inside a Bitbucket folder?

2020-09-01 Thread Amedee Van Gasse
The problem was with the folder name `iText%207%20.NET`, which is an 
urlencoded version of `iText 7 .NET`. Apparently Jenkins can't handle 
urlencoded spaces in folder names.

I renamed the folder to `itext_7_dotnet` and then used

build job: "itext_7_dotnet/sharpen/${java.net.URLEncoder.encode 
branchName, 'UTF-8'}"

This works.


Moral of the story: never use spaces in your folder names!

On Tuesday, September 1, 2020 at 8:28:42 AM UTC+2 Amedee Van Gasse wrote:

> In a Jenkinsfile, to start a parameterized pipeline job from another job, 
> I have this code snippet:
>
> build job: 'build-sharpen-branch', parameters: [
> [$class: 'StringParameterValue', name: 'BRANCHNAME', value: 
> mergeBranchname]
> ]
>
> This already works as expected, and it will start a job at URL 
> `https://$JENKINS_URL/job/build-sharpen-branch/`.
>
> Now I want to start a job, that is one branch of a multibranch project 
> inside a Bitbucket folder. The URL of the job is 
> `https://$JENKINS_URL/job/iText%207%
> 20.NET/job/sharpen/job/feature%2FQA-10738/` 
> <http://20.NET/job/sharpen/job/feature%2FQA-10738/>.
> * `iText%207%20.NET` is the name of the Bitbucket project.
> * `sharpen` is the name of the Multibranch job.
> * `feature%2FQA-10738` is the name of the branch, urlencoded.
>
> I read the following Stack Overflow questions about starting a multibranch 
> job NOT inside a folder:
> * 
> https://stackoverflow.com/questions/50909730/trigger-multibranch-job-from-another
> * 
> https://stackoverflow.com/questions/45010601/triggering-a-multibranch-pipeline-job-from-an-other-multibranch-pipeline
> * 
> https://stackoverflow.com/questions/37322143/how-to-trigger-multibranch-pipeline-jenkins-job-within-regular-pipeline-job
>
> From the answers there, I gather that the syntax is `$JOB/$BRANCH` (where 
> `$BRANCH` is URL-encoded to rename branches like `feature/foo` to 
> `feature%2Ffoo`).
>
> From 
> https://stackoverflow.com/questions/41182186/jenkins-pipeline-with-folder-plugin-how-to-build-a-job-located-different-folder
>  
> I gather that the syntax for a job inside a folder is `$FOLDER/$JOB`.
>
> Combining the two, I conclude that the syntax for folder+job+branch is 
> most likely `$FOLDER/$JOB/$BRANCH`.
>
> So I tried with this code:
>
> build job: "iText%207%20.NET/sharpen/${java.net.URLEncoder.encode 
> <http://20.NET/sharpen/$%7Bjava.net.URLEncoder.encode> branchName, 
> 'UTF-8'}"
>
> with
>
> * folder = `iText%207%20.NET`
> * job = `sharpen`
> * branch = `${java.net.URLEncoder.encode branchName, 'UTF-8'}` 
> *(URLEncoder to change `/` in the branch name to `%2F`)*
>
> To my surprise, when I ran this, I got an error:
>
> > ERROR: No item named iText%207%20.NET/sharpen/feature%2FQA-10738 found
>
> As already stated above, a job exists on URL 
> `https://$JENKINS_URL/job/iText%207%
> 20.NET/job/sharpen/job/feature%2FQA-10738/` 
> <http://20.NET/job/sharpen/job/feature%2FQA-10738/>.
>
> What is the correct syntax for a multibranch job inside a Bitbucket folder?
>

-- 
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/aedeb36d-caa9-4368-8638-6a528fce551fn%40googlegroups.com.


How to start, in a Jenkinsfile, a multibranch job inside a Bitbucket folder?

2020-09-01 Thread Amedee Van Gasse
In a Jenkinsfile, to start a parameterized pipeline job from another job, I 
have this code snippet:

build job: 'build-sharpen-branch', parameters: [
[$class: 'StringParameterValue', name: 'BRANCHNAME', value: 
mergeBranchname]
]

This already works as expected, and it will start a job at URL 
`https://$JENKINS_URL/job/build-sharpen-branch/`.

Now I want to start a job, that is one branch of a multibranch project 
inside a Bitbucket folder. The URL of the job is 
`https://$JENKINS_URL/job/iText%207%20.NET/job/sharpen/job/feature%2FQA-10738/`.
* `iText%207%20.NET` is the name of the Bitbucket project.
* `sharpen` is the name of the Multibranch job.
* `feature%2FQA-10738` is the name of the branch, urlencoded.

I read the following Stack Overflow questions about starting a multibranch 
job NOT inside a folder:
* 
https://stackoverflow.com/questions/50909730/trigger-multibranch-job-from-another
* 
https://stackoverflow.com/questions/45010601/triggering-a-multibranch-pipeline-job-from-an-other-multibranch-pipeline
* 
https://stackoverflow.com/questions/37322143/how-to-trigger-multibranch-pipeline-jenkins-job-within-regular-pipeline-job

>From the answers there, I gather that the syntax is `$JOB/$BRANCH` (where 
`$BRANCH` is URL-encoded to rename branches like `feature/foo` to 
`feature%2Ffoo`).

>From 
https://stackoverflow.com/questions/41182186/jenkins-pipeline-with-folder-plugin-how-to-build-a-job-located-different-folder
 
I gather that the syntax for a job inside a folder is `$FOLDER/$JOB`.

Combining the two, I conclude that the syntax for folder+job+branch is most 
likely `$FOLDER/$JOB/$BRANCH`.

So I tried with this code:

build job: "iText%207%20.NET/sharpen/${java.net.URLEncoder.encode 
branchName, 'UTF-8'}"

with

* folder = `iText%207%20.NET`
* job = `sharpen`
* branch = `${java.net.URLEncoder.encode branchName, 'UTF-8'}` *(URLEncoder 
to change `/` in the branch name to `%2F`)*

To my surprise, when I ran this, I got an error:

> ERROR: No item named iText%207%20.NET/sharpen/feature%2FQA-10738 found

As already stated above, a job exists on URL 
`https://$JENKINS_URL/job/iText%207%20.NET/job/sharpen/job/feature%2FQA-10738/`.

What is the correct syntax for a multibranch job inside a Bitbucket folder?

-- 
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/cd092530-9717-4ca1-927a-04fa92c0284cn%40googlegroups.com.


Is there a Jenkins plugin that can create and terminate Amazon EC2 instances as required by the build queue?

2020-07-14 Thread Amedee Van Gasse
I have a job that makes use of Tesseract for OCR.
Tesseract runs *a lot* faster on GPU-optimized computers.
So I was thinking of running this job on an AWS EC2 instance of type P or 
G, which have NVIDIA Tesla GPUs.
However, these instance types are quite expensive, and the job runs only 
about 10 times per day, for an estimated duration of ~10 minutes.
So it would be very costly to have an AWS EC2 instance online 24/7.

Is there a way in Jenkins, maybe by means of some plugin, that I can for 
example put in my Jenkinsfile:

agent { label 'tesseract' }

and that when a job with label 'tesseracr' enters the queue, Jenkins 
connects to AWS, starts an instance based off an already existing image, 
runs the job on that image, and then terminates the instance?


-- 
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/25a9ac47-fdb7-4f1b-a546-73b014d9cb19o%40googlegroups.com.


Re: Declarative Jenkinsfile: different cron trigger per branch

2019-07-16 Thread Amedee Van Gasse


On Saturday, July 13, 2019 at 1:07:16 PM UTC+2, Ivan Fernandez Calvo wrote:
>
> Hi,
>
> Every branch has its own Jenkinsfile, so you can have different 
> configuration on every Jenkinsfile
>

Hi Ivan,

Merge conflicts shall be avoided at all possible cost, therefor my previous 
solution shall be used, and your solution shall not be used. 

-- 
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/48296db8-3e0b-4ca9-a6a4-dc5782fc68d3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Copy build history from one job to another job

2019-07-16 Thread Amedee Van Gasse
I have a Jenkins job that is a declarative pipeline. It's URL is 
/job/dnscheck/.

I started using Bitbucket projects on Jenkins, and now that Jenkinsfile is 
also discovered and the same job lives at 
/job/website/job/dnscheck/job/master/

I want to copy the entire history (log files etc) from 
/job/dnscheck/ to 
/job/website/job/dnscheck/job/master/, and then delete 
/job/dnscheck/.

1. *Can* I do that?
2. If yes, *how* do I do that?
3. I don't want to overwrite existing files

-- 
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/a9b86fad-2032-4f69-8fd5-829b04b0f931%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Declarative Jenkinsfile: different cron trigger per branch

2019-07-09 Thread Amedee Van Gasse
To answer my own question:

#!/usr/bin/env groovy

def schedule = env.BRANCH_NAME.contains('master') ? '@weekly' : env.BRANCH_NAME 
== 'develop' ? '@midnight' : ''

pipeline {


triggers {
cron(schedule)
}


Worked for me.

On Tuesday, July 9, 2019 at 10:34:06 AM UTC+2, Amedee Van Gasse wrote:
>
> I have a *declarative* Jenkinsfile.
> I want to have a daily build of the develop branch.
> I currently have the following trigger:
>
> triggers {
> cron(env.BRANCH_NAME == 'develop' ? '@midnight' : '')
> }
>
> Now I also want to build the master branch. Not daily, but weekly.
> I already know that I can have only one cron expression in triggers.
>
> I know of one solution that works, and that I do not want to use: have a 
> different cron expression committed to each branch.
> I don't want that, because master branches from develop and then gets 
> merged back into develop. Doing it that way, will cause merge conflicts 
> that I don't want to deal with.
>
> The other solution is to have a more complex cron expression in the 
> trigger.
> In pseudo code:
>
> IF (env.BRANCH_NAME = 'develop')
> THEN cron = '@midnight'
> ELSE IF (env.BRANCH_NAME = 'master')
> THEN cron = '@weekly'
>
> I don't know how to construct the correct syntax for the cron expression. 
> Is that Groovy? Linux shell? Something else?
>
> If possible, then I would like to avoid "polluting" my declarative 
> pipeline with script blocks (I don't even know if they are allowed inside 
> triggers).
>

-- 
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/ed96d9c4-e549-41d7-bd5a-2372a1ecfc22%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Declarative Jenkinsfile: different cron trigger per branch

2019-07-09 Thread Amedee Van Gasse
I have a *declarative* Jenkinsfile.
I want to have a daily build of the develop branch.
I currently have the following trigger:

triggers {
cron(env.BRANCH_NAME == 'develop' ? '@midnight' : '')
}

Now I also want to build the master branch. Not daily, but weekly.
I already know that I can have only one cron expression in triggers.

I know of one solution that works, and that I do not want to use: have a 
different cron expression committed to each branch.
I don't want that, because master branches from develop and then gets 
merged back into develop. Doing it that way, will cause merge conflicts 
that I don't want to deal with.

The other solution is to have a more complex cron expression in the trigger.
In pseudo code:

IF (env.BRANCH_NAME = 'develop')
THEN cron = '@midnight'
ELSE IF (env.BRANCH_NAME = 'master')
THEN cron = '@weekly'

I don't know how to construct the correct syntax for the cron expression. 
Is that Groovy? Linux shell? Something else?

If possible, then I would like to avoid "polluting" my declarative pipeline 
with script blocks (I don't even know if they are allowed inside triggers).

-- 
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/1e0c46fd-6031-41b9-9cac-1fbb622d9fc6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Declarative pipeline syntax: how to configure blockOn and waiting for a time slot to start?

2019-03-10 Thread Amedee Van Gasse
Can I do item 1 with lockable resources? But then wouldn't every 
Jenkinsfile in all of my repos require lockable resources? So I think 
that's also not the way to go but I could be wrong.

On Sunday, March 10, 2019 at 12:40:26 PM UTC+1, Amedee Van Gasse wrote:
>
> I have a Bitbucket Server Project.
>
> I am using declarative Jenkinsfiles
>
> All branches/PRs of all repos in the Project are built if they have a 
> Jenkinsfile. Wonderful.
> The branches/PRs are built when there is new git activity. Wonderful.
>
>
> There is one repo with 2 requirements that I'm stuck on:
>
> 1. It cannot run when anything else is running, not even other branches of 
> itself. I already have disableConcurrentBuilds() but then I can still run 
> different branches in parallel and I don't want that. I know about the 
> Build Blocker plugin and I would put this in my Jenkinsfile, but I don't 
> know where to put it:
>
> blockOn('.*') {
> blockLevel('GLOBAL')
> scanQueueFor('ALL')
> }
>
>
> 2. That particular job, any branch of it, is only allowed to start between 
> specific hours, regardless of how it got triggered. I don't know how to put 
> that in my Jenkinsfile. I looked at quietPeriod and rateLimitBuilds, but 
> they seem to be for something else.
>
>
> I had a third question about how to schedule it with cron, but I found 
> that myself already:
>
> triggers {
> cron('H H(0-6) * * 1-5')
> }
>
>
> meaning anywhere between midnight and 6 AM on work days.
>

-- 
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/ac9910dc-6ced-484a-8f51-ba4bfcacc48e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Declarative pipeline syntax: how to configure blockOn and waiting for a time slot to start?

2019-03-10 Thread Amedee Van Gasse
I have a Bitbucket Server Project.

I am using declarative Jenkinsfiles

All branches/PRs of all repos in the Project are built if they have a 
Jenkinsfile. Wonderful.
The branches/PRs are built when there is new git activity. Wonderful.


There is one repo with 2 requirements that I'm stuck on:

1. It cannot run when anything else is running, not even other branches of 
itself. I already have disableConcurrentBuilds() but then I can still run 
different branches in parallel and I don't want that. I know about the 
Build Blocker plugin and I would put this in my Jenkinsfile, but I don't 
know where to put it:

blockOn('.*') {
blockLevel('GLOBAL')
scanQueueFor('ALL')
}


2. That particular job, any branch of it, is only allowed to start between 
specific hours, regardless of how it got triggered. I don't know how to put 
that in my Jenkinsfile. I looked at quietPeriod and rateLimitBuilds, but 
they seem to be for something else.


I had a third question about how to schedule it with cron, but I found that 
myself already:

triggers {
cron('H H(0-6) * * 1-5')
}


meaning anywhere between midnight and 6 AM on work days.

-- 
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/4a9b4e89-6705-47ad-b72d-bdf9007d5885%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Violations cause a java.lang.IllegalStateException: cannot change build result while in COMPLETED

2016-05-31 Thread Amedee Van Gasse
I also have this error in Jenkins 2.7

On Tuesday, October 14, 2014 at 7:05:57 PM UTC+2, llaumgui wrote:
>
> Hi,
>
> with Jenkins 1.584 and Violations plugin 0.7.11, when I build my project 
> on Jenkins, I have a successfull build, but a IllegalStateException caused 
> by Violations plugins cause a fail:
> INFO: 
> 
> INFO: EXECUTION SUCCESS
> INFO: 
> 
> Total time: 25.044s
> Final Memory: 17M/621M
> INFO: 
> 
> ERROR: Processing failed due to a bug in the code. Please report this to 
> jenkinsci-users@googlegroups.com
> java.lang.IllegalStateException: cannot change build result while in 
> COMPLETED
> at hudson.model.Run.setResult(Run.java:453)
> at hudson.plugins.violations.ViolationsReport.setBuildResult(
> ViolationsReport.java:542)
> at hudson.plugins.violations.hudson.maven.ViolationsMavenReporter.end(
> ViolationsMavenReporter.java:100)
> at hudson.maven.AbstractMavenBuilder.end(AbstractMavenBuilder.java:103
> )
> at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun
> (MavenModuleSetBuild.java:846)
> at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild
> .java:533)
> at hudson.model.Run.execute(Run.java:1754)
> at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:529)
> at hudson.model.ResourceController.execute(ResourceController.java:89)
> at hudson.model.Executor.run(Executor.java:240)
> project=hudson.maven.MavenModuleSet@20ef6b76[blabla.services.core]
> project.getModules()=[hudson.maven.MavenModule@3ae75e2d[blabla.services.
> core/com.blabla.blabla:services.core][blabla.services.core/com.blabla.
> blabla:services.core][relativePath:]]
> project.getRootModule()=hudson.maven.MavenModule@3ae75e2d[blabla.services.
> core/com.blabla.blabla:services.core][blabla.services.core/com.blabla.
> blabla:services.core][relativePath:]
> FATAL: cannot change build result while in COMPLETED
> java.lang.IllegalStateException: cannot change build result while in 
> COMPLETED
> at hudson.model.Run.setResult(Run.java:453)
> at hudson.plugins.violations.ViolationsReport.setBuildResult(
> ViolationsReport.java:542)
> at hudson.plugins.violations.hudson.maven.ViolationsMavenReporter.end(
> ViolationsMavenReporter.java:100)
> at hudson.maven.AbstractMavenBuilder.end(AbstractMavenBuilder.java:103
> )
> at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun
> (MavenModuleSetBuild.java:846)
> at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild
> .java:533)
> at hudson.model.Run.execute(Run.java:1754)
> at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:529)
> at hudson.model.ResourceController.execute(ResourceController.java:89)
> at hudson.model.Executor.run(Executor.java:240)
>
> Have you some idea ?
>
> Thx.
>

-- 
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/41078e45-eab9-40f5-a96b-e3fd67fa128d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Git Parameter Plug-in does not list tags or branches

2015-02-17 Thread Amedee Van Gasse
It seems that I have stumbled upon a known bug: the Git Parameters plugin 
does not work for private repositories because it ignores the SSH 
credentials in the Jenkins setup:
https://issues.jenkins-ci.org/browse/JENKINS-23396

I made a workaround with the Extensible Choice Parameter plugin 
https://wiki.jenkins-ci.org/display/JENKINS/Extensible+Choice+Parameter+plugin
:
http://stackoverflow.com/a/28565446/766786

It's a kludge, but it works for me.

PS: I want to subscribe to bug JENKINS-23396, but I can't register due to 
spam. Halp?

On Monday, February 16, 2015 at 1:01:36 PM UTC+1, Amedee Van Gasse wrote:

 Jenkins version: 1.593
 Git Parameter Plug-In 
 http://wiki.jenkins-ci.org/display/JENKINS/Git+Parameter+Plugin: 0.4.0
 GIT client plugin 
 http://wiki.jenkins-ci.org/display/JENKINS/Git+Client+Plugin: 1.16.1


 I have a parameterized build.
 My parameter is Git Parameter.

 Name: TAG_TO_BUILD
 Description:
 Parameter type: Branch or tag
 Branch filter: *
 Tag filter: *
 Tag sort mode: DESCENDING_SMART
 Default value: master

 Source code management:
 Branches to build: origin/${TAG_TO_BUILD}


 When I Build with parameters, I always get Retrieving Git references...:

 This build requires parameters:
  TAG_TO_BUILD
 Retrieving Git references…
 You must have built the project at least once, to get entries in the list 
 above.
 If you wipe out your workspace, the plugin needs to clone the repository 
 before it can list the tags/revisions. This may take some time if you have 
 a slow connection or the repository is big.

 I always get this, the box is never filled with branches or tags, even 
 after I built the project without specifying a parameter (it was 
 successfully built with branch master).

 Is there something else that I am missing here?

 -- 
 Amedee


-- 
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/f21d4708-0ea4-4302-852f-4668b9fcad92%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Git Parameter Plug-in does not list tags or branches

2015-02-16 Thread Amedee Van Gasse
Okay, so I have established that Jenkins fails on git fetch --tags, not on 
git rev-parse.
By the way, I changed branches to build to refs/tags/${TAG_TO_BUILD}

When I build a tag with the String type parameter, git fetch works just 
fine.
When I start a parameterized build with Git Parameters, the Git Parameter 
plugin *also* runs the git fetch command.
There's one difference that I see: during a succesful build, the git fetch 
command is preceded by this line:

using GIT_SSH to set credentials key for gitlab


I have no way of telling if GIT_SSH is also used when the Git Parameters 
plugin runs. (more logging needed I guess).



On Monday, February 16, 2015 at 4:46:50 PM UTC+1, Mark Waite wrote:




 On Mon, Feb 16, 2015 at 6:22 AM, Amedee Van Gasse amedee@gmail.com 
 javascript: wrote:

 I have this in the logs:
 (** is just to obfuscate the url)

 I don't understand why I get permission denied. Maybe because of 
 core.askpass=true? Because authentication works without password, we use 
 ssh keys.


 I don't think the core.askpass=true argument has anything to do with 
 this problem.  

 When I configure a similar job using a private github repository with an 
 ssh key, it seems like the git parameter plugin is attempting to perform a 
 Unix style credentials operation on the Windows slave agent which is 
 hosting the build.  At least I think that is why the Jenkins log file on 
 the master node (Ubuntu) includes an entry which says:


 Caused by: hudson.plugins.git.GitException: Command git -c core.askpass=true 
 fetch --tags --progress g...@github.com:MarkEWaite/git-client-plugin.git 
 +refs/heads/*:refs/remotes/origin/* returned status code 1:


 http://mark-pc1.markwaite.net/markwaite/check_mk/wato.py?mode=pattern_editorhost=mark-pc1file=/var/log/jenkins/jenkins.logmatch=stdout%3A%20Process%20leaked%20file%20descriptors.%20See%20http%3A//wiki.jenkins-ci.org/display/JENKINS/Spawning%2Bprocesses%2Bfrom%2Bbuild%20for%20more%20information
 stdout: Process leaked file descriptors. See 
 http://wiki.jenkins-ci.org/display/JENKINS/Spawning+processes+from+build
  for more information


 http://mark-pc1.markwaite.net/markwaite/check_mk/wato.py?mode=pattern_editorhost=mark-pc1file=/var/log/jenkins/jenkins.logmatch=Process%20leaked%20file%20descriptors.%20See%20http%3A//wiki.jenkins-ci.org/display/JENKINS/Spawning%2Bprocesses%2Bfrom%2Bbuild%20for%20more%20information
 Process leaked file descriptors. See 
 http://wiki.jenkins-ci.org/display/JENKINS/Spawning+processes+from+build
  for more information


 http://mark-pc1.markwaite.net/markwaite/check_mk/wato.py?mode=pattern_editorhost=mark-pc1file=/var/log/jenkins/jenkins.logmatch=


 http://mark-pc1.markwaite.net/markwaite/check_mk/wato.py?mode=pattern_editorhost=mark-pc1file=/var/log/jenkins/jenkins.logmatch=stderr%3A%20Could%20not%20create%20directory%20%27/var/lib/jenkins/.ssh%27.
 stderr: Could not create directory '/var/lib/jenkins/.ssh'.


 http://mark-pc1.markwaite.net/markwaite/check_mk/wato.py?mode=pattern_editorhost=mark-pc1file=/var/log/jenkins/jenkins.logmatch=


 I'm not sure if the git parameter plugin is ready for the use case of a 
 parameter being evaluated from a workspace on a slave agent.

 Unfortunately, switching to force the build on the master node did not 
 resolve the issue for me either.
  

 Feb 16, 2015 2:17:34 PM WARNING org.eclipse.jetty.util.log.JavaUtilLog warn

 Error while serving 
 **-master/descriptorByName/net.uaznia.lukanus.hudson.plugins.gitparameter.GitParameterDefinition/fillValueItems
 java.lang.reflect.InvocationTargetException
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at java.lang.Thread.run(Thread.java:745)
 Caused by: hudson.plugins.git.GitException: Command git -c 
 core.askpass=true fetch --tags --progress ** 
 +refs/heads/*:refs/remotes/origin/* returned status code 128:
 stdout: 
 stderr: Permission denied, please try again.
 Permission denied, please try again.
 Permission denied (publickey,password).
 fatal: The remote end hung up unexpectedly

  at 
 org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1591)
  at 
 org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1379)
  at 
 org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:86)
  at 
 org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:324)
  at 
 net.uaznia.lukanus.hudson.plugins.gitparameter.GitParameterDefinition.generateContents(GitParameterDefinition.java:314)
  at 
 net.uaznia.lukanus.hudson.plugins.gitparameter.GitParameterDefinition$DescriptorImpl.doFillValueItems(GitParameterDefinition.java:536)
  ... 85 more


 On Monday, February 16, 2015 at 1:01:36 PM UTC+1, Amedee Van Gasse wrote:

 Jenkins version: 1.593
 Git Parameter Plug-In 
 http://wiki.jenkins-ci.org/display/JENKINS/Git+Parameter+Plugin: 0.4.0
 GIT client plugin 
 http

Re: Git Parameter Plug-in does not list tags or branches

2015-02-16 Thread Amedee Van Gasse
I added `env | sort` as a shell script in the pre- and post build steps.

There are several GIT_* variables set, but GIT_SSH is not one of them, so 
that value is blank.
So I'm probably looking in the wrong place.


On Monday, February 16, 2015 at 5:12:24 PM UTC+1, Amedee Van Gasse wrote:

 Okay, so I have established that Jenkins fails on git fetch --tags, not on 
 git rev-parse.
 By the way, I changed branches to build to refs/tags/${TAG_TO_BUILD}

 When I build a tag with the String type parameter, git fetch works just 
 fine.
 When I start a parameterized build with Git Parameters, the Git Parameter 
 plugin *also* runs the git fetch command.
 There's one difference that I see: during a succesful build, the git fetch 
 command is preceded by this line:

 using GIT_SSH to set credentials key for gitlab


 I have no way of telling if GIT_SSH is also used when the Git Parameters 
 plugin runs. (more logging needed I guess).



 On Monday, February 16, 2015 at 4:46:50 PM UTC+1, Mark Waite wrote:




 On Mon, Feb 16, 2015 at 6:22 AM, Amedee Van Gasse amedee@gmail.com 
 wrote:

 I have this in the logs:
 (** is just to obfuscate the url)

 I don't understand why I get permission denied. Maybe because of 
 core.askpass=true? Because authentication works without password, we 
 use ssh keys.


 I don't think the core.askpass=true argument has anything to do with 
 this problem.  

 When I configure a similar job using a private github repository with an 
 ssh key, it seems like the git parameter plugin is attempting to perform a 
 Unix style credentials operation on the Windows slave agent which is 
 hosting the build.  At least I think that is why the Jenkins log file on 
 the master node (Ubuntu) includes an entry which says:


 Caused by: hudson.plugins.git.GitException: Command git -c 
 core.askpass=true fetch --tags --progress 
 g...@github.com:MarkEWaite/git-client-plugin.git 
 +refs/heads/*:refs/remotes/origin/* returned status code 1:


 http://mark-pc1.markwaite.net/markwaite/check_mk/wato.py?mode=pattern_editorhost=mark-pc1file=/var/log/jenkins/jenkins.logmatch=stdout%3A%20Process%20leaked%20file%20descriptors.%20See%20http%3A//wiki.jenkins-ci.org/display/JENKINS/Spawning%2Bprocesses%2Bfrom%2Bbuild%20for%20more%20information
 stdout: Process leaked file descriptors. See 
 http://wiki.jenkins-ci.org/display/JENKINS/Spawning+processes+from+build
  for more information


 http://mark-pc1.markwaite.net/markwaite/check_mk/wato.py?mode=pattern_editorhost=mark-pc1file=/var/log/jenkins/jenkins.logmatch=Process%20leaked%20file%20descriptors.%20See%20http%3A//wiki.jenkins-ci.org/display/JENKINS/Spawning%2Bprocesses%2Bfrom%2Bbuild%20for%20more%20information
 Process leaked file descriptors. See 
 http://wiki.jenkins-ci.org/display/JENKINS/Spawning+processes+from+build
  for more information


 http://mark-pc1.markwaite.net/markwaite/check_mk/wato.py?mode=pattern_editorhost=mark-pc1file=/var/log/jenkins/jenkins.logmatch=


 http://mark-pc1.markwaite.net/markwaite/check_mk/wato.py?mode=pattern_editorhost=mark-pc1file=/var/log/jenkins/jenkins.logmatch=stderr%3A%20Could%20not%20create%20directory%20%27/var/lib/jenkins/.ssh%27.
 stderr: Could not create directory '/var/lib/jenkins/.ssh'.


 http://mark-pc1.markwaite.net/markwaite/check_mk/wato.py?mode=pattern_editorhost=mark-pc1file=/var/log/jenkins/jenkins.logmatch=


 I'm not sure if the git parameter plugin is ready for the use case of a 
 parameter being evaluated from a workspace on a slave agent.

 Unfortunately, switching to force the build on the master node did not 
 resolve the issue for me either.
  

 Feb 16, 2015 2:17:34 PM WARNING org.eclipse.jetty.util.log.JavaUtilLog warn

 Error while serving 
 **-master/descriptorByName/net.uaznia.lukanus.hudson.plugins.gitparameter.GitParameterDefinition/fillValueItems
 java.lang.reflect.InvocationTargetException
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at java.lang.Thread.run(Thread.java:745)
 Caused by: hudson.plugins.git.GitException: Command git -c 
 core.askpass=true fetch --tags --progress ** 
 +refs/heads/*:refs/remotes/origin/* returned status code 128:
 stdout: 
 stderr: Permission denied, please try again.
 Permission denied, please try again.
 Permission denied (publickey,password).
 fatal: The remote end hung up unexpectedly

 at 
 org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1591)
 at 
 org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1379)
 at 
 org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:86)
 at 
 org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:324)
 at 
 net.uaznia.lukanus.hudson.plugins.gitparameter.GitParameterDefinition.generateContents(GitParameterDefinition.java:314)
 at 
 net.uaznia.lukanus.hudson.plugins.gitparameter.GitParameterDefinition$DescriptorImpl.doFillValueItems

Re: Git Parameter Plug-in does not list tags or branches

2015-02-16 Thread Amedee Van Gasse
* There is no Windows involved, it's a pure Linux (Debian) setup.
* There is no slave involved, all Jenkins jobs run on the same server.
* I changed *origin/${TAG_TO_BUILD}* to *${TAG_TO_BUILD}* - but if I 
read the error right, I don't even get that far. The plugin first try to 
fetch all the tags from the remote, and it's only after that step that it 
will try to do a rev-parse on the local repo.

If I look at the console output of a parameterized build with the default 
value (master), I get this:


 
http://ci.itextsupport.com/view/Git%20Master%20and%20Release%20builds/job/itextpdf-master/3/consoleFull#L1Started
 by user admin http://ci.itextsupport.com/user/admin

 
http://ci.itextsupport.com/view/Git%20Master%20and%20Release%20builds/job/itextpdf-master/3/consoleFull#L2Building
 in workspace /var/lib/jenkins/jobs/**/workspace

 
http://ci.itextsupport.com/view/Git%20Master%20and%20Release%20builds/job/itextpdf-master/3/consoleFull#L3
  git rev-parse --is-inside-work-tree # timeout=10

 
http://ci.itextsupport.com/view/Git%20Master%20and%20Release%20builds/job/itextpdf-master/3/consoleFull#L4Fetching
 changes from the remote Git repository

 
http://ci.itextsupport.com/view/Git%20Master%20and%20Release%20builds/job/itextpdf-master/3/consoleFull#L5
  git config remote.origin.url ssh://git@**/**/**.git 
# timeout=10

 
http://ci.itextsupport.com/view/Git%20Master%20and%20Release%20builds/job/itextpdf-master/3/consoleFull#L6Fetching
 upstream changes from ssh://**/**/**.git

 
http://ci.itextsupport.com/view/Git%20Master%20and%20Release%20builds/job/itextpdf-master/3/consoleFull#L7
  git --version # timeout=10

 
http://ci.itextsupport.com/view/Git%20Master%20and%20Release%20builds/job/itextpdf-master/3/consoleFull#L8using
 GIT_SSH to set credentials key for gitlab

 
http://ci.itextsupport.com/view/Git%20Master%20and%20Release%20builds/job/itextpdf-master/3/consoleFull#L9
  git -c core.askpass=true fetch --tags --progress 
ssh://git@**/**/**.git 
+refs/heads/*:refs/remotes/origin/*

 
http://ci.itextsupport.com/view/Git%20Master%20and%20Release%20builds/job/itextpdf-master/3/consoleFull#L10
  git rev-parse origin/master^{commit} # timeout=10

 
http://ci.itextsupport.com/view/Git%20Master%20and%20Release%20builds/job/itextpdf-master/3/consoleFull#L11Checking
 out Revision 8466cba68962a5b4fbeff263b221e3e384d094c9 (origin/master)

 
http://ci.itextsupport.com/view/Git%20Master%20and%20Release%20builds/job/itextpdf-master/3/consoleFull#L12
  git config core.sparsecheckout # timeout=10

 
http://ci.itextsupport.com/view/Git%20Master%20and%20Release%20builds/job/itextpdf-master/3/consoleFull#L13
  git checkout -f 8466cba68962a5b4fbeff263b221e3e384d094c9

 
http://ci.itextsupport.com/view/Git%20Master%20and%20Release%20builds/job/itextpdf-master/3/consoleFull#L14First
 time build. Skipping changelog.



So as you can see, there the `git rev-parse` command works just fine, and `git 
fetch --tags` before that doesn't complain either.

What I'm going to do next, is replace the Git Tag parameter with a String 
parameter, and see what happens next.


On Monday, February 16, 2015 at 4:46:50 PM UTC+1, Mark Waite wrote:




 On Mon, Feb 16, 2015 at 6:22 AM, Amedee Van Gasse amedee@gmail.com 
 javascript: wrote:

 I have this in the logs:
 (** is just to obfuscate the url)

 I don't understand why I get permission denied. Maybe because of 
 core.askpass=true? Because authentication works without password, we use 
 ssh keys.


 I don't think the core.askpass=true argument has anything to do with 
 this problem.  

 When I configure a similar job using a private github repository with an 
 ssh key, it seems like the git parameter plugin is attempting to perform a 
 Unix style credentials operation on the Windows slave agent which is 
 hosting the build.  At least I think that is why the Jenkins log file on 
 the master node (Ubuntu) includes an entry which says:


 Caused by: hudson.plugins.git.GitException: Command git -c core.askpass=true 
 fetch --tags --progress g...@github.com:MarkEWaite/git-client-plugin.git 
 +refs/heads/*:refs/remotes/origin/* returned status code 1:


 http://mark-pc1.markwaite.net/markwaite/check_mk/wato.py?mode=pattern_editorhost=mark-pc1file=/var/log/jenkins/jenkins.logmatch=stdout%3A%20Process%20leaked%20file%20descriptors.%20See%20http%3A//wiki.jenkins-ci.org/display/JENKINS/Spawning%2Bprocesses%2Bfrom%2Bbuild%20for%20more%20information
 stdout: Process leaked file descriptors. See 
 http://wiki.jenkins-ci.org/display/JENKINS/Spawning+processes+from+build
  for more information


 http://mark-pc1.markwaite.net/markwaite/check_mk/wato.py?mode=pattern_editorhost=mark-pc1file=/var/log/jenkins/jenkins.logmatch=Process%20leaked%20file%20descriptors.%20See%20http%3A//wiki.jenkins-ci.org/display/JENKINS/Spawning%2Bprocesses%2Bfrom%2Bbuild%20for%20more%20information
 Process leaked file descriptors. See

Re: Git Parameter Plug-in does not list tags or branches

2015-02-16 Thread Amedee Van Gasse
(ChainedServletFilter.java:87)
at 
hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)
at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:164)
at 
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
at 
org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:46)
at 
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
at 
hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81)
at 
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
at 
org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30)
at 
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1474)
at 
org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:499)
at 
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
at 
org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:533)
at 
org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
at 
org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)
at 
org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428)
at 
org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
at 
org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)
at 
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
at 
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
at org.eclipse.jetty.server.Server.handle(Server.java:370)
at 
org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)
at 
org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:949)
at 
org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1011)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:644)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
at 
org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
at 
org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:668)
at 
org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
at winstone.BoundedExecutorService$1.run(BoundedExecutorService.java:77)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: hudson.plugins.git.GitException: Command git -c core.askpass=true 
fetch --tags --progress ** +refs/heads/*:refs/remotes/origin/* 
returned status code 128:
stdout: 
stderr: Permission denied, please try again.
Permission denied, please try again.
Permission denied (publickey,password).
fatal: The remote end hung up unexpectedly

at 
org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1591)
at 
org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1379)
at 
org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:86)
at 
org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:324)
at 
net.uaznia.lukanus.hudson.plugins.gitparameter.GitParameterDefinition.generateContents(GitParameterDefinition.java:314)
at 
net.uaznia.lukanus.hudson.plugins.gitparameter.GitParameterDefinition$DescriptorImpl.doFillValueItems(GitParameterDefinition.java:536)
... 85 more


On Monday, February 16, 2015 at 1:01:36 PM UTC+1, Amedee Van Gasse wrote:

 Jenkins version: 1.593
 Git Parameter Plug-In 
 http://wiki.jenkins-ci.org/display/JENKINS/Git+Parameter+Plugin: 0.4.0
 GIT client plugin 
 http://wiki.jenkins-ci.org/display/JENKINS/Git+Client+Plugin: 1.16.1


 I have a parameterized build.
 My parameter is Git Parameter.

 Name: TAG_TO_BUILD
 Description:
 Parameter type: Branch or tag
 Branch filter: *
 Tag filter: *
 Tag sort mode: DESCENDING_SMART
 Default value: master

 Source code management:
 Branches to build: origin/${TAG_TO_BUILD}


 When I Build with parameters, I always get Retrieving Git references...:

 This build requires parameters:
  TAG_TO_BUILD
 Retrieving Git references…
 You must have built the project at least once, to get entries in the list 
 above.
 If you wipe out your workspace, the plugin needs to clone the repository 
 before it can list the tags/revisions. This may take some time if you have 
 a slow connection

Git Parameter Plug-in does not list tags or branches

2015-02-16 Thread Amedee Van Gasse
Jenkins version: 1.593
Git Parameter Plug-In 
http://wiki.jenkins-ci.org/display/JENKINS/Git+Parameter+Plugin: 0.4.0
GIT client plugin 
http://wiki.jenkins-ci.org/display/JENKINS/Git+Client+Plugin: 1.16.1


I have a parameterized build.
My parameter is Git Parameter.

Name: TAG_TO_BUILD
Description:
Parameter type: Branch or tag
Branch filter: *
Tag filter: *
Tag sort mode: DESCENDING_SMART
Default value: master

Source code management:
Branches to build: origin/${TAG_TO_BUILD}


When I Build with parameters, I always get Retrieving Git references...:

This build requires parameters:
 TAG_TO_BUILD
Retrieving Git references…
You must have built the project at least once, to get entries in the list 
above.
If you wipe out your workspace, the plugin needs to clone the repository 
before it can list the tags/revisions. This may take some time if you have 
a slow connection or the repository is big.

I always get this, the box is never filled with branches or tags, even 
after I built the project without specifying a parameter (it was 
successfully built with branch master).

Is there something else that I am missing here?

-- 
Amedee

-- 
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/96bf9015-2fb0-4e1b-8919-26efa19f4b87%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Git Parameter Plug-in does not list tags or branches

2015-02-16 Thread Amedee Van Gasse
I deleted the project and created it again from scratch.
I built it once, so it would build the master branch.

On the second build, I get noWorkspaceError. But there most definitely *is* 
a workspace!


This build requires parameters:
 TAG_TO_BUILD

noWorkspaceError
Retrieving Git references…
You must have built the project at least once, to get entries in the list 
above.
If you wipe out your workspace, the plugin needs to clone the repository 
before it can list the tags/revisions. This may take some time if you have 
a slow connection or the repository is big.



On Monday, February 16, 2015 at 1:01:36 PM UTC+1, Amedee Van Gasse wrote:

 Jenkins version: 1.593
 Git Parameter Plug-In 
 http://wiki.jenkins-ci.org/display/JENKINS/Git+Parameter+Plugin: 0.4.0
 GIT client plugin 
 http://wiki.jenkins-ci.org/display/JENKINS/Git+Client+Plugin: 1.16.1


 I have a parameterized build.
 My parameter is Git Parameter.

 Name: TAG_TO_BUILD
 Description:
 Parameter type: Branch or tag
 Branch filter: *
 Tag filter: *
 Tag sort mode: DESCENDING_SMART
 Default value: master

 Source code management:
 Branches to build: origin/${TAG_TO_BUILD}


 When I Build with parameters, I always get Retrieving Git references...:

 This build requires parameters:
  TAG_TO_BUILD
 Retrieving Git references…
 You must have built the project at least once, to get entries in the list 
 above.
 If you wipe out your workspace, the plugin needs to clone the repository 
 before it can list the tags/revisions. This may take some time if you have 
 a slow connection or the repository is big.

 I always get this, the box is never filled with branches or tags, even 
 after I built the project without specifying a parameter (it was 
 successfully built with branch master).

 Is there something else that I am missing here?

 -- 
 Amedee


-- 
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/79df3659-e56a-4817-9ccb-34072cad1500%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.