Stardog 2.1.3 MessagingException

0 views
Skip to first unread message

Duane Holt

unread,
May 21, 2014, 12:05:03 PM5/21/14
to sta...@clarkparsia.com
Good morning!

I've been seeing the following exception using the in my stardog client with increasing frequency:

com.complexible.stardog.StardogException: Missing start boundary
    at com.complexible.stardog.protocols.http.icv.client.ICVHttpConnection.getViolationBindings(ICVHttpConnection.java:201)
    at com.complexible.stardog.icv.api.AbstractICVConnection.getViolationBindings(AbstractICVConnection.java:107)
    at Client.icvChecker(Client.java:515)
    ... 63 more
Caused by: javax.mail.MessagingException: Missing start boundary
    at javax.mail.internet.MimeMultipart.parsebm(MimeMultipart.java:882)
    at javax.mail.internet.MimeMultipart.parse(MimeMultipart.java:503)
    at javax.mail.internet.MimeMultipart.getCount(MimeMultipart.java:244)
    at com.complexible.stardog.protocols.http.icv.client.ICVHttpConnection.getViolationBindings(ICVHttpConnection.java:181)
    ... 65 more

At the time of the exception, I am also seeing the following stack trace in the stardog server log:

com.complexible.common.protocols.server.rpc.ServerHandler exceptionCaught
SEVERE: exceptionCaughtServerHandler
java.lang.RuntimeException: java.lang.RuntimeException: com.complexible.stardog.security.StardogAuthorizationException: There is no authenticated user.
    at com.complexible.stardog.icv.ICValidatorIndex$1.apply(ICValidatorIndex.java:204)
    at com.complexible.stardog.icv.ICValidatorIndex$1.apply(ICValidatorIndex.java:194)
    at com.google.common.collect.Iterators$8.transform(Iterators.java:794)
    at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:48)
    at com.google.common.collect.Iterators$7.computeNext(Iterators.java:646)
    at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:143)
    at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:138)
    at com.complexible.common.iterations.Iterations$IteratorIteration.computeNext(Iterations.java:552)
    at com.complexible.common.iterations.AbstractIteration.tryToComputeNext(AbstractIteration.java:104)
    at com.complexible.common.iterations.AbstractIteration.hasNext(AbstractIteration.java:91)
    at com.complexible.common.iterations.DelegatingIteration.hasNext(DelegatingIteration.java:59)
    at com.complexible.stardog.protocols.snarl.icv.server.ICVServerFunction$SubjectIteration.hasNext(ICVServerFunction.java:231)
    at com.complexible.stardog.protocols.http.icv.server.ICVHttpRoutes$ViolationBodyEncoder.encode(ICVHttpRoutes.java:155)
    at com.complexible.stardog.protocols.http.server.HttpMessageEncoder$SingletonMessageResponseBodyEncoder.encode(HttpMessageEncoder.java:460)
    at com.complexible.stardog.protocols.http.server.HttpMessageEncoder.write(HttpMessageEncoder.java:142)
    at io.netty.channel.DefaultChannelHandlerContext.invokeWrite(DefaultChannelHandlerContext.java:647)
    at io.netty.channel.DefaultChannelHandlerContext.access$2000(DefaultChannelHandlerContext.java:29)
    at io.netty.channel.DefaultChannelHandlerContext$AbstractWriteTask.write(DefaultChannelHandlerContext.java:914)
    at io.netty.channel.DefaultChannelHandlerContext$WriteAndFlushTask.write(DefaultChannelHandlerContext.java:968)
    at io.netty.channel.DefaultChannelHandlerContext$AbstractWriteTask.run(DefaultChannelHandlerContext.java:903)
    at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:354)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:353)
    at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101)
    at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.RuntimeException: com.complexible.stardog.security.StardogAuthorizationException: There is no authenticated user.
    at com.complexible.stardog.StardogKernel$KernelDbConnection.createQuery(StardogKernel.java:2790)
    at com.complexible.stardog.StardogKernel$KernelDbConnection.select(StardogKernel.java:2821)
    at com.complexible.stardog.db.DelegatingDatabaseConnection.select(DelegatingDatabaseConnection.java:176)
    at com.complexible.stardog.icv.ICValidatorIndex$1.apply(ICValidatorIndex.java:200)
    ... 23 more
Caused by: com.complexible.stardog.security.StardogAuthorizationException: There is no authenticated user.
    at com.complexible.stardog.security.StardogSecurityUtils.getAuthenticatedUsername(StardogSecurityUtils.java:65)
    at com.complexible.stardog.StardogKernel$KernelDbConnection.createQuery(StardogKernel.java:2781)
    ... 26 more

Here is the block of code producing the exception:

Connection aConn = dataSource.getConnection();
ICVConnection icvConnection = aConn.as(ICVConnection.class);
Iteration<ConstraintViolation<BindingSet>, StardogException> violations = icvConnection.getViolationBindings();

I'm using the Stardog Spring extension to configure my data source with valid user credentials.  Also, problem manifests inconsistently. For example, when the getViolationBindings() fails with the exception, above, I continue to call the method until it succeeds. No changes are made to the data between calls.  This is fine for prototyping, but doesn't work in the long run.  Any ideas how I can resolve this?

Thanks,
Duane

Mike Grove

unread,
May 21, 2014, 12:15:19 PM5/21/14
to stardog
It seems likely that the MessagingException is due to the error on the server where the authenticated user seems to be lost.  We fixed a bug for 2.2 where the auth'ed user was lost while iterating over violations, but it only manifested itself when using the embedded server.

Can you provide an example which reproduces that issue, even if intermittently?

Cheers,

Mike
 

Thanks,
Duane

--
-- --
You received this message because you are subscribed to the C&P "Stardog" group.
To post to this group, send email to sta...@clarkparsia.com
To unsubscribe from this group, send email to
stardog+u...@clarkparsia.com
For more options, visit this group at
http://groups.google.com/a/clarkparsia.com/group/stardog?hl=en

Duane Holt

unread,
May 21, 2014, 12:47:06 PM5/21/14
to sta...@clarkparsia.com

It may take some time build up an example I can send, but I will send it ASAP.

~Duane

 

Duane Holt

unread,
May 27, 2014, 3:40:38 PM5/27/14
to sta...@clarkparsia.com
I was able to reproduce the exception by modifying the SOTA example found here [1] and discussed on the Stardog ICV documentation page here [2].
Source code is attached. Sample data was taken direct from the SOTA files at [1].

You can run the example with

java HttpErrorExample sota-data.ttl sota-constraints.ttl

I compiled and ran the example with the icv http client.  You can also run it against the icv snarl client to see this error message:

com.complexible.stardog.StardogException: There was an error while encoding violations
    at com.complexible.stardog.protocols.snarl.icv.client.ICVClientImpl.executeICV(ICVClientImpl.java:148)
    at com.complexible.stardog.protocols.snarl.icv.client.ICVClientImpl.getViolationBindings(ICVClientImpl.java:122)
    at com.complexible.stardog.protocols.snarl.icv.client.SNARLICVConnection.getViolationBindings(SNARLICVConnection.java:107)
    at com.complexible.stardog.icv.api.AbstractICVConnection.getViolationBindings(AbstractICVConnection.java:107)
    at ErrorExample.violationBindingExample(ErrorExample.java:112)
    at ErrorExample.run(ErrorExample.java:98)
    at java.lang.Thread.run(Thread.java:722)
Caused by: com.complexible.common.protocols.client.ClientException: There was an error while encoding violations
    at com.complexible.common.protocols.client.rpc.DefaultRPCClient.get(DefaultRPCClient.java:335)
    at com.complexible.common.protocols.client.rpc.DefaultRPCClient.execute(DefaultRPCClient.java:312)
    at com.complexible.stardog.protocols.snarl.client.DelegatingSNARLClient.execute(DelegatingSNARLClient.java:227)
    at com.complexible.stardog.protocols.snarl.icv.client.ICVClientImpl.executeICV(ICVClientImpl.java:143)
    ... 6 more
Caused by: com.complexible.common.protocols.EncodingException: There was an error while encoding violations
    at sun.reflect.GeneratedConstructorAccessor13.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
    at com.complexible.barc.DefaultThrowableCodec.decode(DefaultThrowableCodec.java:89)
    at com.complexible.barc.BigPacketCodec.toException(BigPacketCodec.java:272)
    at com.complexible.barc.BigPacketCodec.decode(BigPacketCodec.java:239)
    at com.complexible.barc.BigPacketDecoder.channelRead(BigPacketDecoder.java:75)
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:340)
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:326)
    at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:340)
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:326)
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:155)
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:340)
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:326)
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785)
    at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:116)
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:494)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:461)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:378)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:350)
    at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101)
    ... 1 more

Hope this helps.

Thanks,
Duane

[1] SOTA example (full Gist)
[2] Stardog Integrity Constraint Validation
HttpErrorExample.java

Mike Grove

unread,
May 28, 2014, 8:59:32 AM5/28/14
to stardog
Duane,

Thanks for providing the example.  This is indeed the same bug that I thought it was, this was fixed and will be included in the next release.

Cheers,

Mike

Duane Holt

unread,
May 28, 2014, 10:02:27 AM5/28/14
to sta...@clarkparsia.com
That's great new, Mike!  Do you have a tentative date for the next release?

v/r,
Duane

Mike Grove

unread,
May 28, 2014, 10:04:58 AM5/28/14
to stardog
Should be soon, in the next couple weeks.

Cheers,

Mike


--
-- --
You received this message because you are subscribed to the C&P "Stardog" group.
Reply all
Reply to author
Forward
0 new messages