Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-16009

Unable to launch cocoa application through post build script

      I have a sample NSApplication to be launched through post build shell script. The shell script tries to open the application with the argument provided. But this fails to load the UI (nib file) and gives an error message "Terminating app due to uncaught exception NSInternalInconsistencyException, reason: Error (1002) creating CGSWindow".
      The screenshot of the exception and also the configuration is attached.
      I am also attaching the test app(testApp.zip) and the script file(script.zip) used.

        1. configuration.png
          configuration.png
          65 kB
        2. exception.png
          exception.png
          113 kB
        3. script.zip
          0.9 kB
        4. testApp.zip
          2.24 MB

          [JENKINS-16009] Unable to launch cocoa application through post build script

          Sami Tikka added a comment -

          The standard Jenkins Mac installer sets up a launch daemon to run Jenkins in a system context where it has no access to the graphical display. Thus anything launched by Jenkins is unable to open windows or draw on the screen.

          If that is really necessary, the user must

          sudo launchctl unload /Library/LaunchDaemons/org.jenkins-ci.plist
          

          and then move the file into ~/Library/LaunchAgents of a real user who logs in and creates a graphical session. Also the plist file might need a couple of changes... or use https://github.com/stisti/jenkins-app

          I would close this ticket but as it is owned by someone else, I'll leave the decision to him.

          Sami Tikka added a comment - The standard Jenkins Mac installer sets up a launch daemon to run Jenkins in a system context where it has no access to the graphical display. Thus anything launched by Jenkins is unable to open windows or draw on the screen. If that is really necessary, the user must sudo launchctl unload /Library/LaunchDaemons/org.jenkins-ci.plist and then move the file into ~/Library/LaunchAgents of a real user who logs in and creates a graphical session. Also the plist file might need a couple of changes... or use https://github.com/stisti/jenkins-app I would close this ticket but as it is owned by someone else, I'll leave the decision to him.

          Not a PostBuildScript plugin issue.

          Gregory Boissinot added a comment - Not a PostBuildScript plugin issue.

            gbois Gregory Boissinot
            sharones Sharone Sequeira
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: