[ 
https://issues.apache.org/jira/browse/DRILL-4036?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14991914#comment-14991914
 ] 

Andries Engelbrecht commented on DRILL-4036:
--------------------------------------------

This can happen if sqlline on the node was first executed as root.

Delete the file and the next time it will work fine. It will also be created 
again with the rw-rw-r-- permissions.

The root cause is starting sqlline as root the first time on the node. If mapr 
is used first and then root uses sqllien later it is not an issue.

> logs/sqlline_queries.json can not be accessed by user mapr 
> -----------------------------------------------------------
>
>                 Key: DRILL-4036
>                 URL: https://issues.apache.org/jira/browse/DRILL-4036
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Storage - Writer
>    Affects Versions: 1.3.0
>            Reporter: Khurram Faraaz
>            Priority: Minor
>
> Drill was installed using RPM and when I try to connect to Drill from sqlline 
> as mapr user it results in permission denied error. That file 
> sqlline_queries.json is always empty, it has no content in it, and it is 
> owned by root and others can not write to it.
> The change was made using he below commit
> https://github.com/apache/drill/commit/42d5f818a5501dbd05808c53959db86e66202792
> {code}
> I logged in as root 
> [root@centos-01 bin]# id
> uid=0(root) gid=0(root) groups=0(root)
> Note that the file is owned by root, and non-root users can not write to that 
> file.
> [root@centos-01 bin]# ls -lrt 
> /opt/mapr/drill/drill-1.3.0/logs/sqlline_queries.json
> -rw-r--r-- 1 root root 0 Nov  2 20:56 
> /opt/mapr/drill/drill-1.3.0/logs/sqlline_queries.json
> and then I connect to Drill as mapr user
>  
> [root@centos-01 bin]# su - mapr
> -bash-4.1$ pwd
> /home/mapr
> -bash-4.1$ cd /opt/mapr/drill/drill-1.3.0/bin/
> -bash-4.1$ ./sqlline -u "jdbc:drill:schema=dfs.tmp -n mapr -p mapr"
> 23:30:38,366 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could 
> NOT find resource [logback.groovy]
> 23:30:38,366 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could 
> NOT find resource [logback-test.xml]
> 23:30:38,367 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found 
> resource [logback.xml] at [file:/opt/mapr/drill/drill-1.3.0/conf/logback.xml]
> 23:30:38,565 |-INFO in 
> ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not 
> set
> 23:30:38,571 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - 
> About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
> 23:30:38,583 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - 
> Naming appender as [STDOUT]
> 23:30:38,613 |-INFO in 
> ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default 
> type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] 
> property
> 23:30:38,693 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - 
> About to instantiate appender of type 
> [ch.qos.logback.core.rolling.RollingFileAppender]
> 23:30:38,696 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - 
> Naming appender as [QUERY]
> 23:30:38,722 |-INFO in 
> ch.qos.logback.core.rolling.FixedWindowRollingPolicy@69663655 - No 
> compression will be used
> 23:30:38,736 |-INFO in 
> ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default 
> type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] 
> property
> 23:30:38,737 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[QUERY] 
> - Active log file name: /opt/mapr/drill/drill-1.3.0/logs/sqlline_queries.json
> 23:30:38,737 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[QUERY] 
> - File property is set to 
> [/opt/mapr/drill/drill-1.3.0/logs/sqlline_queries.json]
> 23:30:38,739 |-ERROR in 
> ch.qos.logback.core.rolling.RollingFileAppender[QUERY] - 
> openFile(/opt/mapr/drill/drill-1.3.0/logs/sqlline_queries.json,true) call 
> failed. java.io.FileNotFoundException: 
> /opt/mapr/drill/drill-1.3.0/logs/sqlline_queries.json (Permission denied)
>       at java.io.FileNotFoundException: 
> /opt/mapr/drill/drill-1.3.0/logs/sqlline_queries.json (Permission denied)
>       at      at java.io.FileOutputStream.open(Native Method)
>       at      at java.io.FileOutputStream.<init>(FileOutputStream.java:221)
>       at      at 
> ch.qos.logback.core.recovery.ResilientFileOutputStream.<init>(ResilientFileOutputStream.java:28)
>       at      at 
> ch.qos.logback.core.FileAppender.openFile(FileAppender.java:149)
>       at      at ch.qos.logback.core.FileAppender.start(FileAppender.java:108)
>       at      at 
> ch.qos.logback.core.rolling.RollingFileAppender.start(RollingFileAppender.java:86)
>       at      at 
> ch.qos.logback.core.joran.action.AppenderAction.end(AppenderAction.java:96)
>       at      at 
> ch.qos.logback.core.joran.spi.Interpreter.callEndAction(Interpreter.java:317)
>       at      at 
> ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:196)
>       at      at 
> ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:182)
>       at      at 
> ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:62)
>       at      at 
> ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:149)
>       at      at 
> ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:135)
>       at      at 
> ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:99)
>       at      at 
> ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:49)
>       at      at 
> ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:75)
>       at      at 
> ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:148)
>       at      at 
> org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:85)
>       at      at 
> org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:55)
>       at      at org.slf4j.LoggerFactory.bind(LoggerFactory.java:129)
>       at      at 
> org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:108)
>       at      at 
> org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:302)
>       at      at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:276)
>       at      at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:288)
>       at      at org.apache.drill.jdbc.Driver.<clinit>(Driver.java:34)
>       at      at java.lang.Class.forName0(Native Method)
>       at      at java.lang.Class.forName(Class.java:195)
>       at      at 
> sqlline.DatabaseConnection.connect(DatabaseConnection.java:125)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to