You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kylin.apache.org by "hailin.huang (JIRA)" <ji...@apache.org> on 2019/01/23 02:49:00 UTC

[jira] [Updated] (KYLIN-3782) ZookeeperDistributedLock can't acquir lock on windows because wrong Path

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

hailin.huang updated KYLIN-3782:
--------------------------------
    Description: 
In my windows env, when I run kylin, Kylin service can't start. In class ZookeeperDistributedLock, I found  kylin use File(path).getCanonicalPath() to norm windows path, however this will get a path like ' C:\kylin\kylin_metadata1\job_engine\global_job_engine_lock', for zookeeper,Path must start with / character.

{color:red}return new File(path).toURI().getPath(){color}  might be better!!!


Below is stackTrace:


Caused by: java.lang.IllegalStateException: Error while 832820@UC-20180829ZLJB trying to lock C:\kylin\kylin_metadata1\job_engine\global_job_engine_lock
	at org.apache.kylin.storage.hbase.util.ZookeeperDistributedLock.lock(ZookeeperDistributedLock.java:153)
	at org.apache.kylin.storage.hbase.util.ZookeeperDistributedLock.lock(ZookeeperDistributedLock.java:170)
	at org.apache.kylin.storage.hbase.util.ZookeeperDistributedLock.lockJobEngine(ZookeeperDistributedLock.java:318)
	at org.apache.kylin.storage.hbase.util.ZookeeperJobLock.lockJobEngine(ZookeeperJobLock.java:81)
	at org.apache.kylin.job.impl.threadpool.DefaultScheduler.init(DefaultScheduler.java:152)
	at org.apache.kylin.rest.service.JobService.afterPropertiesSet(JobService.java:126)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1687)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1624)
	... 60 more
caused by: java.lang.IllegalArgumentException: Path must start with / character
	at org.apache.curator.utils.PathUtils.validatePath(PathUtils.java:54)
	at org.apache.curator.utils.PathUtils.validatePath(PathUtils.java:37)
	at org.apache.curator.utils.ZKPaths.fixForNamespace(ZKPaths.java:63)
	at org.apache.curator.framework.imps.NamespaceImpl.fixForNamespace(NamespaceImpl.java:82)
	at org.apache.curator.framework.imps.CuratorFrameworkImpl.fixForNamespace(CuratorFrameworkImpl.java:579)
	at org.apache.curator.framework.imps.CreateBuilderImpl.forPath(CreateBuilderImpl.java:434)
	at org.apache.curator.framework.imps.CreateBuilderImpl.forPath(CreateBuilderImpl.java:44)
	at org.apache.kylin.storage.hbase.util.ZookeeperDistributedLock.lock(ZookeeperDistributedLock.java:149)



  was:
In my windows env, when I run kylin, Kylin service can't start. In class ZookeeperDistributedLock, I found  kylin use File(path).getCanonicalPath() to norm windows path, however this will get a path like ' C:\kylin\kylin_metadata1\job_engine\global_job_engine_lock', for zookeeper,Path must start with / character.

Below is stackTrace:


Caused by: java.lang.IllegalStateException: Error while 832820@UC-20180829ZLJB trying to lock C:\kylin\kylin_metadata1\job_engine\global_job_engine_lock
	at org.apache.kylin.storage.hbase.util.ZookeeperDistributedLock.lock(ZookeeperDistributedLock.java:153)
	at org.apache.kylin.storage.hbase.util.ZookeeperDistributedLock.lock(ZookeeperDistributedLock.java:170)
	at org.apache.kylin.storage.hbase.util.ZookeeperDistributedLock.lockJobEngine(ZookeeperDistributedLock.java:318)
	at org.apache.kylin.storage.hbase.util.ZookeeperJobLock.lockJobEngine(ZookeeperJobLock.java:81)
	at org.apache.kylin.job.impl.threadpool.DefaultScheduler.init(DefaultScheduler.java:152)
	at org.apache.kylin.rest.service.JobService.afterPropertiesSet(JobService.java:126)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1687)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1624)
	... 60 more
