• Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • groovy-plugin
    • None
    • Windows 7

      I tried to configure auto install(see attached), didn't work - did not try to install and did not find groovy.
      i installed groovy myself on the node, added it to the path on the node, deleted the node from jenkins and configured again, ran the job, saw the groovy on the path variable in the job in jenkins, still it cannot find groovy.
      Groovy works fine on the node but when i run jenkins it cannot find it..

      P.S. when i run groovy in jenkins in "execute windows batch command" it finds it, the problem is with "execute groovy script"

      I have no more ideas, please help.

          [JENKINS-29422] Cannot run program "groovy"

          simon werling added a comment - - edited

          Hello,

          I have the same problem.

          Jenkins ver. 1.621
          Groovy binaries 2.4.4
          JRE 1.8.0_31

          Groovy bin. dir added to PATH
          GROOVY_HOME set correctly
          afterwards started the jenkins slave

          Out of the windows batch in the jenkins job - groovy can be called
          when using the slave side executed groovy plugin code -> groovy exe can not be found

          are any plans existing to fix that?

          I´m not happy with the automatic groovy installation on the clients.

          1. it doesn´t recognize in many cases that there is no groovy installed
          2. if it is installing (juhu), the job aborts (because it takes 'too' long) and in the background java is still downloading the groovy package - you will only see that, when you observe your process list. There is no other hint.

          thank you for any help, simon

          simon werling added a comment - - edited Hello, I have the same problem. Jenkins ver. 1.621 Groovy binaries 2.4.4 JRE 1.8.0_31 Groovy bin. dir added to PATH GROOVY_HOME set correctly afterwards started the jenkins slave Out of the windows batch in the jenkins job - groovy can be called when using the slave side executed groovy plugin code -> groovy exe can not be found are any plans existing to fix that? I´m not happy with the automatic groovy installation on the clients. 1. it doesn´t recognize in many cases that there is no groovy installed 2. if it is installing (juhu), the job aborts (because it takes 'too' long) and in the background java is still downloading the groovy package - you will only see that, when you observe your process list. There is no other hint. thank you for any help, simon

          simon werling added a comment - - edited

          16:57:10 next nodes: [][SIMONTEST_SETUP] $ cmd /c call c:\temp\hudson2594808757146012965.bat
          16:57:11 Groovy Version: 2.4.4 JVM: 1.7.0_17 Vendor: Oracle Corporation OS: Windows 7 <- running fine out of win. cmd
          16:57:11 [SIMONTEST_SETUP] $ groovy c:\\_HUDSON\workspace\SIMONTEST_SETUP\hudson2548118167563489193.groovy
          16:57:11 FATAL: command execution failed <- not working for the groovy plugin
          16:57:11 java.io.IOException: Cannot run program "groovy" (in directory "c:\\_HUDSON\workspace\SIMONTEST_SETUP"): CreateProcess error=2, The system cannot find the file specified
          16:57:11 at java.lang.ProcessBuilder.start(Unknown Source)

          simon werling added a comment - - edited 16:57:10 next nodes: [] [SIMONTEST_SETUP] $ cmd /c call c:\temp\hudson2594808757146012965.bat 16:57:11 Groovy Version: 2.4.4 JVM: 1.7.0_17 Vendor: Oracle Corporation OS: Windows 7 <- running fine out of win. cmd 16:57:11 [SIMONTEST_SETUP] $ groovy c:\\_HUDSON\workspace\SIMONTEST_SETUP\hudson2548118167563489193.groovy 16:57:11 FATAL: command execution failed <- not working for the groovy plugin 16:57:11 java.io.IOException: Cannot run program "groovy" (in directory "c:\\_HUDSON\workspace\SIMONTEST_SETUP"): CreateProcess error=2, The system cannot find the file specified 16:57:11 at java.lang.ProcessBuilder.start(Unknown Source)

          vjuranek added a comment -

          Hi Simon,
          yes, I'd like to fix it, but I cannot reproduce it and haven't enough information to figure out where the problem could be. Jenkins for some reason doesn't download JSON with download URLs. Are there any other files in updates directory, i.e. is it Groovy plugin specific issue? Also is the firewall and network configured properly on your machines?

          Could you also be more specific what happens what Jenkins doesn't recognize that Groovy installation is not present on the slave?

          As for groovy not working - this is a fallback option when you haven't configured any Groovy installation, it simply calls groovy cmd and assumes you have some groovy binary on the default path. This is not a bug but intentional behavior, however, documentation can be improved in this regard and at least mention it - I already added a short note into Groovy plugin wiki page

          vjuranek added a comment - Hi Simon, yes, I'd like to fix it, but I cannot reproduce it and haven't enough information to figure out where the problem could be. Jenkins for some reason doesn't download JSON with download URLs. Are there any other files in updates directory, i.e. is it Groovy plugin specific issue? Also is the firewall and network configured properly on your machines? Could you also be more specific what happens what Jenkins doesn't recognize that Groovy installation is not present on the slave? As for groovy not working - this is a fallback option when you haven't configured any Groovy installation, it simply calls groovy cmd and assumes you have some groovy binary on the default path. This is not a bug but intentional behavior, however, documentation can be improved in this regard and at least mention it - I already added a short note into Groovy plugin wiki page

          simon werling added a comment -

          Good Morning Vjuranek,

          thanks for the fast response.

          I´m going to answer your questions soon. Give me some time to find out a bit more.

          One more question from my side.

          What is the groovy binary default path?

          Wouldn´t it make sense to call 'groovy' without any prefix-path specification? So the user can control which groovy version is called? Or is here the intention to use symbolic links to redirect?

          it would definetly help, to know, where you expect the groovy exe.

          thanks,
          simon

          simon werling added a comment - Good Morning Vjuranek, thanks for the fast response. I´m going to answer your questions soon. Give me some time to find out a bit more. One more question from my side. What is the groovy binary default path? Wouldn´t it make sense to call 'groovy' without any prefix-path specification? So the user can control which groovy version is called? Or is here the intention to use symbolic links to redirect? it would definetly help, to know, where you expect the groovy exe. thanks, simon

          vjuranek added a comment -

          Wouldn´t it make sense to call 'groovy' without any prefix-path specification?

          yes, this is exactly how it works. If you setup groovy installation, it uses full path to the installation, but (Default) call simply groovy without any prefix path, so e.g. on Linux is used the first groovy binary found on paths set in PATH environment variable - but doesn't do any auto installation and if groovy is not the PATH, it fails with an error.

          vjuranek added a comment - Wouldn´t it make sense to call 'groovy' without any prefix-path specification? yes, this is exactly how it works. If you setup groovy installation, it uses full path to the installation, but (Default) call simply groovy without any prefix path, so e.g. on Linux is used the first groovy binary found on paths set in PATH environment variable - but doesn't do any auto installation and if groovy is not the PATH , it fails with an error.

          simon werling added a comment -

          Ok, I guess i got it.

          So it seems that the PATH variable is not correctly interpreted by the running java slave process?

          see the attachment : groovy_default_and_PATH_variable_not_working.png

          simon werling added a comment - Ok, I guess i got it. So it seems that the PATH variable is not correctly interpreted by the running java slave process? see the attachment : groovy_default_and_PATH_variable_not_working.png

          simon werling added a comment -

          Hi,

          i have some workaround to avoid the automatic groovy package installation AND to get the groovy plugin working.

          see the attached image some_workaround

          simon werling added a comment - Hi, i have some workaround to avoid the automatic groovy package installation AND to get the groovy plugin working. see the attached image some_workaround

          vjuranek added a comment -

          as for groovy_default_and_PATH_variable_not_working.png - it seems to be some Windows specific issue, I need to look on it (i.e. find some windows machine), on Linux works fine

          as for some_workaround.png - in case you have already a groovy installation on local machine, you can un-check "Install automatically" field in global Jenkins configuration and set a path to the installation. It can be arbitrary directory and adding it to the PATH shouldn't be needed. What is quite common is that you have e.g. NFS drive with various tools and mount the disk when you create the slave machine or start the slave ... maybe there can be again some windows specific issues, but AFAIK should work (at least my colleagues who run some groovy scripts on windows have never complained )

          vjuranek added a comment - as for groovy_default_and_PATH_variable_not_working.png - it seems to be some Windows specific issue, I need to look on it (i.e. find some windows machine), on Linux works fine as for some_workaround.png - in case you have already a groovy installation on local machine, you can un-check "Install automatically" field in global Jenkins configuration and set a path to the installation. It can be arbitrary directory and adding it to the PATH shouldn't be needed. What is quite common is that you have e.g. NFS drive with various tools and mount the disk when you create the slave machine or start the slave ... maybe there can be again some windows specific issues, but AFAIK should work (at least my colleagues who run some groovy scripts on windows have never complained )

          simon werling added a comment -

          What is quite common is that you have e.g. NFS drive with various tools and mount the disk when you create the slave machine or start the slave ...

          Since we want to avoid network influenced false negatives in the testing area, i need to avoid this aproach. =(

          At least directly accessing the tool chain over network can be workaround by copying these tools locally, before the slave starts.

          Hope you find a proper windows testing machine soon =)

          thanks!simon

          simon werling added a comment - What is quite common is that you have e.g. NFS drive with various tools and mount the disk when you create the slave machine or start the slave ... Since we want to avoid network influenced false negatives in the testing area, i need to avoid this aproach. =( At least directly accessing the tool chain over network can be workaround by copying these tools locally, before the slave starts. Hope you find a proper windows testing machine soon =) thanks!simon

          Arno Moonen added a comment -

          Has this issue ever been resolved or is there a working workaround?

          I also have Groovy on my PATH on Windows (running a Execute batch script step with groovy -v works without any issue), yet this plugin keeps complaining that it could not find Groovy.
          Even if I define an installation and set the correct path for the installation in the node/agent tool configuration, I get:

          [GROOVY WARNING] Groovy executable is NULL, please check your Groovy configuration, trying fallback 'groovy' instead.
          [My Job That Wants To Run A Groovy Script] $ groovy "D:\jenkins\workspace\Utilities\My Job That Wants To Run A Groovy Script\hudson4182046524127121048.groovy"
          The system cannot find the file specified
          FATAL: command execution failed
          java.io.IOException: Cannot run program "groovy" (in directory "D:\jenkins\workspace\Utilities\My Job That Wants To Run A Groovy Script"): CreateProcess error=2, The system cannot find the file specified
          

          Arno Moonen added a comment - Has this issue ever been resolved or is there a working workaround? I also have Groovy on my PATH on Windows (running a Execute batch script step with groovy -v works without any issue), yet this plugin keeps complaining that it could not find Groovy. Even if I define an installation and set the correct path for the installation in the node/agent tool configuration, I get: [GROOVY WARNING] Groovy executable is NULL, please check your Groovy configuration, trying fallback 'groovy' instead. [My Job That Wants To Run A Groovy Script] $ groovy "D:\jenkins\workspace\Utilities\My Job That Wants To Run A Groovy Script\hudson4182046524127121048.groovy" The system cannot find the file specified FATAL: command execution failed java.io.IOException: Cannot run program "groovy" (in directory "D:\jenkins\workspace\Utilities\My Job That Wants To Run A Groovy Script" ): CreateProcess error=2, The system cannot find the file specified

            vjuranek vjuranek
            giladba Gilad Baruchian
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: