Uploaded image for project: 'JS - JobScheduler'
  1. JS - JobScheduler
  2. JS-1555

Java Process started by an Agent should not use the parameter -DLOGFILE for logging alike the Agent start

    XMLWordPrintable

Details

    Description

      Current Behavior

      • API Job is configured to run on an Agent
      • JobScheduler Master throws the following log lines:
        SCHEDULER-726  Task runs on remote scheduler http://agent1:4445
        2015-12-09 12:40:13.531+0100 [info]   (Task test/js-1524/job_monitor_js_1524:97220) [stderr] log4j:ERROR setFile(null,true) call failed.
        2015-12-09 12:40:13.534+0100 [info]   (Task test/js-1524/job_monitor_js_1524:97220) [stderr] java.io.FileNotFoundException: .log (Keine Berechtigung)
        2015-12-09 12:40:13.537+0100 [info]   (Task test/js-1524/job_monitor_js_1524:97220) [stderr] 	at java.io.FileOutputStream.open0(Native Method)
        2015-12-09 12:40:13.540+0100 [info]   (Task test/js-1524/job_monitor_js_1524:97220) [stderr] 	at java.io.FileOutputStream.open(FileOutputStream.java:270)
        2015-12-09 12:40:13.542+0100 [info]   (Task test/js-1524/job_monitor_js_1524:97220) [stderr] 	at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
        2015-12-09 12:40:13.544+0100 [info]   (Task test/js-1524/job_monitor_js_1524:97220) [stderr] 	at java.io.FileOutputStream.<init>(FileOutputStream.java:133)
        2015-12-09 12:40:13.547+0100 [info]   (Task test/js-1524/job_monitor_js_1524:97220) [stderr] 	at org.apache.log4j.FileAppender.setFile(FileAppender.java:294)
        2015-12-09 12:40:13.549+0100 [info]   (Task test/js-1524/job_monitor_js_1524:97220) [stderr] 	at org.apache.log4j.FileAppender.activateOptions(FileAppender.java:165)
        2015-12-09 12:40:13.551+0100 [info]   (Task test/js-1524/job_monitor_js_1524:97220) [stderr] 	at org.apache.log4j.DailyRollingFileAppender.activateOptions(DailyRollingFileAppender.java:223)
        2015-12-09 12:40:13.554+0100 [info]   (Task test/js-1524/job_monitor_js_1524:97220) [stderr] 	at org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:307)
        2015-12-09 12:40:13.556+0100 [info]   (Task test/js-1524/job_monitor_js_1524:97220) [stderr] 	at org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:295)
        2015-12-09 12:40:13.559+0100 [info]   (Task test/js-1524/job_monitor_js_1524:97220) [stderr] 	at org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.java:176)
        2015-12-09 12:40:13.561+0100 [info]   (Task test/js-1524/job_monitor_js_1524:97220) [stderr] 	at org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigurator.java:191)
        2015-12-09 12:40:13.564+0100 [info]   (Task test/js-1524/job_monitor_js_1524:97220) [stderr] 	at org.apache.log4j.xml.DOMConfigurator.parseChildrenOfLoggerElement(DOMConfigurator.java:523)
        2015-12-09 12:40:13.566+0100 [info]   (Task test/js-1524/job_monitor_js_1524:97220) [stderr] 	at org.apache.log4j.xml.DOMConfigurator.parseRoot(DOMConfigurator.java:492)
        2015-12-09 12:40:13.568+0100 [info]   (Task test/js-1524/job_monitor_js_1524:97220) [stderr] 	at org.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:1001)
        2015-12-09 12:40:13.571+0100 [info]   (Task test/js-1524/job_monitor_js_1524:97220) [stderr] 	at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:867)
        2015-12-09 12:40:13.573+0100 [info]   (Task test/js-1524/job_monitor_js_1524:97220) [stderr] 	at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:773)
        2015-12-09 12:40:13.575+0100 [info]   (Task test/js-1524/job_monitor_js_1524:97220) [stderr] 	at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:483)
        2015-12-09 12:40:13.578+0100 [info]   (Task test/js-1524/job_monitor_js_1524:97220) [stderr] 	at org.apache.log4j.LogManager.<clinit>(LogManager.java:127)
        2015-12-09 12:40:13.580+0100 [info]   (Task test/js-1524/job_monitor_js_1524:97220) [stderr] 	at org.slf4j.impl.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:64)
        2015-12-09 12:40:13.582+0100 [info]   (Task test/js-1524/job_monitor_js_1524:97220) [stderr] 	at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:285)
        2015-12-09 12:40:13.584+0100 [info]   (Task test/js-1524/job_monitor_js_1524:97220) [stderr] 	at com.sos.scheduler.engine.common.scalautil.Logger$.apply(Logger.scala:104)
        2015-12-09 12:40:13.587+0100 [info]   (Task test/js-1524/job_monitor_js_1524:97220) [stderr] 	at com.sos.scheduler.engine.taskserver.TaskServerMain$.<init>(TaskServerMain.scala:14)
        2015-12-09 12:40:13.589+0100 [info]   (Task test/js-1524/job_monitor_js_1524:97220) [stderr] 	at com.sos.scheduler.engine.taskserver.TaskServerMain$.<clinit>(TaskServerMain.scala)
        2015-12-09 12:40:13.592+0100 [info]   (Task test/js-1524/job_monitor_js_1524:97220) [stderr] 	at com.sos.scheduler.engine.taskserver.TaskServerMain.main(TaskServerMain.scala)
        2015-12-09 12:40:13.594+0100 [info]   (Task test/js-1524/job_monitor_js_1524:97220) [stderr] log4j:ERROR Either File or DatePattern options are not set for appender [FILE].
        
      • Agent start:
        • The Agent starts with a parameter -DLOGFILE=/opt/jobscheduler_agent/logs/jobscheduler_agent_4445 which is substituted by log4j to load the log file location defined in the file /opt/jobscheduler_agent/lib/log4j.xml with the element
          <param name="File" value="${LOGFILE}.log"/>
        • The file /opt/jobscheduler_agent/lib/log4j.xml is included in the Java classpath of the Agent start.
      • Agent task:
        • The Agent starts the task for the API job with the same Java classpath as defined for the Agent start but this time without -DLOGFILE=/opt/jobscheduler_agent/logs/jobscheduler_agent_4445.
        • The Java process for the API job finds the location the log4j configuration file too but the log4j logger is not able to substitute the value ${LOGFILE}, since it has not been defined. Therefore, as it can be observed at line 3, it tries to log in a file called .log.

      Desired behavior

      • The Java process for the API job should not log into the file ${LOGFILE}.log.
      • The Java process for the API should log differently than the Agent, only logging into a task.log.

      Additional information

      • This error occurs only for API jobs and not for shell jobs.
      • This error has been thrown only for Agents running on a Linux machine. This error was not thrown when running the same task on a Windows Agent.

      Attachments

        Activity

          People

            oh Oliver Haufe
            vg Victor Garcia-Beltran (Inactive)
            Victor Garcia-Beltran Victor Garcia-Beltran (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 1 day
                1d
                Remaining:
                Remaining Estimate - 1 day
                1d
                Logged:
                Time Spent - Not Specified
                Not Specified