caused by: java.lang.IllegalArgumentException: Path must start with / character
	at org.apache.curator.utils.PathUtils.validatePath(PathUtils.java:54)
	at org.apache.curator.utils.PathUtils.validatePath(PathUtils.java:37)
	at org.apache.curator.utils.ZKPaths.fixForNamespace(ZKPaths.java:63)
	at org.apache.curator.framework.imps.NamespaceImpl.fixForNamespace(NamespaceImpl.java:82)
	at org.apache.curator.framework.imps.CuratorFrameworkImpl.fixForNamespace(CuratorFrameworkImpl.java:579)
	at org.apache.curator.framework.imps.CreateBuilderImpl.forPath(CreateBuilderImpl.java:434)
	at org.apache.curator.framework.imps.CreateBuilderImpl.forPath(CreateBuilderImpl.java:44)
	at org.apache.kylin.storage.hbase.util.ZookeeperDistributedLock.lock(ZookeeperDistributedLock.java:149)




> ZookeeperDistributedLock can't acquir lock on windows because wrong Path
> ------------------------------------------------------------------------
>
>                 Key: KYLIN-3782
>                 URL: https://issues.apache.org/jira/browse/KYLIN-3782
>             Project: Kylin
>          Issue Type: Bug
>          Components: Storage - HBase
>    Affects Versions: v2.6.0
>            Reporter: hailin.huang
>            Priority: Major
>             Fix For: v2.6.1
>
>
> In my windows env, when I run kylin, Kylin service can't start. In class ZookeeperDistributedLock, I found  kylin use File(path).getCanonicalPath() to norm windows path, however this will get a path like ' C:\kylin\kylin_metadata1\job_engine\global_job_engine_lock', for zookeeper,Path must start with / character.
> {color:red}return new File(path).toURI().getPath(){color}  might be better!!!
> Below is stackTrace:
> Caused by: java.lang.IllegalStateException: Error while 832820@UC-20180829ZLJB trying to lock C:\kylin\kylin_metadata1\job_engine\global_job_engine_lock
> 	at org.apache.kylin.storage.hbase.util.ZookeeperDistributedLock.lock(ZookeeperDistributedLock.java:153)
> 	at org.apache.kylin.storage.hbase.util.ZookeeperDistributedLock.lock(ZookeeperDistributedLock.java:170)
> 	at org.apache.kylin.storage.hbase.util.ZookeeperDistributedLock.lockJobEngine(ZookeeperDistributedLock.java:318)
> 	at org.apache.kylin.storage.hbase.util.ZookeeperJobLock.lockJobEngine(ZookeeperJobLock.java:81)
> 	at org.apache.kylin.job.impl.threadpool.DefaultScheduler.init(DefaultScheduler.java:152)
> 	at org.apache.kylin.rest.service.JobService.afterPropertiesSet(JobService.java:126)
> 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1687)
> 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1624)
> 	... 60 more
> caused by: java.lang.IllegalArgumentException: Path must start with / character
> 	at org.apache.curator.utils.PathUtils.validatePath(PathUtils.java:54)
> 	at org.apache.curator.utils.PathUtils.validatePath(PathUtils.java:37)
> 	at org.apache.curator.utils.ZKPaths.fixForNamespace(ZKPaths.java:63)
> 	at org.apache.curator.framework.imps.NamespaceImpl.fixForNamespace(NamespaceImpl.java:82)
> 	at org.apache.curator.framework.imps.CuratorFrameworkImpl.fixForNamespace(CuratorFrameworkImpl.java:579)
> 	at org.apache.curator.framework.imps.CreateBuilderImpl.forPath(CreateBuilderImpl.java:434)
> 	at org.apache.curator.framework.imps.CreateBuilderImpl.forPath(CreateBuilderImpl.java:44)
> 	at org.apache.kylin.storage.hbase.util.ZookeeperDistributedLock.lock(ZookeeperDistributedLock.java:149)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)