Re: Jenkins error when running the project on Mac but not on windows

2023-02-13 Thread Alex Earl
It looks like your workspace is not setup correctly on your Mac agent. Does
your pipeline reference a specific path? The path setup will be completely
different on Windows vs. Mac.

On Mon, Feb 13, 2023 at 1:47 PM John Patrick  wrote:

> Try installing gitbash on the windows machine, then in global
> configurations define where git is located.
> I've had similar, as it's trying to access /usr/bin/git which won't exist
> at that location on windows.
>
>
> On Mon, 13 Feb 2023 at 18:55, Andrei Suslov  wrote:
>
>> I have two nodes: win and mac. On windows, my pipeline script runs fine,
>> and on mac it gives me this error:
>> java.io.IOException: CreateProcess error=2, The system cannot find the
>> file specifiedat java.base/java.lang.ProcessImpl.create(Native Method)
>>at java.base/java.lang.ProcessImpl.(ProcessImpl.java:494)at
>> java.base/java.lang.ProcessImpl.start(ProcessImpl.java:159)at
>> java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1110) Caused:
>> java.io.IOException: Cannot run program "/usr/bin/git" (in directory
>> "C:\Users\administrator.BSI\AppData\Local\Jenkins\.jenkins\caches\git-bde1e1064a79b70e5586f2d6a66af68e"):
>> CreateProcess error=2, The system cannot find the file specified
>>
>> What can I do to run the pipeline script successfully on Mac?
>>
>> --
>> 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/cf990163-29bb-44e4-8004-a5b0a66c628bn%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/CAH9u10kSiQvU5XDO0ZhUDCJRt%2BmyX52OWwduA5URLtqK1m3x2w%40mail.gmail.com
> 
> .
>


-- 
Website: http://earl-of-code.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/CAPiUgVf4Z%3DmkjxjJV7NrbqnUTd%2BtPyAoCnY7Bethz61J5meqAw%40mail.gmail.com.


Re: Jenkins error when running the project on Mac but not on windows

2023-02-13 Thread John Patrick
Try installing gitbash on the windows machine, then in global
configurations define where git is located.
I've had similar, as it's trying to access /usr/bin/git which won't exist
at that location on windows.


On Mon, 13 Feb 2023 at 18:55, Andrei Suslov  wrote:

> I have two nodes: win and mac. On windows, my pipeline script runs fine,
> and on mac it gives me this error:
> java.io.IOException: CreateProcess error=2, The system cannot find the
> file specifiedat java.base/java.lang.ProcessImpl.create(Native Method)
>at java.base/java.lang.ProcessImpl.(ProcessImpl.java:494)at
> java.base/java.lang.ProcessImpl.start(ProcessImpl.java:159)at
> java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1110) Caused:
> java.io.IOException: Cannot run program "/usr/bin/git" (in directory
> "C:\Users\administrator.BSI\AppData\Local\Jenkins\.jenkins\caches\git-bde1e1064a79b70e5586f2d6a66af68e"):
> CreateProcess error=2, The system cannot find the file specified
>
> What can I do to run the pipeline script successfully on Mac?
>
> --
> 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/cf990163-29bb-44e4-8004-a5b0a66c628bn%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/CAH9u10kSiQvU5XDO0ZhUDCJRt%2BmyX52OWwduA5URLtqK1m3x2w%40mail.gmail.com.


Jenkins error when running the project on Mac but not on windows

2023-02-13 Thread Andrei Suslov
I have two nodes: win and mac. On windows, my pipeline script runs fine, 
and on mac it gives me this error:
java.io.IOException: CreateProcess error=2, The system cannot find the file 
specifiedat java.base/java.lang.ProcessImpl.create(Native Method)at 
java.base/java.lang.ProcessImpl.(ProcessImpl.java:494)at 
java.base/java.lang.ProcessImpl.start(ProcessImpl.java:159)at 
java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1110) Caused: 
java.io.IOException: Cannot run program "/usr/bin/git" (in directory 
"C:\Users\administrator.BSI\AppData\Local\Jenkins\.jenkins\caches\git-bde1e1064a79b70e5586f2d6a66af68e"):
 
CreateProcess error=2, The system cannot find the file specified

What can I do to run the pipeline script successfully on Mac?

-- 
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/cf990163-29bb-44e4-8004-a5b0a66c628bn%40googlegroups.com.


Re: LDAP security realm / groovy init script issue

2023-02-13 Thread Baptiste Mathus
Hi,

It looks like you should heavily consider using Jenkins Configuration As
Code.
See https://plugins.jenkins.io/ldap/#plugin-content-configuration-with-jcasc

Using system Groovy scripting like your code is doing is much more risky
(this could well break an instance) and reserved to experts as it directly
manipulates the Jenkins API (i.e. no guarantee that it will keep working
durably).

> Shall i create a ticket?

This looks more like a support request than an actual bug at this point. So
I'd say not yet at least.


Le lun. 13 févr. 2023 à 11:26, geoffroy...@gmail.com <
geoffroy.jabou...@gmail.com> a écrit :

> Hi
> sorry to bump this thread, but i was not able to find a solution.
> Any idea? Shall i create a ticket?
> Thx
>
> On Friday, 27 January 2023 at 10:37:21 UTC+1 geoffroy...@gmail.com wrote:
>
>> Hi Thomas
>> thanks for your answer.
>> i tried it (and googled a bit about java boolean vs Boolean), but no
>> success, still same error.
>> I also tried variations of Boolean.TRUE instead of true for another
>> function call, and it worked fine.
>> So seems the issue is not related to such confusion...
>>
>>
>> On Friday, 27 January 2023 at 08:15:20 UTC+1 Thomas Markus wrote:
>>
>>> Hi,
>>>
>>> Am 26.01.23 um 18:14 schrieb geoffroy...@gmail.com:
>>>
>>> Hello
>>>
>>> i am trying to configure LDAP Security Realm using groovy init script.
>>>
>>> So far, it works fine, but i am not able to Disable Role Prefixing using
>>> the method  setDisableRolePrefixing
>>> 
>>>
>>> Code:
>>> ...
>>> instance.securityRealm = new LDAPSecurityRealm(...)
>>> instance.securityRealm.*setDisableRolePrefixing*​(true)
>>> instance.save()
>>>
>>> Error is:
>>> groovy.lang.MissingMethodException: N*o signature of method:
>>> hudson.security.LDAPSecurityRealm.setDisableRolePrefixing​()* is
>>> applicable for argument types: (java.lang.Boolean) values: [true]
>>> *Possible solutions: setDisableRolePrefixing(boolean)*,
>>> isDisableRolePrefixing()
>>> at
>>> org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:71)
>>>
>>> I'm not fluent with groovy/java, and i don't understand why the method
>>> is not recognized although given possible solutions actually list the
>>> method...
>>>
>>> Thanks in advance for your help
>>>
>>> --
>>> 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/eda149c1-dba6-4cc1-ab27-7cfd416d563en%40googlegroups.com
>>> 
>>> .
>>>
>>>
>>> maybe the typical confusion between Boolean and boolean, try
>>>
>>> instance.securityRealm.setDisableRolePrefixing​(Boolean.TRUE.booleanValue())
>>> instead of
>>> instance.securityRealm.setDisableRolePrefixing​(true)
>>>
>>> best regards
>>> Thomas
>>>
>> --
> 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/d587ed9e-2588-46df-b000-4b1926a1f668n%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/CANWgJS4UxVUcJbVdNS_p8jFywU0Tryxsh2Q%3DJC-dHXFco7ZxrA%40mail.gmail.com.


Re: LDAP security realm / groovy init script issue

2023-02-13 Thread geoffroy...@gmail.com
Hi
sorry to bump this thread, but i was not able to find a solution.
Any idea? Shall i create a ticket?
Thx

On Friday, 27 January 2023 at 10:37:21 UTC+1 geoffroy...@gmail.com wrote:

> Hi Thomas
> thanks for your answer.
> i tried it (and googled a bit about java boolean vs Boolean), but no 
> success, still same error.
> I also tried variations of Boolean.TRUE instead of true for another 
> function call, and it worked fine.
> So seems the issue is not related to such confusion...
>
>
> On Friday, 27 January 2023 at 08:15:20 UTC+1 Thomas Markus wrote:
>
>> Hi,
>>
>> Am 26.01.23 um 18:14 schrieb geoffroy...@gmail.com:
>>
>> Hello 
>>
>> i am trying to configure LDAP Security Realm using groovy init script.
>>
>> So far, it works fine, but i am not able to Disable Role Prefixing using 
>> the method  setDisableRolePrefixing 
>> 
>>
>> Code:
>> ...
>> instance.securityRealm = new LDAPSecurityRealm(...)
>> instance.securityRealm.*setDisableRolePrefixing*​(true)
>> instance.save()
>>
>> Error is: 
>> groovy.lang.MissingMethodException: N*o signature of method: 
>> hudson.security.LDAPSecurityRealm.setDisableRolePrefixing​()* is 
>> applicable for argument types: (java.lang.Boolean) values: [true]
>> *Possible solutions: setDisableRolePrefixing(boolean)*, 
>> isDisableRolePrefixing()
>> at 
>> org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:71)
>>
>> I'm not fluent with groovy/java, and i don't understand why the method is 
>> not recognized although given possible solutions actually list the method...
>>
>> Thanks in advance for your help
>>
>> -- 
>> 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/eda149c1-dba6-4cc1-ab27-7cfd416d563en%40googlegroups.com
>>  
>> 
>> .
>>
>>
>> maybe the typical confusion between Boolean and boolean, try
>>
>> instance.securityRealm.setDisableRolePrefixing​(Boolean.TRUE.booleanValue())
>> instead of 
>> instance.securityRealm.setDisableRolePrefixing​(true)
>>
>> best regards
>> Thomas
>>
>

-- 
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/d587ed9e-2588-46df-b000-4b1926a1f668n%40googlegroups.com.