swarm agent, bad request, azure

2020-12-15 Thread Ewelina Wilkosz
Here is what I am getting when I try to connect VM in Azure as a build 
agent for Jenkins in the same Azure:

$ java -jar swarm-client-3.22.jar -username x -passwordFile 
password.txt -name test-agent -mode normal -master http://x.x.x.x/ -labels 
azure 
Dec 15, 2020 12:38:57 PM hudson.plugins.swarm.Client logArguments
INFO: Client invoked with: -labels [azure] -master http://x.x.x.x/ -name 
test-agent -passwordFile password.txt -username *
Dec 15, 2020 12:38:57 PM hudson.plugins.swarm.Client run
INFO: Connecting to Jenkins master
Dec 15, 2020 12:38:57 PM hudson.plugins.swarm.Client run
INFO: Attempting to connect to http://x.x.x.x/
Dec 15, 2020 12:39:00 PM hudson.plugins.swarm.Client run
SEVERE: An error occurred
java.io.IOException: Failed to obtain 
http://x.x.x.x/computer/test-agent-65e117e9/slave-agent.jnlp
at hudson.remoting.Launcher.parseJnlpArguments(Launcher.java:577)
at 
hudson.plugins.swarm.SwarmClient.getJnlpArgs(SwarmClient.java:159)
at hudson.plugins.swarm.Client.run(Client.java:190)
at hudson.plugins.swarm.Client.main(Client.java:52)
Caused by: java.io.IOException: Failed to load 
http://x.x.x.x/computer/test-agent-65e117e9/slave-agent.jnlp: 400 Bad 
Request
at hudson.remoting.Launcher.parseJnlpArguments(Launcher.java:519)
... 3 more

I can see the node on Jenkins, but offline 
*This agent is offline because Jenkins failed to launch the agent process 
on it.* *See log for more details*

Any ideas how to troubleshoot to find the reson?

-- 
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/f33c89f2-843b-4f64-819f-21c16ad321bbn%40googlegroups.com.


Re: jenkins_home, docker, upgrades

2020-12-15 Thread Ewelina Wilkosz
thank you for sharing your experiences, that was helpful
On Saturday, December 12, 2020 at 7:47:50 PM UTC+1 kuisat...@gmail.com 
wrote:

> El lunes, 7 de diciembre de 2020 a las 16:12:10 UTC+1, ewel...@gmail.com 
> escribió:
>
>>
>> Hi!
>>
>> I am using Jenkins in Docker and I map a folder from local machine to the 
>> container's /var/jenkins_home to preserve JENKINS_HOME.
>>
>> There are two things I am wondering about, and maybe you can comment:
>>
>> 1. Can new Jenkins corrupt existing JENKINS_HOME?
>> Let's assume I have Jenkins in version X running, I want to upgrade so I 
>> have built new image, with Jenkins version Y, same plugins - maybe updated 
>> during the image build
>>
>> Is it possible that when I restart Jenkins with new image with version Y, 
>> the existing JENKINS_HOME won't be compatible with new version? 
>> Is it possible that after restart JENKINS_HOME will be changed in a way 
>> that it won't be possible to use it again with version X - if I want to 
>> rollback for whatever reason?
>>
>>
> It depends of your plugins installed, so it is possible you screw up your 
> Jenkins Home if you do not test your upgrade in a test instance, it is not 
> common but it could happens, thus is recommended to clone your Jenkins home 
> folder and test the upgrade before to make it on production. Also, take a 
> backup before to make the upgrade is mandatory. Rollback is not 
> supported, even though it could work, it is better to restore the backup 
> form the previous version.
>  
>
>> 2. What happens when two instances share JENKINS_HOME?
>> I want to have a simple test environment - let's not discuss now if it's 
>> a good or bad approach :) - so next to a working Jenkins container I start 
>> another one in a quiet mode (no job will start), with a new image I want to 
>> try out
>> The first idea is to copy original JENKINS_HOME and use this copy, but 
>> what if the home is very big and I do not have much space - how bad would 
>> running second Jenkins with JENKINS_HOME mapped to the same folder on a 
>> local host would be? (I haven't considered that option, but I was asked 
>> 'why')
>>
>> I know I can just run it and check, but I think there might be plenty of 
>> different cases that I will not see in my simple test, but maybe some of 
>> you have more experience or ran into issues before
>>
>>
> Really bad idea, Jenkins keep changes in memory and write them to disk, so 
> if you have two instances running in the same Jenkins home and you change a 
> job in one of them the other does not know anything about his change, the 
> configuration is not read from disk on runtime, most of the configuration 
> is only read at start time and keep updated in memory. So two instances 
> running on the same Jenkins home is a random behaviour environment.
>
>  
>
>> BR
>> Ewelina
>>
>

-- 
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/25e5a725-8dde-4d4c-8cc0-05b7b284cb1bn%40googlegroups.com.


Jenkinsfile: java.lang.NoSuchMethodError: No such DSL method 'agent' found among steps

2020-12-15 Thread Adrian Wyssmann
I have the following shared-library file *defaultCiPipelineGeneric.groovy*

def call(body) {
// evaluate the body block, and collect configuration into the object
def pipelineParams= [:]
body.resolveStrategy = Closure.DELEGATE_FIRST
body.delegate = pipelineParams
body()

pipelineParams = initializePipeline(pipelineParams, 
pipelineParams.buildType)

pipeline {
agent {
label pipelineParams.nodes
}
...


The pipeline is then uses as follows (e.g. in 
*jenkins-pipeline-demo-generic*):
library identifier: "pipeline-helper@master"

defaultCiPipelineGeneric {
nodes   = 'windows-test'
buildScript = 'build.groovy'
}

That actually works fine. Now If i introduce additional methods like this:
def call(body) {
this.call(body, null)
}

def call(body, buildFunction) {
this.call(body, null, null)
}

def call(body, buildFunction, deployFunction) {
// evaluate the body block, and collect configuration into the object
def pipelineParams= [:]
body.resolveStrategy = Closure.DELEGATE_FIRST
body.delegate = pipelineParams
body()

pipelineParams = initializePipeline(pipelineParams, 
pipelineParams.buildType)

pipeline {
agent {
label pipelineParams.nodes
}

This fails with java.lang.NoSuchMethodError: No such DSL method 'agent' 
found among steps

Why does that not 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/40965400-9f4d-4dbf-8375-35558fb0f731n%40googlegroups.com.