[ 
https://issues.apache.org/jira/browse/PIG-3210?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Meng-Sung Wu updated PIG-3210:
------------------------------

    Description: 
Pig will check whether logFileName is null or not before setting to pig.logfile 
property in some places. But forget to check in other places.


{code:xml} 
381         pigContext.getProperties().setProperty("pig.logfile", (logFileName 
== null? "": logFileName));
...
451          pigContext.getProperties().setProperty("pig.logfile", logFileName);
{code} 


{code:xml} 
12/12/25 16:38:00 WARN pig.Main: Need write permission in the directory: 
/opt/trend/hadooppet/sanity-tm-6/result to create log file.
 14 2012-12-25 16:38:00,372 [main] INFO org.apache.pig.Main - Apache Pig 
version 0.10.1.tm6 (rexported) compiled Oct 22 2012, 11:11:02
 15 2012-12-25 16:38:01,712 [main] WARN org.apache.pig.Main - Cannot write to 
log file: /opt/trend/hadooppet/sanity-tm-6/result//akamai.pig1356453481712.log
 16 2012-12-25 16:38:01,727 [main] ERROR org.apache.pig.Main - ERROR 2999: 
Unexpected internal error. null
 17 2012-12-25 16:38:01,727 [main] WARN org.apache.pig.Main - There is no log 
file to write to.
 18 2012-12-25 16:38:01,727 [main] ERROR org.apache.pig.Main - 
java.lang.NullPointerException
 19 at java.util.Hashtable.put(Hashtable.java:394)
 20 at java.util.Properties.setProperty(Properties.java:143)
 21 at org.apache.pig.Main.run(Main.java:542)
 22 at org.apache.pig.Main.main(Main.java:115)
 23 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 24 at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 25 at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 26 at java.lang.reflect.Method.invoke(Method.java:597)
 27 at org.apache.hadoop.util.RunJar.main(RunJar.java:208)
{code} 

  was:
Pig will check whether logFileName is null or not before setting to pig.logfile 
property in some places. But forget to check in other places.


{code:xml} 
 381         pigContext.getProperties().setProperty("pig.logfile", (logFileName 
== null? "": logFileName));
...
451          pigContext.getProperties().setProperty("pig.logfile", logFileName);
{code} 


{code:xml} 
12/12/25 16:38:00 WARN pig.Main: Need write permission in the directory: 
/opt/trend/hadooppet/sanity-tm-6/result to create log file.
 14 2012-12-25 16:38:00,372 [main] INFO org.apache.pig.Main - Apache Pig 
version 0.10.1.tm6 (rexported) compiled Oct 22 2012, 11:11:02
 15 2012-12-25 16:38:01,712 [main] WARN org.apache.pig.Main - Cannot write to 
log file: /opt/trend/hadooppet/sanity-tm-6/result//akamai.pig1356453481712.log
 16 2012-12-25 16:38:01,727 [main] ERROR org.apache.pig.Main - ERROR 2999: 
Unexpected internal error. null
 17 2012-12-25 16:38:01,727 [main] WARN org.apache.pig.Main - There is no log 
file to write to.
 18 2012-12-25 16:38:01,727 [main] ERROR org.apache.pig.Main - 
java.lang.NullPointerException
 19 at java.util.Hashtable.put(Hashtable.java:394)
 20 at java.util.Properties.setProperty(Properties.java:143)
 21 at org.apache.pig.Main.run(Main.java:542)
 22 at org.apache.pig.Main.main(Main.java:115)
 23 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 24 at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 25 at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 26 at java.lang.reflect.Method.invoke(Method.java:597)
 27 at org.apache.hadoop.util.RunJar.main(RunJar.java:208)
{code} 

    
> Pig fails to start when it cannot write log to log files
> --------------------------------------------------------
>
>                 Key: PIG-3210
>                 URL: https://issues.apache.org/jira/browse/PIG-3210
>             Project: Pig
>          Issue Type: Bug
>          Components: impl
>    Affects Versions: 0.10.0
>            Reporter: Meng-Sung Wu
>         Attachments: PIG-3210.patch
>
>
> Pig will check whether logFileName is null or not before setting to 
> pig.logfile property in some places. But forget to check in other places.
> {code:xml} 
> 381         pigContext.getProperties().setProperty("pig.logfile", 
> (logFileName == null? "": logFileName));
> ...
> 451          pigContext.getProperties().setProperty("pig.logfile", 
> logFileName);
> {code} 
> {code:xml} 
> 12/12/25 16:38:00 WARN pig.Main: Need write permission in the directory: 
> /opt/trend/hadooppet/sanity-tm-6/result to create log file.
>  14 2012-12-25 16:38:00,372 [main] INFO org.apache.pig.Main - Apache Pig 
> version 0.10.1.tm6 (rexported) compiled Oct 22 2012, 11:11:02
>  15 2012-12-25 16:38:01,712 [main] WARN org.apache.pig.Main - Cannot write to 
> log file: /opt/trend/hadooppet/sanity-tm-6/result//akamai.pig1356453481712.log
>  16 2012-12-25 16:38:01,727 [main] ERROR org.apache.pig.Main - ERROR 2999: 
> Unexpected internal error. null
>  17 2012-12-25 16:38:01,727 [main] WARN org.apache.pig.Main - There is no log 
> file to write to.
>  18 2012-12-25 16:38:01,727 [main] ERROR org.apache.pig.Main - 
> java.lang.NullPointerException
>  19 at java.util.Hashtable.put(Hashtable.java:394)
>  20 at java.util.Properties.setProperty(Properties.java:143)
>  21 at org.apache.pig.Main.run(Main.java:542)
>  22 at org.apache.pig.Main.main(Main.java:115)
>  23 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>  24 at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>  25 at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>  26 at java.lang.reflect.Method.invoke(Method.java:597)
>  27 at org.apache.hadoop.util.RunJar.main(RunJar.java:208)
> {code} 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to