[jira] [Commented] (CASSANDRA-12242) Could not create trigger

2016-08-08 Thread RocWay Li (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-12242?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15411416#comment-15411416
 ] 

RocWay Li commented on CASSANDRA-12242:
---

HI Alex,

Even though running with provided trigger example, the result is still the 
same. Cassandra could not find the trigger class.

Regards
RocWay

> Could not create trigger
> 
>
> Key: CASSANDRA-12242
> URL: https://issues.apache.org/jira/browse/CASSANDRA-12242
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL
>Reporter: RocWay Li
> Attachments: DataTrigger.java
>
>
> I tried cassandra 2.2.6 and 3.7, both of them could not create triggers.
> It reports that the trigger class doesn't exist. But it actually does and is 
> at the right directory, the conf/triggers.
> I debugged the source code, and I found that SEPWorker is used to create 
> triggers, but it's thread is not a secure thread, which should be managed by 
> cassandra's SecurityManager and belongs to SecurityThreadGroup.
> When security validation failed, an exception will be thrown. That's direct 
> cause for creating triggers failed.



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


[jira] [Commented] (CASSANDRA-12242) Could not create trigger

2016-07-25 Thread RocWay Li (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-12242?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15393105#comment-15393105
 ] 

RocWay Li commented on CASSANDRA-12242:
---

Even though the TriggerExecutor instance is created in static context, it 
should be instantiated lazily, which happens at the fist call. 

> Could not create trigger
> 
>
> Key: CASSANDRA-12242
> URL: https://issues.apache.org/jira/browse/CASSANDRA-12242
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL
>Reporter: RocWay Li
> Attachments: DataTrigger.java
>
>
> I tried cassandra 2.2.6 and 3.7, both of them could not create triggers.
> It reports that the trigger class doesn't exist. But it actually does and is 
> at the right directory, the conf/triggers.
> I debugged the source code, and I found that SEPWorker is used to create 
> triggers, but it's thread is not a secure thread, which should be managed by 
> cassandra's SecurityManager and belongs to SecurityThreadGroup.
> When security validation failed, an exception will be thrown. That's direct 
> cause for creating triggers failed.



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


[jira] [Commented] (CASSANDRA-12242) Could not create trigger

2016-07-25 Thread RocWay Li (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-12242?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15393080#comment-15393080
 ] 

RocWay Li commented on CASSANDRA-12242:
---

Yes, I did run on Windows. 
But I think the direct reason is that the SEPWorker's thread is not marked with 
SecurityThreadGroup.



> Could not create trigger
> 
>
> Key: CASSANDRA-12242
> URL: https://issues.apache.org/jira/browse/CASSANDRA-12242
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL
>Reporter: RocWay Li
> Attachments: DataTrigger.java
>
>
> I tried cassandra 2.2.6 and 3.7, both of them could not create triggers.
> It reports that the trigger class doesn't exist. But it actually does and is 
> at the right directory, the conf/triggers.
> I debugged the source code, and I found that SEPWorker is used to create 
> triggers, but it's thread is not a secure thread, which should be managed by 
> cassandra's SecurityManager and belongs to SecurityThreadGroup.
> When security validation failed, an exception will be thrown. That's direct 
> cause for creating triggers failed.



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


[jira] [Commented] (CASSANDRA-12242) Could not create trigger

2016-07-24 Thread RocWay Li (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-12242?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15391250#comment-15391250
 ] 

RocWay Li commented on CASSANDRA-12242:
---

TriggerExecutor is a singleton, but the trigger classes are NOT loaded at 
startup. They are loaded just at the first try to create triggers, when the 
first time the TriggerExecutor.instance is called. And, sure, the trigger jar 
exists at the right place, .
The failure does happen at 
ThreadAwareSecurityManager.isSecuredThread(ThreadAwareSecurityManager.java:145)

*if (!(tg instanceof SecurityThreadGroup))*
*return false*;

Refer to the following complete call-stack, please:
"Native-Transport-Requests-1@14162" daemon prio=5 tid=0x52 nid=NA runnable
  java.lang.Thread.State: RUNNABLE
  at 
org.apache.cassandra.cql3.functions.ThreadAwareSecurityManager.isSecuredThread(ThreadAwareSecurityManager.java:145)
  at 
org.apache.cassandra.cql3.functions.ThreadAwareSecurityManager.checkPermission(ThreadAwareSecurityManager.java:179)
  at 
java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1294)
  at java.lang.System.getProperty(System.java:717)
  at java.io.WinNTFileSystem.getUserPath(WinNTFileSystem.java:346)
  at java.io.WinNTFileSystem.resolve(WinNTFileSystem.java:309)
  at java.io.File.getCanonicalPath(File.java:618)
  at java.io.FilePermission$1.run(FilePermission.java:215)
  at java.io.FilePermission$1.run(FilePermission.java:203)
  at 
java.security.AccessController.doPrivileged(AccessController.java:-1)
  at java.io.FilePermission.init(FilePermission.java:203)
  at java.io.FilePermission.(FilePermission.java:277)
  at java.lang.SecurityManager.checkRead(SecurityManager.java:888)
  at java.io.File.exists(File.java:814)
  at 
org.apache.cassandra.utils.FBUtilities.cassandraTriggerDir(FBUtilities.java:325)
  at 
org.apache.cassandra.triggers.TriggerExecutor.reloadClasses(TriggerExecutor.java:60)
  at 
org.apache.cassandra.triggers.TriggerExecutor.(TriggerExecutor.java:51)
  at 
org.apache.cassandra.triggers.TriggerExecutor.(TriggerExecutor.java:43)
  at 
org.apache.cassandra.cql3.statements.CreateTriggerStatement.validate(CreateTriggerStatement.java:67)
  at 
org.apache.cassandra.cql3.QueryProcessor.processStatement(QueryProcessor.java:212)
  at 
org.apache.cassandra.cql3.QueryProcessor.process(QueryProcessor.java:245)
  at 
org.apache.cassandra.cql3.QueryProcessor.process(QueryProcessor.java:230)
  at 
org.apache.cassandra.transport.messages.QueryMessage.execute(QueryMessage.java:115)
  at 
org.apache.cassandra.transport.Message$Dispatcher.channelRead0(Message.java:507)
  at 
org.apache.cassandra.transport.Message$Dispatcher.channelRead0(Message.java:401)
  at 
io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
  at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)
  at 
io.netty.channel.AbstractChannelHandlerContext.access$600(AbstractChannelHandlerContext.java:35)
  at 
io.netty.channel.AbstractChannelHandlerContext$7.run(AbstractChannelHandlerContext.java:357)
  at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
  at 
org.apache.cassandra.concurrent.AbstractLocalAwareExecutorService$FutureTask.run(AbstractLocalAwareExecutorService.java:162)
  at org.apache.cassandra.concurrent.SEPWorker.run(SEPWorker.java:111)
  at java.lang.Thread.run(Thread.java:745)

> Could not create trigger
> 
>
> Key: CASSANDRA-12242
> URL: https://issues.apache.org/jira/browse/CASSANDRA-12242
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL
>Reporter: RocWay Li
> Attachments: DataTrigger.java
>
>
> I tried cassandra 2.2.6 and 3.7, both of them could not create triggers.
> It reports that the trigger class doesn't exist. But it actually does and is 
> at the right directory, the conf/triggers.
> I debugged the source code, and I found that SEPWorker is used to create 
> triggers, but it's thread is not a secure thread, which should be managed by 
> cassandra's SecurityManager and belongs to SecurityThreadGroup.
> When security validation failed, an exception will be thrown. That's direct 
> cause for creating triggers failed.



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


[jira] [Commented] (CASSANDRA-12242) Could not create trigger

2016-07-21 Thread RocWay Li (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-12242?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15388765#comment-15388765
 ] 

RocWay Li commented on CASSANDRA-12242:
---

About the call-stack, I could list the key points as the following:

 During the 1st execution of CREATE TRIGGER..., it will call 
FBUtilities::cassandraTriggerDir(), which wil call (bottom up)

