I think I've narrowed this down... The problem only happens when I add
"nifi" to the list of supported components
in 
ranger-0.6.0-SNAPSHOT-admin/ews/webapp/WEB-INF/classes/conf/ranger-admin-site.xml

I've tried two ways:

<property>
   <name>ranger.supportedcomponents</name>
   <value>nifi</value>
</property>

and

<property>
   <name>ranger.supportedcomponents</name>

<value>tag,hdfs,hbase,hive,kms,knox,storm,yarn,kafka,solr,atlas,nifi</value>
</property>

Both ways add NiFi to the UI, but both produce the error I previously
reported, and once I've added NiFi to the list then I can no longer create
a service of any other type.

Any ideas what changed since we committed the NiFi service def that might
be causing this?


Thanks,

Bryan


On Mon, Jun 13, 2016 at 4:15 PM, Bryan Bende <[email protected]> wrote:

> Hi Abhay,
>
> Thanks for responding. I tried the same exact test as you and got the same
> error for both Storm and NiFi, so it must be my environment, but I am a bit
> stumped at what could be missing...
>
> I built latest master and then I have a vagrant VM that installs a JDK and
> MySQL, copies the admin tar from the build, and runs the setup script:
> https://github.com/bbende/apache-ranger-vagrant
>
> Let me know if you have any idea what else I could look into here. It
> seems like its not getting the sequence id back from the database, but not
> sure.
>
> Thanks,
>
> Bryan
>
>
> On Mon, Jun 13, 2016 at 2:27 PM, Abhay Kulkarni <[email protected]
> > wrote:
>
>> Hi Brian,
>>
>> It may be an issue with your environment. I ran the following curl script
>> on the latest master:
>>
>> curl -u admin:admin -H "Accept: application/json" -H "Content-Type:
>> application/json" -X POST
>> http://xforward:6080/service/public/v2/api/service -d @sc1.json
>>
>> Where sc1.json contains:
>>
>> {
>>         "type": "storm",
>>         "name": "Test_Repo_Storm_Creation",
>>         "description": "Testing Creation of Storm Repo",
>>         "configs": {
>>             "commonNameForCertificate": "",
>>             "username": "storm",
>>             "nimbus.url": "http://nimbus.com";,
>>             "password": "storm"
>>         },
>>         "name":"cl1_storm"
>>     }
>>
>>
>> Curl command succeeded with the output:
>>
>>
>> {"id":4,"guid":"eedc7a57-35a6-4c01-ae11-fd9ed8dba680","isEnabled":true,"cre
>>
>> atedBy":"Admin","updatedBy":"Admin","createTime":1465842011753,"updateTime"
>>
>> :1465842011755,"version":1,"type":"storm","name":"cl1_storm","description":
>> "Testing Creation of Storm
>> Repo","configs":{"password":"*****","nimbus.url":"http://nimbus.com
>> ","usern
>>
>> ame":"storm"},"policyVersion":1,"policyUpdateTime":1465842011759,"tagVersio
>> n":1,"tagUpdateTime":1465842011759}
>>
>> Thanks,
>> -Abhay
>>
>>
>>
>> On 6/13/16, 10:47 AM, "Bryan Bende" <[email protected]> wrote:
>>
>> >Running the latest master code I am getting an exception when creating a
>> >service (stacktrace below).
>> >
>> >Is anyone else seeing this? Want to make sure it is not just my
>> >environment.
>> >
>> >Thanks,
>> >
>> >Bryan
>> >
>> >2016-06-13 13:39:58,386 [http-bio-6080-exec-10] ERROR
>> >org.apache.ranger.rest.ServiceREST (ServiceREST.java:471) -
>> >createService(RangerService={id={null} guid={null} isEnabled={true}
>> >createdBy={null} updatedBy={null} createTime={null} updateTime={null}
>> >version={1} name={nifi} type={nifi} description={test} tagService={}
>> >configs={nifi.ssl.truststorePassword={} nifi.url={
>> >http://localhost:8080/nifi-api/resources} nifi.ssl.truststoreType={}
>> >nifi.ssl.keystoreType={} nifi.ssl.keystorePassword={}
>> >nifi.authentication={NONE} nifi.ssl.truststore={} nifi.ssl.keystore={} }
>> >policyVersion={null} policyUpdateTime={null} tagVersion={1}
>> >tagUpdateTime={null} }) failed
>> >javax.persistence.PersistenceException: Exception [EclipseLink-7197]
>> >(Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd):
>> >org.eclipse.persistence.exceptions.ValidationException
>> >Exception Description: Null or zero primary key encountered in unit of
>> >work
>> >clone [XXService [id=null]], primary key [null]. Set descriptors
>> >IdValidation or the "eclipselink.id-validation" property.
>> >at
>>
>> >org.eclipse.persistence.internal.jpa.EntityManagerImpl.flush(EntityManager
>> >Impl.java:868)
>> >at
>>
>> >org.eclipse.persistence.internal.jpa.QueryImpl.performPreQueryFlush(QueryI
>> >mpl.java:963)
>> >at
>>
>> >org.eclipse.persistence.internal.jpa.QueryImpl.executeReadQuery(QueryImpl.
>> >java:207)
>> >at
>>
>> >org.eclipse.persistence.internal.jpa.QueryImpl.getSingleResult(QueryImpl.j
>> >ava:517)
>> >at
>>
>> >org.eclipse.persistence.internal.jpa.EJBQueryImpl.getSingleResult(EJBQuery
>> >Impl.java:400)
>> >at
>>
>> >org.apache.ranger.db.XXServiceDao.getMaxIdOfXXService(XXServiceDao.java:54
>> >)
>> >at org.apache.ranger.db.XXServiceDao.updateSequence(XXServiceDao.java:85)
>> >at
>>
>> >org.apache.ranger.biz.ServiceDBStore.createService(ServiceDBStore.java:136
>> >0)
>> >at org.apache.ranger.rest.ServiceREST.createService(ServiceREST.java:467)
>> >at
>>
>> >org.apache.ranger.rest.ServiceREST$$FastClassByCGLIB$$92dab672.invoke(<gen
>> >erated>)
>> >at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191)
>> >at
>>
>> >org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.inv
>> >okeJoinpoint(Cglib2AopProxy.java:689)
>> >at
>>
>> >org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Refle
>> >ctiveMethodInvocation.java:150)
>> >at
>>
>> >org.springframework.security.access.intercept.aopalliance.MethodSecurityIn
>> >terceptor.invoke(MethodSecurityInterceptor.java:64)
>> >at
>>
>> >org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Refle
>> >ctiveMethodInvocation.java:172)
>> >at
>>
>> >org.springframework.transaction.interceptor.TransactionInterceptor.invoke(
>> >TransactionInterceptor.java:110)
>> >at
>>
>> >org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Refle
>> >ctiveMethodInvocation.java:172)
>> >at
>>
>> >org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor
>> >.intercept(Cglib2AopProxy.java:622)
>> >at
>>
>> >org.apache.ranger.rest.ServiceREST$$EnhancerByCGLIB$$27960408.createServic
>> >e(<generated>)
>> >at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> >at
>>
>> >sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
>> >62)
>> >at
>>
>> >sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorIm
>> >pl.java:43)
>> >at java.lang.reflect.Method.invoke(Method.java:498)
>> >at
>>
>> >com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDis
>>
>> >patchProvider$TypeOutInvoker._dispatch(AbstractResourceMethodDispatchProvi
>> >der.java:168)
>> >at
>>
>> >com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatc
>> >her.dispatch(ResourceJavaMethodDispatcher.java:70)
>> >at
>>
>> >com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.
>> >java:279)
>> >at
>>
>> >com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPat
>> >hRule.java:136)
>> >at
>>
>> >com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClas
>> >sRule.java:86)
>> >at
>>
>> >com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPat
>> >hRule.java:136)
>> >at
>>
>> >com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootRe
>> >sourceClassesRule.java:74)
>> >at
>>
>> >com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(W
>> >ebApplicationImpl.java:1357)
>> >at
>>
>> >com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(W
>> >ebApplicationImpl.java:1289)
>> >at
>>
>> >com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(We
>> >bApplicationImpl.java:1239)
>> >at
>>
>> >com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(We
>> >bApplicationImpl.java:1229)
>> >at
>>
>> >com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.jav
>> >a:420)
>> >at
>>
>> >com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletConta
>> >iner.java:497)
>> >at
>>
>> >com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletConta
>> >iner.java:684)
>> >at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
>> >at
>>
>> >org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applicati
>> >onFilterChain.java:303)
>> >at
>>
>> >org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilter
>> >Chain.java:208)
>> >at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
>> >at
>>
>> >org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applicati
>> >onFilterChain.java:241)
>> >at
>>
>> >org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilter
>> >Chain.java:208)
>> >at
>>
>> >org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFil
>> >ter(FilterChainProxy.java:330)
>> >at
>>
>> >org.apache.ranger.security.web.filter.RangerSecurityContextFormationFilter
>> >.doFilter(RangerSecurityContextFormationFilter.java:146)
>> >at
>>
>> >org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFil
>> >ter(FilterChainProxy.java:342)
>> >at
>>
>> >org.springframework.security.web.access.intercept.FilterSecurityIntercepto
>> >r.invoke(FilterSecurityInterceptor.java:118)
>> >at
>>
>> >org.springframework.security.web.access.intercept.FilterSecurityIntercepto
>> >r.doFilter(FilterSecurityInterceptor.java:84)
>> >at
>>
>> >org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFil
>> >ter(FilterChainProxy.java:342)
>> >at
>>
>> >org.springframework.security.web.access.ExceptionTranslationFilter.doFilte
>> >r(ExceptionTranslationFilter.java:113)
>> >at
>>
>> >org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFil
>> >ter(FilterChainProxy.java:342)
>> >at
>>
>> >org.springframework.security.web.session.SessionManagementFilter.doFilter(
>> >SessionManagementFilter.java:103)
>> >at
>>
>> >org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFil
>> >ter(FilterChainProxy.java:342)
>> >at
>>
>> >org.springframework.security.web.authentication.AnonymousAuthenticationFil
>> >ter.doFilter(AnonymousAuthenticationFilter.java:113)
>> >at
>>
>> >org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFil
>> >ter(FilterChainProxy.java:342)
>> >at
>>
>> >org.apache.ranger.security.web.filter.RangerCSRFPreventionFilter$ServletFi
>> >lterHttpInteraction.proceed(RangerCSRFPreventionFilter.java:221)
>> >at
>>
>> >org.apache.ranger.security.web.filter.RangerCSRFPreventionFilter.handleHtt
>> >pInteraction(RangerCSRFPreventionFilter.java:166)
>> >at
>>
>> >org.apache.ranger.security.web.filter.RangerCSRFPreventionFilter.doFilter(
>> >RangerCSRFPreventionFilter.java:176)
>> >at
>>
>> >org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFil
>> >ter(FilterChainProxy.java:342)
>> >at
>>
>> >org.apache.ranger.security.web.filter.RangerKRBAuthenticationFilter.doFilt
>> >er(RangerKRBAuthenticationFilter.java:279)
>> >at
>>
>> >org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFil
>> >ter(FilterChainProxy.java:342)
>> >at
>>
>> >org.springframework.security.web.servletapi.SecurityContextHolderAwareRequ
>> >estFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
>> >at
>>
>> >org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFil
>> >ter(FilterChainProxy.java:342)
>> >at
>>
>> >org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFi
>> >lter(RequestCacheAwareFilter.java:45)
>> >at
>>
>> >org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFil
>> >ter(FilterChainProxy.java:342)
>> >at
>>
>> >org.apache.ranger.security.web.filter.RangerSSOAuthenticationFilter.doFilt
>> >er(RangerSSOAuthenticationFilter.java:210)
>> >at
>>
>> >org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFil
>> >ter(FilterChainProxy.java:342)
>> >at
>>
>> >org.springframework.security.web.authentication.www.BasicAuthenticationFil
>> >ter.doFilter(BasicAuthenticationFilter.java:150)
>> >at
>>
>> >org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFil
>> >ter(FilterChainProxy.java:342)
>> >at
>>
>> >org.springframework.security.web.authentication.AbstractAuthenticationProc
>> >essingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:183)
>> >at
>>
>> >org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFil
>> >ter(FilterChainProxy.java:342)
>> >at
>>
>> >org.springframework.security.web.authentication.logout.LogoutFilter.doFilt
>> >er(LogoutFilter.java:105)
>> >at
>>
>> >org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFil
>> >ter(FilterChainProxy.java:342)
>> >at
>>
>> >org.springframework.security.web.context.SecurityContextPersistenceFilter.
>> >doFilter(SecurityContextPersistenceFilter.java:87)
>> >at
>>
>> >org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFil
>> >ter(FilterChainProxy.java:342)
>> >at
>>
>> >org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterC
>> >hainProxy.java:192)
>> >at
>>
>> >org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProx
>> >y.java:160)
>> >at
>>
>> >org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(Delega
>> >tingFilterProxy.java:346)
>> >at
>>
>> >org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFi
>> >lterProxy.java:259)
>> >at
>>
>> >org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applicati
>> >onFilterChain.java:241)
>> >at
>>
>> >org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilter
>> >Chain.java:208)
>> >at
>>
>> >org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.
>> >java:220)
>> >at
>>
>> >org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.
>> >java:122)
>> >at
>>
>> >org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBa
>> >se.java:505)
>> >at
>>
>> >org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:1
>> >69)
>> >at
>>
>> >org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:1
>> >03)
>> >at
>> >org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)
>> >at
>>
>> >org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.ja
>> >va:116)
>> >at
>>
>> >org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:436
>> >)
>> >at
>>
>> >org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Pro
>> >cessor.java:1078)
>> >at
>>
>> >org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(Abstr
>> >actProtocol.java:625)
>> >at
>>
>> >org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.jav
>> >a:316)
>> >at
>>
>> >java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:
>> >1142)
>> >at
>>
>> >java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java
>> >:617)
>> >at
>>
>> >org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.
>> >java:61)
>> >at java.lang.Thread.run(Thread.java:745)
>> >Caused by: Exception [EclipseLink-7197] (Eclipse Persistence Services -
>> >2.5.2.v20140319-9ad6abd):
>> >org.eclipse.persistence.exceptions.ValidationException
>> >Exception Description: Null or zero primary key encountered in unit of
>> >work
>> >clone [XXService [id=null]], primary key [null]. Set descriptors
>> >IdValidation or the "eclipselink.id-validation" property.
>> >at
>>
>> >org.eclipse.persistence.exceptions.ValidationException.nullPrimaryKeyInUni
>> >tOfWorkClone(ValidationException.java:1469)
>> >at
>>
>> >org.eclipse.persistence.descriptors.changetracking.DeferredChangeDetection
>> >Policy.calculateChanges(DeferredChangeDetectionPolicy.java:109)
>> >at
>>
>> >org.eclipse.persistence.descriptors.changetracking.DeferredChangeDetection
>>
>> >Policy.calculateChangesForExistingObject(DeferredChangeDetectionPolicy.jav
>> >a:56)
>> >at
>>
>> >org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.calculateChanges(
>> >UnitOfWorkImpl.java:664)
>> >at
>>
>> >org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.writeC
>> >hanges(RepeatableWriteUnitOfWork.java:438)
>> >at
>>
>> >org.eclipse.persistence.internal.jpa.EntityManagerImpl.flush(EntityManager
>> >Impl.java:863)
>> >... 95 more
>>
>>
>

Reply via email to