# \[BUG\] Named Query deserialization

**URL:** <https://forum.inductiveautomation.com/t/bug-named-query-deserialization/28319>\
**Category:** Ignition Early Access\
**Created:** [September 17, 2019, 5:34pm UTC](https://forum.inductiveautomation.com/t/bug-named-query-deserialization/28319 "2019-09-17T17:34:50Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![andrea.morando](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/andrea.morando/32/8039_2.png) [@andrea.morando](https://forum.inductiveautomation.com/u/andrea.morando)\
**Post date:** [September 17, 2019, 5:34pm UTC](https://forum.inductiveautomation.com/t/bug-named-query-deserialization/28319/1 "2019-09-17T17:34:50Z")

</div>

Dears,  
I am currently using the 8.0.3 release.  
I recently installed a new gateway on a production server and I transferred the developed project (copy and paste in the file system).  
When I opened a named query on the designer, I met this error:

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

The above error was not present in the development server.  
What could be the reason?

Tell me for further information.  
Thanks.

---

<div class="post-metadata">

**Author:** ![ggross](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ggross/32/12668_2.png) [@ggross](https://forum.inductiveautomation.com/u/ggross)\
**Post date:** [September 17, 2019, 7:52pm UTC](https://forum.inductiveautomation.com/t/bug-named-query-deserialization/28319/2 "2019-09-17T19:52:50Z")

</div>

@andrea.morando,

It was good to talk with you at ICC about this. Please let me know the outcome if exporting the resources from the development machine and importing them to your production server.

One other thing I thought about after we talked is how is the database defined in your named query? If it is linked to the project default, your project may need to updated to reflect the correct DB.

Garth

---

<div class="post-metadata">

**Author:** ![andrea.morando](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/andrea.morando/32/8039_2.png) [@andrea.morando](https://forum.inductiveautomation.com/u/andrea.morando)\
**Post date:** [September 23, 2019, 10:40pm UTC](https://forum.inductiveautomation.com/t/bug-named-query-deserialization/28319/3 "2019-09-23T22:40:22Z")

</div>

Dear Garth,  
I checked again the error above: in a second production server, where the latest 8.0.4 stable release has been installed, the behavior is again the same as posted last week.  
The copy&paste operation of the “named-query” folder from the files system of a server to another raises up the parsing error. Instead, the export&import of the zip file solve the issue.  
I noticed that this happens for a large number of queries (\> 40): where the named query numbers are between 20-25 the copy&paste works fine.  
Is it a matter of files size?

Thank you so much.  
Best,  
Andrea

---

<div class="post-metadata">

**Author:** ![ggross](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ggross/32/12668_2.png) [@ggross](https://forum.inductiveautomation.com/u/ggross)\
**Post date:** [September 24, 2019, 4:54pm UTC](https://forum.inductiveautomation.com/t/bug-named-query-deserialization/28319/4 "2019-09-24T16:54:04Z")

</div>

Andrea,

Would it be possible to send me just the named-query folder via a private message? It could be file size, but that would be something we would want to fix. I also want to confirm that there isn’t something with endline characters that could be causing a problem.

Garth

---

<div class="post-metadata">

**Author:** ![andrea.morando](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/andrea.morando/32/8039_2.png) [@andrea.morando](https://forum.inductiveautomation.com/u/andrea.morando)\
**Post date:** [September 24, 2019, 5:07pm UTC](https://forum.inductiveautomation.com/t/bug-named-query-deserialization/28319/5 "2019-09-24T17:07:25Z")

</div>

Yes, no problem. Should I use the Message button close to your profile to send you a private message?  
Thanks.

---

<div class="post-metadata">

**Author:** ![ggross](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ggross/32/12668_2.png) [@ggross](https://forum.inductiveautomation.com/u/ggross)\
**Post date:** [September 24, 2019, 5:08pm UTC](https://forum.inductiveautomation.com/t/bug-named-query-deserialization/28319/6 "2019-09-24T17:08:24Z")

</div>

That would be perfect. Thanks!

Garth

---

<div class="post-metadata">

**Author:** ![ggross](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ggross/32/12668_2.png) [@ggross](https://forum.inductiveautomation.com/u/ggross)\
**Post date:** [September 24, 2019, 6:08pm UTC](https://forum.inductiveautomation.com/t/bug-named-query-deserialization/28319/7 "2019-09-24T18:08:28Z")

</div>

@andrea.morando,

Thank you for the file. What looks to be happening is the named queries look to be missing their data.bin file in the archive you sent me. In every folder there should be the following two files:

1. resource.json
2. data.bin

While _resource.json_ files exist in your archive, the _data.bin_ files (which contain the definition of the named query) do not. This causes the Gateway to create a empty file which is causing the error you are seeing. We need to understand why this file is missing.

If you look on the gateway where you are creating this archive from (referred to as source gateway going forward):

1. Do you see the _data.bin_ file in each of the folders?
2. When opening a designer against this project on the source gateway, are the definitions valid?
3. What OS is running the Designer for the source Gateway?
4. What OS is the source Gateway using?
5. Are multiple people developing on the project at any given time?
6. How frequent are saves occurring on this gateway (any estimation will help)

We have had reports of user’s losing resource definitions, but we have yet to narrow down how it is occurring. If your source Gateway is missing _data.bin_ files, the above questions will hopefully help us narrow down what might be happening.

Thanks,  
Garth

---

<div class="post-metadata">

**Author:** ![andrea.morando](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/andrea.morando/32/8039_2.png) [@andrea.morando](https://forum.inductiveautomation.com/u/andrea.morando)\
**Post date:** [October 1, 2019, 10:02am UTC](https://forum.inductiveautomation.com/t/bug-named-query-deserialization/28319/8 "2019-10-01T10:02:28Z")

</div>

Dear Garth,  
I clarified the issue: the fault is from my side. During the commits towards a git repo the data.bin files were excluded from those operations.  
I fix the bug and then I let you know if the situation will be ok.

Thank you.  
Andrea
