Subscription issues in python client

Hello all,

I’ve just run into a peculiar problem subscribing to nodes from an external python client :

PublishService	Returning ServiceFault for request: [PublishRequest requestHandle=9]. StatusCode=StatusCode[Severity=Bad, Subcode=Bad_InternalError]
 	
java.lang.IllegalArgumentException: fromIndex(0) > toIndex(-1)
at java.util.ArrayList.subListRangeCheck(ArrayList.java:1006)
at java.util.ArrayList.subList(ArrayList.java:996)
at com.inductiveautomation.xopc.server.subscriptions.NotificationMessageFactory.createMessageForItems(NotificationMessageFactory.java:118)
at com.inductiveautomation.xopc.server.subscriptions.BaseSubscription.returnNotifications(BaseSubscription.java:583)
at com.inductiveautomation.xopc.server.subscriptions.BaseSubscription.requestReceivedNormal(BaseSubscription.java:453)
at com.inductiveautomation.xopc.server.subscriptions.BaseSubscription.consume(BaseSubscription.java:409)
at com.inductiveautomation.xopc.server.sessions.UaSession.publishRequestReceived(UaSession.java:313)
at com.inductiveautomation.xopc.server.core.services.subscription.PublishService.executeInternal(PublishService.java:38)
at com.inductiveautomation.xopc.server.core.services.subscription.PublishService.executeInternal(PublishService.java:18)
at com.inductiveautomation.xopc.server.core.services.AbstractService.execute(AbstractService.java:51)
at com.inductiveautomation.xopc.server.stack.AbstractUAServer$RequestServer.serveRequest(AbstractUAServer.java:77)
at com.inductiveautomation.xopc.server.stack.AbstractUAServer$RequestServer.run(AbstractUAServer.java:66)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

Has anyone ever run into this? I’ve tested the client with other OPC servers, with no problems.

Thanks for your help.

Do you know what MaxNotificationsPerPublish parameter your client is creating the subscription with?

The default MaxNotificationsPerPublish is 4294967295

Here are all the parameters:

RequestedPublishingInterval = period
RequestedLifetimeCount = 3000
RequestedMaxKeepAliveCount = 10000
MaxNotificationsPerPublish = 4294967295
PublishingEnabled = True
Priority = 0

Looks like a bug in the server dealing with a value over a certain size. As a workaround you could probably change that value to 0, which let’s the server choose, or use a value <= 2147483647.

Ok, I’ll give it a go.

Thanks for looking into this.

Brilliant, that did the trick.