Hortonworks Sandbox Forum

hiveserver2 tries to log to /hiveserver2.log in HDP Sandbox 2.1

  • #52470

    Hi there,

    in HDP Sandbox 2.1, hiveserver2 tries to log to /hiveserver2.log and fails because of permissions.
    Although, it does manage to write this failed logging attempt to /var/log/hive/hive-server2.log:

    log4j:ERROR setFile(null,true) call failed.
    java.io.FileNotFoundException: /hiveserver2.log (Permission denied)
    at java.io.FileOutputStream.open(Native Method)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:221)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:142)
    at org.apache.log4j.FileAppender.setFile(FileAppender.java:294)
    at org.apache.log4j.FileAppender.activateOptions(FileAppender.java:165)
    at org.apache.log4j.DailyRollingFileAppender.activateOptions(DailyRollingFileAppender.java:223)
    at org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:307)
    at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:172)
    at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:104)
    at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:842)
    at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:768)
    at org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConfigurator.java:648)
    at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:514)
    at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:580)
    at org.apache.log4j.PropertyConfigurator.configure(PropertyConfigurator.java:415)
    at org.apache.hadoop.hive.common.LogUtils.initHiveLog4jDefault(LogUtils.java:127)
    at org.apache.hadoop.hive.common.LogUtils.initHiveLog4jCommon(LogUtils.java:77)
    at org.apache.hadoop.hive.common.LogUtils.initHiveLog4j(LogUtils.java:58)
    at org.apache.hive.service.server.HiveServer2.main(HiveServer2.java:143)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.hadoop.util.RunJar.main(RunJar.java:212)
    log4j:ERROR Either File or DatePattern options are not set for appender [DRFA].

    Is there a bug-tracker where such packaging issues should be reported to?

    Best regards,

to create new topics or reply. | New User Registration

  • Author
  • #52547

    Hi Michael,
    I would be happy to report this and log a defect in the Hortonworks internal JIRA. Can you please confirm for me who the owner of the directory is, both group and owner as well as permissions? I just downloaded the sandbox and show it to be hive:hadoop 644.



    Hi Ian,

    as you described, the permissions of /var/log/hive are ok:
    [root@sandbox ~]# ls -ladh /var/log/hive
    drwxr-xr-x 2 hive hadoop 4,0K 29. Apr 06:42 /var/log/hive

    Unfortunately, hiveserver2 tries to log to the root-directory “/” and reports the mentioned permission problem. The real issue is the configuration setting for the log directory.

    Best regards,

You must be to reply to this topic. | Create Account

Support from the Experts

A HDP Support Subscription connects you experts with deep experience running Apache Hadoop in production, at-scale on the most demanding workloads.

Enterprise Support »

Become HDP Certified

Real world training designed by the core architects of Hadoop. Scenario-based training courses are available in-classroom or online from anywhere in the world

Training »

Hortonworks Data Platform
The Hortonworks Data Platform is a 100% open source distribution of Apache Hadoop that is truly enterprise grade having been built, tested and hardened with enterprise rigor.
Get started with Sandbox
Hortonworks Sandbox is a self-contained virtual machine with Apache Hadoop pre-configured alongside a set of hands-on, step-by-step Hadoop tutorials.
Modern Data Architecture
Tackle the challenges of big data. Hadoop integrates with existing EDW, RDBMS and MPP systems to deliver lower cost, higher capacity infrastructure.