ThreadGroup tg = Thread.currentThread().getThreadGroup();// tg is null, 
since the current thread(SEPWorker) is not managed by NamedThreadFactory
ThreadAwareSecurityManager#isSecuredThread
ThreadAwareSecurityManager#checkPermission(java.security.Permission)
SecurityManager#checkRead(java.lang.String)
java.io.File#exists
org.apache.cassandra.utils.FBUtilities#cassandraTriggerDir  --> if (triggerDir 
== null || !triggerDir.exists()


> Could not create trigger
> 
>
> Key: CASSANDRA-12242
> URL: https://issues.apache.org/jira/browse/CASSANDRA-12242
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL
>Reporter: RocWay Li
> Attachments: DataTrigger.java
>
>
> I tried cassandra 2.2.6 and 3.7, both of them could not create triggers.
> It reports that the trigger class doesn't exist. But it actually does and is 
> at the right directory, the conf/triggers.
> I debugged the source code, and I found that SEPWorker is used to create 
> triggers, but it's thread is not a secure thread, which should be managed by 
> cassandra's SecurityManager and belongs to SecurityThreadGroup.
> When security validation failed, an exception will be thrown. That's direct 
> cause for creating triggers failed.



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


[jira] [Comment Edited] (CASSANDRA-12242) Could not create trigger

2016-07-21 Thread RocWay Li (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-12242?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15388753#comment-15388753
 ] 

RocWay Li edited comment on CASSANDRA-12242 at 7/22/16 2:05 AM:


About the trigger source file, please refer to the attachement.


was (Author: rocway):
The trigger class source file.

> Could not create trigger
> 
>
> Key: CASSANDRA-12242
> URL: https://issues.apache.org/jira/browse/CASSANDRA-12242
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL
>Reporter: RocWay Li
> Attachments: DataTrigger.java
>
>
> I tried cassandra 2.2.6 and 3.7, both of them could not create triggers.
> It reports that the trigger class doesn't exist. But it actually does and is 
> at the right directory, the conf/triggers.
> I debugged the source code, and I found that SEPWorker is used to create 
> triggers, but it's thread is not a secure thread, which should be managed by 
> cassandra's SecurityManager and belongs to SecurityThreadGroup.
> When security validation failed, an exception will be thrown. That's direct 
> cause for creating triggers failed.



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


[jira] [Updated] (CASSANDRA-12242) Could not create trigger

2016-07-21 Thread RocWay Li (JIRA)

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

RocWay Li updated CASSANDRA-12242:
--
Attachment: DataTrigger.java

The trigger class source file.

> Could not create trigger
> 
>
> Key: CASSANDRA-12242
> URL: https://issues.apache.org/jira/browse/CASSANDRA-12242
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL
>Reporter: RocWay Li
> Attachments: DataTrigger.java
>
>
> I tried cassandra 2.2.6 and 3.7, both of them could not create triggers.
> It reports that the trigger class doesn't exist. But it actually does and is 
> at the right directory, the conf/triggers.
> I debugged the source code, and I found that SEPWorker is used to create 
> triggers, but it's thread is not a secure thread, which should be managed by 
> cassandra's SecurityManager and belongs to SecurityThreadGroup.
> When security validation failed, an exception will be thrown. That's direct 
> cause for creating triggers failed.



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


[jira] [Created] (CASSANDRA-12242) Could not create trigger

2016-07-20 Thread RocWay Li (JIRA)
RocWay Li created CASSANDRA-12242:
-

 Summary: Could not create trigger
 Key: CASSANDRA-12242
 URL: https://issues.apache.org/jira/browse/CASSANDRA-12242
 Project: Cassandra
  Issue Type: Bug
  Components: CQL
Reporter: RocWay Li


I tried cassandra 2.2.6 and 3.7, both of them could not create triggers.
It reports that the trigger class doesn't exist. But it actually does and is at 
the right directory, the conf/triggers.

I debugged the source code, and I found that SEPWorker is used to create 
triggers, but it's thread is not a secure thread, which should be managed by 
cassandra's SecurityManager and belongs to SecurityThreadGroup.

When security validation failed, an exception will be thrown. That's direct 
cause for creating triggers failed.



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