• Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Critical Critical
    • matlab-plugin
    • jenkins 2.450 pipelinescript using MATLAB plugin 2.12, MATLAB 2021b

      When trying to execute a simple MATLAB command (e.g. runMATLABCommand(command: 'disp("Hello World!")')) I get the console output:

      Hello World!

      ERROR: MATLAB error Exit Status: 0x00000001 exit status 1

      I tried it with MATLAB R2017b and R2021b. The error arises only with R2021b.

       

          [JENKINS-72899] MATLAB R2021b get exit Error

          Hi Lukas,

          Could you please try the solution mentioned below
          https://in.mathworks.com/matlabcentral/answers/765851-why-do-jenkins-builds-with-matlab-fail-on-a-windows-machine

          Regards
          Nikhil

          MathWorks Ci Team added a comment - Hi Lukas, Could you please try the solution mentioned below https://in.mathworks.com/matlabcentral/answers/765851-why-do-jenkins-builds-with-matlab-fail-on-a-windows-machine Regards Nikhil

          This is not a bug. This may be due to license conflicts of Jenkins running as SYSTEM user and MATLAB having permission to the different user. as mentioned here
          https://in.mathworks.com/matlabcentral/answers/765851-why-do-jenkins-builds-with-matlab-fail-on-a-windows-machine

          MathWorks Ci Team added a comment - This is not a bug. This may be due to license conflicts of Jenkins running as SYSTEM user and MATLAB having permission to the different user. as mentioned here https://in.mathworks.com/matlabcentral/answers/765851-why-do-jenkins-builds-with-matlab-fail-on-a-windows-machine

          Lukas added a comment -

          Thank you for your response. I had previously encountered and attempted the solution you mentioned, but unfortunately, it didn't resolve my issue. I'd like to add a couple of key points to clarify the context:

          1. Jenkins is configured to run as a program rather than a service, specifically to allow interactions with the desktop.
          2. The problem exclusively occurs with MATLAB R2021b, whereas R2017b operates as expected on the same machine and under the same user account. This distinction suggests that licensing for R2021b is unlikely to be the source of the issue.
          3. The system works when I use a CMake script to execute MATLAB.

          Lukas added a comment - Thank you for your response. I had previously encountered and attempted the solution you mentioned, but unfortunately, it didn't resolve my issue. I'd like to add a couple of key points to clarify the context: Jenkins is configured to run as a program rather than a service, specifically to allow interactions with the desktop. The problem exclusively occurs with MATLAB R2021b, whereas R2017b operates as expected on the same machine and under the same user account. This distinction suggests that licensing for R2021b is unlikely to be the source of the issue. The system works when I use a CMake script to execute MATLAB.

          Hi Lukas ,

          Could you please try running MATLAB command through command line outside of the Jenkins and see if it works

          • open shell or command window (Not MATLAB command console)
          • try running this command
          • matlab -batch "ver"
          • Make sure you are using R2021b MATLAB. if not please update the system path accordingly.
          • please send the result of this run on CLI

          Regards
          Nikhil

          MathWorks Ci Team added a comment - Hi Lukas , Could you please try running MATLAB command through command line outside of the Jenkins and see if it works open shell or command window (Not MATLAB command console) try running this command matlab -batch "ver" Make sure you are using R2021b MATLAB. if not please update the system path accordingly. please send the result of this run on CLI Regards Nikhil

          Lukas added a comment -

          Hi and thanks for the reply!

          You can find the cmd output below.
          Note, that I have removed my MATLAB Licence Number.

          Best Regards,
          Lukas

          C:\>matlab -batch "ver"
          -----------------------------------------------------------------------------------------------------
          MATLAB Version: 9.11.0.1873467 (R2021b) Update 3
          MATLAB License Number: 
          Operating System: Microsoft Windows 10 Pro Version 10.0 (Build 19045)
          Java Version: Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
          -----------------------------------------------------------------------------------------------------
          MATLAB                                                Version 9.11        (R2021b)
          Simulink                                              Version 10.4        (R2021b)
          Control System Toolbox                                Version 10.11       (R2021b)
          MATLAB Coder                                          Version 5.3         (R2021b)
          Optimization Toolbox                                  Version 9.2         (R2021b)
          Signal Processing Toolbox                             Version 8.7         (R2021b)
          Simscape                                              Version 5.2         (R2021b)
          Simscape Multibody                                    Version 7.4         (R2021b)
          Simulink Coder                                        Version 9.6         (R2021b)
          Stateflow                                             Version 10.5        (R2021b)
          Symbolic Math Toolbox                                 Version 9.0         (R2021b)
          ERROR: MATLAB error Exit Status: 0x00000001
          

          Lukas added a comment - Hi and thanks for the reply! You can find the cmd output below. Note, that I have removed my MATLAB Licence Number. Best Regards, Lukas C:\>matlab -batch "ver" ----------------------------------------------------------------------------------------------------- MATLAB Version: 9.11.0.1873467 (R2021b) Update 3 MATLAB License Number : Operating System : Microsoft Windows 10 Pro Version 10.0 (Build 19045) Java Version: Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode ----------------------------------------------------------------------------------------------------- MATLAB Version 9.11 (R2021b) Simulink Version 10.4 (R2021b) Control System Toolbox Version 10.11 (R2021b) MATLAB Coder Version 5.3 (R2021b) Optimization Toolbox Version 9.2 (R2021b) Signal Processing Toolbox Version 8.7 (R2021b) Simscape Version 5.2 (R2021b) Simscape Multibody Version 7.4 (R2021b) Simulink Coder Version 9.6 (R2021b) Stateflow Version 10.5 (R2021b) Symbolic Math Toolbox Version 9.0 (R2021b) ERROR: MATLAB error Exit Status: 0x00000001

          Thanks lukas,

          based on your both output I can see that Jenkins and the command line is successfully running the command however its just the that MATLAB is printing an extra ERROR at the end of the command execution. This at least concludes that the issue is not with the Jenkins plugin , you are able to reproduce it out of Jenkins too. for this error could you please try solution below
          https://www.mathworks.com/matlabcentral/answers/1926120-running-matlab-batch-error-error-matlab-error-exit-status-0x00000001

          MathWorks Ci Team added a comment - Thanks lukas, based on your both output I can see that Jenkins and the command line is successfully running the command however its just the that MATLAB is printing an extra ERROR at the end of the command execution. This at least concludes that the issue is not with the Jenkins plugin , you are able to reproduce it out of Jenkins too. for this error could you please try solution below https://www.mathworks.com/matlabcentral/answers/1926120-running-matlab-batch-error-error-matlab-error-exit-status-0x00000001

          Lukas added a comment -

          Yes, I agree with that! Unfortunately I've done the suggested solution before and tried it again now, but the console output when running matlab -batch "ver" is exactly the same.

          Lukas added a comment - Yes, I agree with that! Unfortunately I've done the suggested solution before and tried it again now, but the console output when running matlab -batch "ver" is exactly the same.

          As customer can reproduce it outsid eof the Jenkins its not a Jenkins plugin defect. Provided the solution to the the error message and closing this issue

          MathWorks Ci Team added a comment - As customer can reproduce it outsid eof the Jenkins its not a Jenkins plugin defect. Provided the solution to the the error message and closing this issue

          Lukas added a comment -

          Nevertheless, a working solution would be nice.

          Lukas added a comment - Nevertheless, a working solution would be nice.

          I would suggest you to contact MathWorks support team https://in.mathworks.com/help/matlab/matlab_env/contact-technical-support.html for further help on the license error.

          MathWorks Ci Team added a comment - I would suggest you to contact MathWorks support team https://in.mathworks.com/help/matlab/matlab_env/contact-technical-support.html for further help on the license error.

            luki984 Lukas
            luki984 Lukas
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: