[BUG-14913] error binding to Tag Memory DateTime exposed from a Managed tag Provider

Ignition 8.0.4-NIGHTLY - 21/08/2019

@awalker, could you please fill a ticket for this bug:

I have some working binding in 7.9.X After upgrading to 8.0.4, when I open the windows I have the following error message:

Error writing "22/08/2019 00:00" to tag [replay]CommandTags/startDate Bad

The tag binded is a Memory DateTime exposed from a Managed tag Provider

image

does anybody hit or reproduce this bug in 8.0.4-Nightly ???

@mgross, @PGriffith, I suppose it is relative to DateTime datatype in the Tag managed Provider ?

In the script console, if I test a write, I have an error too :

import system
path = "[replay]CommandTags/startDate"
now = system.date.now()
system.tag.writeBlocking([path],[now])

return

[Bad]

In the module that create the Managed Tag provider with the tag :

this.ourProvider.configureTag(STATUS_TAG_START_DATE, DataType.DateTime);
...
MyWriteHandler myWriteHandler = new MyWriteHandler();
this.ourProvider.registerWriteHandler(COMMAND_TAG_START_DATE, myWriteHandler);

    protected class MyWriteHandler implements WriteHandler {

        @Override
        public synchronized QualityCode write(TagPath target, Object value) {
            try {
                if (tagPath.equalsIgnoreCase(COMMAND_TAG_START_DATE)) {
                    updateValue(COMMAND_TAG_START_DATE, value);
                    startDate = (Date) value;
                }
                return QualityCode.Good;
            } catch (Exception e) {
                logger.error("WriteHandler() - Exception : ", e);
                return QualityCode.Bad;
            }
        }
    }

The module works in 7.9 but in 8.0.4, DateTime exposed doesn’t works !

in the gateway, the error :

ReplayProvider	28Aug2019 08:59:02	WriteHandler() - Exception :
java.lang.IllegalArgumentException: Nesting qualified values.

at com.inductiveautomation.ignition.common.model.values.BasicQualifiedValue.(BasicQualifiedValue.java:58)

at com.inductiveautomation.ignition.gateway.tags.managed.ManagedTagProviderImpl.updateValue(ManagedTagProviderImpl.java:251)

at com.inductiveautomation.ignition.gateway.tags.managed.ManagedTagProvider.updateValue(ManagedTagProvider.java:25)

at com.bouyguesenergiesservices.ignition.gateway.replay.tag.ReplayProvider$MyWriteHandler.write(ReplayProvider.java:923)

at com.inductiveautomation.ignition.gateway.tags.managed.ManagedTagProviderImpl$ManagedProviderValueActorFactory$ManagedProviderValueActor.processWrite(ManagedTagProviderImpl.java:450)

at com.inductiveautomation.ignition.gateway.tags.runtime.nodes.ExecutableTag.write(ExecutableTag.java:343)

at com.inductiveautomation.ignition.gateway.tags.TagProviderImpl.writeAsync(TagProviderImpl.java:539)

at com.inductiveautomation.ignition.gateway.tags.provider.RestrictedTagProvider.writeAsync(RestrictedTagProvider.java:61)

at com.inductiveautomation.ignition.gateway.tags.model.impl.GatewayTagManagerImpl.lambda$writeAsync$12(GatewayTagManagerImpl.java:628)

at com.inductiveautomation.ignition.gateway.util.GroupMapCollate.lambda$groupMapCollateIndexed$5(GroupMapCollate.java:53)

at java.base/java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)

at java.base/java.util.HashMap$EntrySpliterator.forEachRemaining(Unknown Source)

at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source)

at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)

at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)

at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source)

at java.base/java.util.stream.ReferencePipeline.collect(Unknown Source)

at com.inductiveautomation.ignition.common.util.Futures.sequence(Futures.java:26)

at com.inductiveautomation.ignition.gateway.util.GroupMapCollate.groupMapCollateIndexed(GroupMapCollate.java:62)

at com.inductiveautomation.ignition.gateway.tags.model.impl.GatewayTagManagerImpl.writeAsync(GatewayTagManagerImpl.java:612)

at com.inductiveautomation.ignition.gateway.tags.model.ProjectDefaultTagManagerFacade.writeAsync(ProjectDefaultTagManagerFacade.java:270)

at com.inductiveautomation.ignition.gateway.servlets.gateway.functions.TagProviderRpc.write(TagProviderRpc.java:132)

at jdk.internal.reflect.GeneratedMethodAccessor211.invoke(Unknown Source)

at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.base/java.lang.reflect.Method.invoke(Unknown Source)

at com.inductiveautomation.ignition.gateway.servlets.gateway.AbstractGatewayFunction.invoke(AbstractGatewayFunction.java:225)

at com.inductiveautomation.ignition.gateway.servlets.Gateway.doPost(Gateway.java:409)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)

at com.inductiveautomation.ignition.gateway.bootstrap.MapServlet.service(MapServlet.java:86)

at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:852)

at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:535)

at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)

at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)

at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)

at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:190)

at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595)

at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)

at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1253)

at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:168)

at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)

at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564)

at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:166)

at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1155)

at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)

at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)

at org.eclipse.jetty.rewrite.handler.RewriteHandler.handle(RewriteHandler.java:335)

at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:61)

at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:126)

at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)

at org.eclipse.jetty.server.Server.handle(Server.java:530)

at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:347)

at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:256)

at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)

at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102)

at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)

at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:247)

at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.produce(EatWhatYouKill.java:140)

at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)

at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:382)

at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:708)

at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:626)

at java.base/java.lang.Thread.run(Unknown Source)

It seem I have the issue for all the tags,

the value seem to be a Qualified value in 8.0 instead of simple value like in 7.9

The following Interface WriteHandler is still ok ?

com.inductiveautomation.ignition.gateway.tags.managed.write​(TagPath target, java.lang.Object value)
ReplayProvider	28Aug2019 09:06:11	WriteHandler() - Exception :
java.lang.ClassCastException: Cannot coerce value '[3.0, Good, Wed Aug 28 09:06:11 CEST 2019 (1566975971350)]' into type: class java.lang.Double

at com.inductiveautomation.ignition.common.TypeUtilities.coerce(TypeUtilities.java:1339)

at com.inductiveautomation.ignition.common.TypeUtilities.toDouble(TypeUtilities.java:1447)

at com.bouyguesenergiesservices.ignition.gateway.replay.tag.ReplayProvider$3.write(ReplayProvider.java:1168)

at com.inductiveautomation.ignition.gateway.tags.managed.ManagedTagProviderImpl$ManagedProviderValueActorFactory$ManagedProviderValueActor.processWrite(ManagedTagProviderImpl.java:450)

at com.inductiveautomation.ignition.gateway.tags.runtime.nodes.ExecutableTag.write(ExecutableTag.java:343)

at com.inductiveautomation.ignition.gateway.tags.TagProviderImpl.writeAsync(TagProviderImpl.java:539)

at com.inductiveautomation.ignition.gateway.tags.provider.RestrictedTagProvider.writeAsync(RestrictedTagProvider.java:61)

at com.inductiveautomation.ignition.gateway.tags.model.impl.GatewayTagManagerImpl.lambda$writeAsync$12(GatewayTagManagerImpl.java:628)

at com.inductiveautomation.ignition.gateway.util.GroupMapCollate.lambda$groupMapCollateIndexed$5(GroupMapCollate.java:53)

at java.base/java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)

at java.base/java.util.HashMap$EntrySpliterator.forEachRemaining(Unknown Source)

at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source)

at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)

at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)

at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source)

at java.base/java.util.stream.ReferencePipeline.collect(Unknown Source)

at com.inductiveautomation.ignition.common.util.Futures.sequence(Futures.java:26)

at com.inductiveautomation.ignition.gateway.util.GroupMapCollate.groupMapCollateIndexed(GroupMapCollate.java:62)

at com.inductiveautomation.ignition.gateway.tags.model.impl.GatewayTagManagerImpl.writeAsync(GatewayTagManagerImpl.java:612)

at com.inductiveautomation.ignition.gateway.tags.model.ProjectDefaultTagManagerFacade.writeAsync(ProjectDefaultTagManagerFacade.java:270)

at com.inductiveautomation.ignition.gateway.servlets.gateway.functions.TagProviderRpc.write(TagProviderRpc.java:132)

at jdk.internal.reflect.GeneratedMethodAccessor211.invoke(Unknown Source)

at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.base/java.lang.reflect.Method.invoke(Unknown Source)

at com.inductiveautomation.ignition.gateway.servlets.gateway.AbstractGatewayFunction.invoke(AbstractGatewayFunction.java:225)

at com.inductiveautomation.ignition.gateway.servlets.Gateway.doPost(Gateway.java:409)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)

at com.inductiveautomation.ignition.gateway.bootstrap.MapServlet.service(MapServlet.java:86)

at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:852)

at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:535)

at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)

at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)

at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)

at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:190)

at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595)

at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)

at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1253)

at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:168)

at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)

at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564)

at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:166)

at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1155)

at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)

at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)

at org.eclipse.jetty.rewrite.handler.RewriteHandler.handle(RewriteHandler.java:335)

at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:61)

at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:126)

at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)

at org.eclipse.jetty.server.Server.handle(Server.java:530)

at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:347)

at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:256)

at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)

at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102)

at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)

at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:247)

at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.produce(EatWhatYouKill.java:140)

at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)

at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:382)

at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:708)

at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:626)

at java.base/java.lang.Thread.run(Unknown Source)

I think I found the source of this issue.

In the following Interface WriteHandler :

com.inductiveautomation.ignition.gateway.tags.managed.write​(TagPath target, java.lang.Object value)

the value seem to be a Qualified value in 8.0 instead of simple value like in 7.9

@PGriffith,@Kevin.Herron,
not sure the example for managedTagProvider still works without adding

value = ((QualifiedValue) value).getValue();

in :

            ourProvider.registerWriteHandler(CONTROL_TAG, (TagPath target, Object value) -> {
                Integer intVal = TypeUtilities.toInteger(value);
                //The adjustTags function will add/remove tags, AND update the current value of the control tag.
                adjustTags(intVal);
                return QualityCode.Good;
            });

I see what’s going on, thanks.

@mazeyrat This is fixed in the 8.0.4 final.