# \[SOLVED\] Error - Cannot make de.grogra.turtle.RH persistent

**URL:** <https://fspm.discourse.group/t/solved-error-cannot-make-de-grogra-turtle-rh-persistent/267>\
**Category:** GroIMP\
**Created:** [March 31, 2024, 4:37pm UTC](https://fspm.discourse.group/t/solved-error-cannot-make-de-grogra-turtle-rh-persistent/267 "2024-03-31T16:37:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![PeigeZZZ](https://avatars.discourse-cdn.com/v4/letter/p/43a26b/32.png) [@PeigeZZZ](https://fspm.discourse.group/u/PeigeZZZ)\
**Post date:** [March 31, 2024, 4:37pm UTC](https://fspm.discourse.group/t/solved-error-cannot-make-de-grogra-turtle-rh-persistent/267/1 "2024-03-31T16:37:01Z")

</div>

Hi! I encountered an error:  
FatalPersistenceException: Cannot make de.grogra.turtle.RH[id=-1]@39a6bb45 persistent: there already exists the object de.grogra.imp3d. objects.MeshNode[id=12892]@56651ab8 with id 12892

This error prevents me from opening the gsz file. When I create a new gsz file and input the same code it works. But after I close the file I can’t open it again. Does anyone know what is causing this? It seems that this error always appears after I make a copy of the file, but I’m not sure if that’s the cause.  
Thank you for your help!

---

<div class="post-metadata">

**Author:** ![barley65](https://dub1.discourse-cdn.com/flex005/user_avatar/fspm.discourse.group/barley65/32/84_2.png) [@barley65](https://fspm.discourse.group/u/barley65)\
**Post date:** [April 1, 2024, 9:50am UTC](https://fspm.discourse.group/t/solved-error-cannot-make-de-grogra-turtle-rh-persistent/267/2 "2024-04-01T09:50:04Z")

</div>

Hi Peige,  
could have something to do with object serialization in XML, but without further context this is just speculation. Could you please provide the code or at least an extract?  
Best regards  
Gerhard

---

<div class="post-metadata">

**Author:** ![PeigeZZZ](https://avatars.discourse-cdn.com/v4/letter/p/43a26b/32.png) [@PeigeZZZ](https://fspm.discourse.group/u/PeigeZZZ)\
**Post date:** [April 1, 2024, 5:06pm UTC](https://fspm.discourse.group/t/solved-error-cannot-make-de-grogra-turtle-rh-persistent/267/3 "2024-04-01T17:06:15Z")

</div>

Dear Gerhard,

Here is the code. I am not sure where the problem is so I uploaded the whole code. Thank you!

[error-Groimp/Sensitivity\_analysis.gsz at main · Pikapiu77566/error-Groimp (github.com)](https://github.com/Pikapiu77566/error-Groimp/blob/main/Sensitivity_analysis.gsz)

Best,  
Peige

---

<div class="post-metadata">

**Author:** ![gaetanH](https://avatars.discourse-cdn.com/v4/letter/g/edb3f5/32.png) [@gaetanH](https://fspm.discourse.group/u/gaetanH)\
**Post date:** [April 1, 2024, 8:50pm UTC](https://fspm.discourse.group/t/solved-error-cannot-make-de-grogra-turtle-rh-persistent/267/4 "2024-04-01T20:50:16Z")

</div>

Hello Peige,

The error comes from how GroIMP serialize and deserialize the graph XML of the project. Without going into the details you cant prevent this error by not instantiating Nodes in a module definition.

In your project in Model.rgg, when you define the module LeafTemplate, you should not create a instance of a MeshNode.  
Instead, leave the MeshNode mesh null and create a global static MeshNode for the default value:

e.g.

```auto
static MeshNode defaultMesh = new MeshNode(POLYLEAFM_9[0]);

module LeafTemplate extends Organ(petmovelength)
{
	...
	MeshNode mesh;
} ==> ... 
		if (mesh==null) (defaultMesh) else (mesh);

```

Additionally, note that if a groimp project that run, fail to open after being saved and reopened, you can delete the graph.xml file content (the file is still required, even empty). Then, groimp will create a new graph for your project. This will delete the saved graph (equivalent to recompile the project) but the project will open.

I hope this solve your issue,

Best,  
Gaetan

---

<div class="post-metadata">

**Author:** ![PeigeZZZ](https://avatars.discourse-cdn.com/v4/letter/p/43a26b/32.png) [@PeigeZZZ](https://fspm.discourse.group/u/PeigeZZZ)\
**Post date:** [April 1, 2024, 10:12pm UTC](https://fspm.discourse.group/t/solved-error-cannot-make-de-grogra-turtle-rh-persistent/267/5 "2024-04-01T22:12:23Z")

</div>

It works! Thank you very much!

Best,  
Peige
