# Error during blocking write of tags through scripting

**URL:** <https://forum.inductiveautomation.com/t/error-during-blocking-write-of-tags-through-scripting/42883>\
**Category:** Ignition\
**Tags:** ignition81, vision, scripting\
**Created:** [February 2, 2021, 1:35pm UTC](https://forum.inductiveautomation.com/t/error-during-blocking-write-of-tags-through-scripting/42883 "2021-02-02T13:35:45Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![sbussolino](https://avatars.discourse-cdn.com/v4/letter/s/5fc32e/32.png) [@sbussolino](https://forum.inductiveautomation.com/u/sbussolino)\
**Post date:** [February 2, 2021, 1:35pm UTC](https://forum.inductiveautomation.com/t/error-during-blocking-write-of-tags-through-scripting/42883/1 "2021-02-02T13:35:45Z")

</div>

Hello

I’m recently experiencing a bug with a series of scripts that are making two OPC server comunicate between them.  
What I’m trying to do is read tags from one server, and write (blocking) them to the other server through gateway scripts. Actually the scripts are working fine but I keep getting this annoying error on the gateway logs: Error during blocking write of tags through scripting.  
I also tried to execute the function in the script console, and the error keeps coming on the logs even though the script executes perfectly.  
The ignition version I’m using is 8.1.2-rc1.

Here are the screenshots of the script run from the console and the errors on the gateway logs.

 ![console](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/3/f3e0a66bee8a5d897c681aa76e947330c226f352.png)  
 ![log](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/8/88452e585d4958e40c24dd3843c98b510a17f7b9.png)

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [February 2, 2021, 4:59pm UTC](https://forum.inductiveautomation.com/t/error-during-blocking-write-of-tags-through-scripting/42883/2 "2021-02-02T16:59:07Z")

</div>

You’re getting a `TimeoutException` - manually provide a longer timeout delay in your call to [`system.tag.writeBlocking`](https://docs.inductiveautomation.com/display/DOC81/system.tag.writeBlocking).

---

<div class="post-metadata">

**Author:** ![sbussolino](https://avatars.discourse-cdn.com/v4/letter/s/5fc32e/32.png) [@sbussolino](https://forum.inductiveautomation.com/u/sbussolino)\
**Post date:** [February 3, 2021, 7:54am UTC](https://forum.inductiveautomation.com/t/error-during-blocking-write-of-tags-through-scripting/42883/3 "2021-02-03T07:54:51Z")

</div>

Thanks for the reply Paul,

I alredy have a a timeout in my writeBlocking call. The function call is inside a class and it’s parametrised as follows:  
`writeResult = system.tag.writeBlocking(writePaths, writeValues, timeout=self.writeTimeout)`

Here is the screenshot:

 ![writeBlocking](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/1/6192167297ae3b68afc9d6d79f7a918e069b0bc1.png)

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 3, 2021, 12:37pm UTC](https://forum.inductiveautomation.com/t/error-during-blocking-write-of-tags-through-scripting/42883/4 "2021-02-03T12:37:48Z")

</div>

If you use the timeout parameter, you need to use a try-except block around the call to catch when it happens. What you are seeing is not a bug.

---

<div class="post-metadata">

**Author:** ![sbussolino](https://avatars.discourse-cdn.com/v4/letter/s/5fc32e/32.png) [@sbussolino](https://forum.inductiveautomation.com/u/sbussolino)\
**Post date:** [February 3, 2021, 1:05pm UTC](https://forum.inductiveautomation.com/t/error-during-blocking-write-of-tags-through-scripting/42883/5 "2021-02-03T13:05:35Z")

</div>

The point is I’m getting this exception even if my `writeBlocking` takes less than the timeout parameter.

---

<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:** [February 3, 2021, 1:07pm UTC](https://forum.inductiveautomation.com/t/error-during-blocking-write-of-tags-through-scripting/42883/6 "2021-02-03T13:07:56Z")

</div>

Hmm. Seems like the exceptions in the logs are from another script making the writeBlocking call. A gateway timer script from the stack trace.

---

<div class="post-metadata">

**Author:** ![jesse.daniels](https://avatars.discourse-cdn.com/v4/letter/j/e36b37/32.png) [@jesse.daniels](https://forum.inductiveautomation.com/u/jesse.daniels)\
**Post date:** [August 8, 2023, 10:26pm UTC](https://forum.inductiveautomation.com/t/error-during-blocking-write-of-tags-through-scripting/42883/7 "2023-08-08T22:26:32Z")

</div>

any resolve to this issue? my error is similar.

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