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

Wrong auto-detected editor.log PATH on system user on Windows

    Details

    • Similar Issues:

      Description

      Reported https://github.com/lacostej/jenkins-unity3d-plugin/issues/4

      Piping unity Editor.log from C:\Windows\system32\config\systemprofile\AppData\Local\Unity\Editor\Editor.log

      Editor.log path is incorrect by the following config:

      Windows 2008 X64
      Jenkins runs as services by local SYSTEM account.
      Unity 4.2.1

      The correct Unity log file path is C:\Windows\SysWOW64\config\systemprofile\AppData\Local\Unity\Editor\Editor.log

        Attachments

          Issue Links

            Activity

            Hide
            lacostej lacostej added a comment -

            I just found this comment on the Wiki https://wiki.jenkins-ci.org/display/JENKINS/Unity3dBuilder+Plugin?focusedCommentId=73532468#comment-73532468

            I've configured Global Configuration with location of Unity (custom path under "D:\Unity")

            I've added a builstep to invoke Unity and passed command line arguments, including logfile and projectpath.

            I get the following:15:09:33 FATAL: null
            15:09:33 java.lang.NullPointerException
            15:09:33 at java.io.File.<init>(Unknown Source)
            15:09:33 at org.jenkinsci.plugins.unity3d.Unity3dInstallation.getEditorLogFile(Unity3dInstallation.java:121)
            15:09:33 at org.jenkinsci.plugins.unity3d.Unity3dInstallation.access$100(Unity3dInstallation.java:35)
            15:09:33 at org.jenkinsci.plugins.unity3d.Unity3dInstallation$3.call(Unity3dInstallation.java:112)
            15:09:33 at org.jenkinsci.plugins.unity3d.Unity3dInstallation$3.call(Unity3dInstallation.java:110)
            15:09:33 at hudson.remoting.LocalChannel.call(LocalChannel.java:45)
            15:09:33 at org.jenkinsci.plugins.unity3d.Unity3dInstallation.getEditorLogPath(Unity3dInstallation.java:110)
            15:09:33 at org.jenkinsci.plugins.unity3d.Unity3dBuilder._perform(Unity3dBuilder.java:104)
            15:09:33 at org.jenkinsci.plugins.unity3d.Unity3dBuilder.perform(Unity3dBuilder.java:79)
            15:09:33 at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
            15:09:33 at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804)
            15:09:33 at hudson.model.Build$BuildExecution.build(Build.java:199)
            15:09:33 at hudson.model.Build$BuildExecution.doRun(Build.java:160)
            15:09:33 at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:585)
            15:09:33 at hudson.model.Run.execute(Run.java:1684)
            15:09:33 at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
            15:09:33 at hudson.model.ResourceController.execute(ResourceController.java:88)
            15:09:33 at hudson.model.Executor.run(Executor.java:231)

            The build works fine with same argument from the command line

            After googling a bit, Windows XP doesn't have a LOCALAPPDATA. That was strange as Unity3d supports Windows XP.

            So now the issue might be that I misread the http://docs.unity3d.com/Manual/LogFiles.html documentation. It is a bit confusing I think, as it seems that LOCALAPPDATA environment variable may not match the CIDL_LOCAL_APPDATA contents.

            Yet we are assuming that LOCALAPPDATA is going to contain the proper PATH while we should really go for CSIDL_LOCAL_APPDATA.

            A way to retrieve that value would be to use jna and
            https://github.com/twall/jna/blob/master/contrib/platform/src/com/sun/jna/platform/win32/ShlObj.java#L54

            See also http://stackoverflow.com/questions/585534/what-is-the-best-way-to-find-the-users-home-directory-in-java

            Still in most cases, -logFile would be preferred, except for the issues (#JENKINS-28567) it might cause.

            Show
            lacostej lacostej added a comment - I just found this comment on the Wiki https://wiki.jenkins-ci.org/display/JENKINS/Unity3dBuilder+Plugin?focusedCommentId=73532468#comment-73532468 I've configured Global Configuration with location of Unity (custom path under "D:\Unity") I've added a builstep to invoke Unity and passed command line arguments, including logfile and projectpath. I get the following:15:09:33 FATAL: null 15:09:33 java.lang.NullPointerException 15:09:33 at java.io.File.<init>(Unknown Source) 15:09:33 at org.jenkinsci.plugins.unity3d.Unity3dInstallation.getEditorLogFile(Unity3dInstallation.java:121) 15:09:33 at org.jenkinsci.plugins.unity3d.Unity3dInstallation.access$100(Unity3dInstallation.java:35) 15:09:33 at org.jenkinsci.plugins.unity3d.Unity3dInstallation$3.call(Unity3dInstallation.java:112) 15:09:33 at org.jenkinsci.plugins.unity3d.Unity3dInstallation$3.call(Unity3dInstallation.java:110) 15:09:33 at hudson.remoting.LocalChannel.call(LocalChannel.java:45) 15:09:33 at org.jenkinsci.plugins.unity3d.Unity3dInstallation.getEditorLogPath(Unity3dInstallation.java:110) 15:09:33 at org.jenkinsci.plugins.unity3d.Unity3dBuilder._perform(Unity3dBuilder.java:104) 15:09:33 at org.jenkinsci.plugins.unity3d.Unity3dBuilder.perform(Unity3dBuilder.java:79) 15:09:33 at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) 15:09:33 at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804) 15:09:33 at hudson.model.Build$BuildExecution.build(Build.java:199) 15:09:33 at hudson.model.Build$BuildExecution.doRun(Build.java:160) 15:09:33 at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:585) 15:09:33 at hudson.model.Run.execute(Run.java:1684) 15:09:33 at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) 15:09:33 at hudson.model.ResourceController.execute(ResourceController.java:88) 15:09:33 at hudson.model.Executor.run(Executor.java:231) The build works fine with same argument from the command line After googling a bit, Windows XP doesn't have a LOCALAPPDATA. That was strange as Unity3d supports Windows XP. So now the issue might be that I misread the http://docs.unity3d.com/Manual/LogFiles.html documentation. It is a bit confusing I think, as it seems that LOCALAPPDATA environment variable may not match the CIDL_LOCAL_APPDATA contents. Yet we are assuming that LOCALAPPDATA is going to contain the proper PATH while we should really go for CSIDL_LOCAL_APPDATA. A way to retrieve that value would be to use jna and https://github.com/twall/jna/blob/master/contrib/platform/src/com/sun/jna/platform/win32/ShlObj.java#L54 See also http://stackoverflow.com/questions/585534/what-is-the-best-way-to-find-the-users-home-directory-in-java Still in most cases, -logFile would be preferred, except for the issues (# JENKINS-28567 ) it might cause.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jerome Lacoste
            Path:
            src/main/java/org/jenkinsci/plugins/unity3d/Unity3dInstallation.java
            http://jenkins-ci.org/commit/unity3d-plugin/6859427102914f0906f68aa4317e43191b971e7b
            Log:
            JENKINS-24265: detect when environment variable isn't set. Point to issue and workaround

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jerome Lacoste Path: src/main/java/org/jenkinsci/plugins/unity3d/Unity3dInstallation.java http://jenkins-ci.org/commit/unity3d-plugin/6859427102914f0906f68aa4317e43191b971e7b Log: JENKINS-24265 : detect when environment variable isn't set. Point to issue and workaround
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jerome Lacoste
            Path:
            src/main/java/org/jenkinsci/plugins/unity3d/Unity3dInstallation.java
            src/main/java/org/jenkinsci/plugins/unity3d/Win32Util.java
            http://jenkins-ci.org/commit/unity3d-plugin/a7e66b6e3942f7e76c7cee8acf28216c9add5330
            Log:
            [FIXED JENKINS-24265] provide a proper detection of the %LOCALAPPDATA% directory on Windows based on Unity3d recommendation (look for CSIDL_LOCAL_APPDATA)

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jerome Lacoste Path: src/main/java/org/jenkinsci/plugins/unity3d/Unity3dInstallation.java src/main/java/org/jenkinsci/plugins/unity3d/Win32Util.java http://jenkins-ci.org/commit/unity3d-plugin/a7e66b6e3942f7e76c7cee8acf28216c9add5330 Log: [FIXED JENKINS-24265] provide a proper detection of the %LOCALAPPDATA% directory on Windows based on Unity3d recommendation (look for CSIDL_LOCAL_APPDATA)
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jerome Lacoste
            Path:
            src/main/java/org/jenkinsci/plugins/unity3d/Unity3dInstallation.java
            http://jenkins-ci.org/commit/unity3d-plugin/132fa331f43ea8e21e7448e67b95975d7ec2bba0
            Log:
            JENKINS-24265: document the unnecessary obsolete fallback code

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jerome Lacoste Path: src/main/java/org/jenkinsci/plugins/unity3d/Unity3dInstallation.java http://jenkins-ci.org/commit/unity3d-plugin/132fa331f43ea8e21e7448e67b95975d7ec2bba0 Log: JENKINS-24265 : document the unnecessary obsolete fallback code
            Hide
            lacostej lacostej added a comment -

            I've tested this briefly on a Windows 7 JNLP slave. It requires more testing. If you have a computer which was affected by the previous behavior, feel free to report whether this now works or not.

            Show
            lacostej lacostej added a comment - I've tested this briefly on a Windows 7 JNLP slave. It requires more testing. If you have a computer which was affected by the previous behavior, feel free to report whether this now works or not.

              People

              • Assignee:
                lacostej lacostej
                Reporter:
                lacostej lacostej
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: