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

**URL:** <https://forum.inductiveautomation.com/t/bug-14913-error-binding-to-tag-memory-datetime-exposed-from-a-managed-tag-provider/27720>\
**Category:** Ignition Early Access\
**Tags:** sdk, ignition80\
**Created:** [August 23, 2019, 2:50pm UTC](https://forum.inductiveautomation.com/t/bug-14913-error-binding-to-tag-memory-datetime-exposed-from-a-managed-tag-provider/27720 "2019-08-23T14:50:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [August 23, 2019, 2:50pm UTC](https://forum.inductiveautomation.com/t/bug-14913-error-binding-to-tag-memory-datetime-exposed-from-a-managed-tag-provider/27720/1 "2019-08-23T14:50:45Z")

</div>

**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:

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

```

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/3/3ff9b852669953474d3075ca8206822538c58eb0.png)

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

![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/a/a5e81b5b14a98fd9c40a796c4b860b0c65c857e0.png)

---

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [August 27, 2019, 11:07am UTC](https://forum.inductiveautomation.com/t/bug-14913-error-binding-to-tag-memory-datetime-exposed-from-a-managed-tag-provider/27720/2 "2019-08-27T11:07:12Z")

</div>

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

@mgross, @paul-griffith, 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 :

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

```

return

```auto
[Bad]

```

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

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

```

```auto
    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 :

```auto
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 ?

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

```

```auto
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)

```

---

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [August 28, 2019, 7:55am UTC](https://forum.inductiveautomation.com/t/bug-14913-error-binding-to-tag-memory-datetime-exposed-from-a-managed-tag-provider/27720/3 "2019-08-28T07:55:04Z")

</div>

I think I found the source of this issue.

## In the following Interface WriteHandler :

```auto
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**

@paul-griffith,@Kevin.Herron,  
not sure the example for **managedTagProvider** still works without adding

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

```

in :

```auto
            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;
            });

```

> <https://github.com/inductiveautomation/ignition-sdk-examples/blob/master/managed-tag-provider/managed-tag-provider-gateway/src/main/java/com/inductiveautomation/ignition/examples/mtp/ManagedProviderGatewayHook.java>

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [September 4, 2019, 10:33pm UTC](https://forum.inductiveautomation.com/t/bug-14913-error-binding-to-tag-memory-datetime-exposed-from-a-managed-tag-provider/27720/4 "2019-09-04T22:33:29Z")

</div>

I see what’s going on, thanks.

---

<div class="post-metadata">

**Author:** ![awalker](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/awalker/32/6874_2.png) [@awalker](https://forum.inductiveautomation.com/u/awalker)\
**Post date:** [September 18, 2019, 7:15pm UTC](https://forum.inductiveautomation.com/t/bug-14913-error-binding-to-tag-memory-datetime-exposed-from-a-managed-tag-provider/27720/5 "2019-09-18T19:15:56Z")

</div>

@mazeyrat This is fixed in the 8.0.4 final.
