# Unknown structure Error When Cook

**URL:** <https://forums.unrealengine.com/t/unknown-structure-error-when-cook/339325>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [November 22, 2015, 2:12pm UTC](https://forums.unrealengine.com/t/unknown-structure-error-when-cook/339325 "2015-11-22T14:12:35Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![Todd.Vance](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Todd.Vance](https://forums.unrealengine.com/u/Todd.Vance)\
**Post date:** [April 9, 2018, 5:17pm UTC](https://forums.unrealengine.com/t/unknown-structure-error-when-cook/339325/21 "2018-04-09T17:17:33Z")

</div>

I was getting the same issue in 4.19.0. The trick of renaming the struct variable, then immediately (no compile needed) renaming it back to what is was, then recompiling the blueprint did the trick! Well, then after doing it all, I exited and reopened the editor. And for good measure, fixed up redirectors. The last two sometimes fixing problems (warning—the very last, fixing up redirectors, has broken things for me in the past! esp. materials calling material functions that moved)

---

<div class="post-metadata">

**Author:** ![Motanum](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Motanum](https://forums.unrealengine.com/u/Motanum)\
**Post date:** [April 24, 2018, 9:57pm UTC](https://forums.unrealengine.com/t/unknown-structure-error-when-cook/339325/22 "2018-04-24T21:57:06Z")

</div>

This solves it for me. Happens whenever I edit a structure associated with a save game.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_3dec3555](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_3dec3555](https://forums.unrealengine.com/u/anonymous_user_3dec3555)\
**Post date:** [June 10, 2018, 12:22am UTC](https://forums.unrealengine.com/t/unknown-structure-error-when-cook/339325/23 "2018-06-10T00:22:27Z")

</div>

Worked for me as well \<3

UE 4.19.2

---

<div class="post-metadata">

**Author:** ![nerdifand](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@nerdifand](https://forums.unrealengine.com/u/nerdifand)\
**Post date:** [September 18, 2018, 10:28pm UTC](https://forums.unrealengine.com/t/unknown-structure-error-when-cook/339325/24 "2018-09-18T22:28:14Z")

</div>

solved it for me v 4.20

---

<div class="post-metadata">

**Author:** ![GG-GoraGames](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/gg-goragames/32/1081623_2.png) [@GG-GoraGames](https://forums.unrealengine.com/u/GG-GoraGames)\
**Post date:** [October 17, 2018, 7:59pm UTC](https://forums.unrealengine.com/t/unknown-structure-error-when-cook/339325/25 "2018-10-17T19:59:09Z")

</div>

This is a huge problem… Can a Staff create a bug report. So it get fixed in the next releases. This bug is known since UE 4.8 and still here 10-17-2018 UE 4.21

The structs need to save and recompile!  
Or change the name and save and recompile. But it seems that every ref. also need a save and recompile, too.

---

<div class="post-metadata">

**Author:** ![Magefire9668](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Magefire9668](https://forums.unrealengine.com/u/Magefire9668)\
**Post date:** [March 9, 2019, 11:06am UTC](https://forums.unrealengine.com/t/unknown-structure-error-when-cook/339325/26 "2019-03-09T11:06:50Z")

</div>

the method of renaming all structs worked. this is still relevant in 4.20.0

---

<div class="post-metadata">

**Author:** ![Crazy\_Rabbits](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Crazy\_Rabbits](https://forums.unrealengine.com/u/Crazy_Rabbits)\
**Post date:** [April 23, 2019, 5:41pm UTC](https://forums.unrealengine.com/t/unknown-structure-error-when-cook/339325/27 "2019-04-23T17:41:44Z")

</div>

4.20 work well

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_ecfd43111](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_ecfd43111](https://forums.unrealengine.com/u/anonymous_user_ecfd43111)\
**Post date:** [July 29, 2019, 7:49pm UTC](https://forums.unrealengine.com/t/unknown-structure-error-when-cook/339325/28 "2019-07-29T19:49:32Z")

</div>

This is STILL an open ongoing bug within the unreal engine and EPIC doesn’t know how to duplicate it. I can duplicate it by making a new C++ project in 4.21.1, setting a custom GameState and gamemode, making a new struct and datatable based on the struct , then writing blueprint code in the GameState that references the datatable. Then you cook all, then add a new row to the struct, then cook all again and BOOM . Undefined struct errors galore until you recompile blueprints or rename structs.

---

<div class="post-metadata">

**Author:** ![GreenHowitzer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GreenHowitzer](https://forums.unrealengine.com/u/GreenHowitzer)\
**Post date:** [September 20, 2019, 8:30pm UTC](https://forums.unrealengine.com/t/unknown-structure-error-when-cook/339325/29 "2019-09-20T20:30:13Z")

</div>

renaming my struct fixed it for me 4.20

---

<div class="post-metadata">

**Author:** ![Andrew.Wood](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Andrew.Wood](https://forums.unrealengine.com/u/Andrew.Wood)\
**Post date:** [June 26, 2020, 7:44pm UTC](https://forums.unrealengine.com/t/unknown-structure-error-when-cook/339325/30 "2020-06-26T19:44:06Z")

</div>

4.24.3 checking in, bug still exists. This is still the easiest fix for it, thanks!

---

<div class="post-metadata">

**Author:** ![Krakenitos](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Krakenitos](https://forums.unrealengine.com/u/Krakenitos)\
**Post date:** [July 21, 2020, 7:11pm UTC](https://forums.unrealengine.com/t/unknown-structure-error-when-cook/339325/31 "2020-07-21T19:11:35Z")

</div>

I had problem to Update project from 4.21 to 4.25 (Other versions were working properly)  
I renamed my structures and update was successful. 🙂

---

<div class="post-metadata">

**Author:** ![troyar](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@troyar](https://forums.unrealengine.com/u/troyar)\
**Post date:** [January 9, 2021, 2:36pm UTC](https://forums.unrealengine.com/t/unknown-structure-error-when-cook/339325/32 "2021-01-09T14:36:13Z")

</div>

I have had this problem when I added a new variable in the structure, I tried to fix it with the solutions I saw in this post, but they did not work for me.  
I duplicated the structure and tried to erase the original and replace the references with the duplicate, then a miracle happened, the editor gave me many errors and despite not closing it, it showed me a message with all the BPs that were affected and recommended me to close without saving, when I reopened the editor everything worked correctly and I was able to cook the project …

---

<div class="post-metadata">

**Author:** ![Senitelty](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Senitelty](https://forums.unrealengine.com/u/Senitelty)\
**Post date:** [January 23, 2021, 11:22am UTC](https://forums.unrealengine.com/t/unknown-structure-error-when-cook/339325/33 "2021-01-23T11:22:39Z")

</div>

4.25.4 issue still persists. So far this is still the best way to fix it.

---

<div class="post-metadata">

**Author:** ![dadtaru](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@dadtaru](https://forums.unrealengine.com/u/dadtaru)\
**Post date:** [March 21, 2021, 12:53am UTC](https://forums.unrealengine.com/t/unknown-structure-error-when-cook/339325/34 "2021-03-21T00:53:45Z")

</div>

4.26.1 here. fastest fix is to simply go to each file using the struct and select “refresh all nodes” from the file menu.

the output log will pinpoint each file if you’re not sure.

---

<div class="post-metadata">

**Author:** ![Shadowblade\_K](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/shadowblade_k/32/466002_2.png) [@Shadowblade\_K](https://forums.unrealengine.com/u/Shadowblade_K)\
**Post date:** [July 22, 2021, 11:22am UTC](https://forums.unrealengine.com/t/unknown-structure-error-when-cook/339325/35 "2021-07-22T11:22:57Z")

</div>

Instead of renaming structs, try recompiling Blueprints where problem is caused. Worked for me…

---

<div class="post-metadata">

**Author:** ![Harley\_Dolton](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Harley\_Dolton](https://forums.unrealengine.com/u/Harley_Dolton)\
**Post date:** [August 29, 2021, 6:47pm UTC](https://forums.unrealengine.com/t/unknown-structure-error-when-cook/339325/36 "2021-08-29T18:47:38Z")

</div>

All of the above posts are great, however not so much if you have a very large project, and it has several nested structs referenced everywhere. I found a solution which gives you the exact actor class, and the variable causing the error. I didn’t post this, I’m just reposting it because this page is much easier to find for others 🙂

(Link - [https://www.reddit.com/r/unrealengine/comments/l8qaa4/isshortpackagenamepath\_error\_while\_packaging](https://www.reddit.com/r/unrealengine/comments/l8qaa4/isshortpackagenamepath_error_while_packaging))

 ![347613-structdebugfix.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/e/b/deb4df27d1d91c7f296cd2e642e440fff1a61c04.png)

---

<div class="post-metadata">

**Author:** ![user\_fc7b885dcba9875a4966b486881408ab308063894a5483c93e21bf](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@user\_fc7b885dcba9875a4966b486881408ab308063894a5483c93e21bf](https://forums.unrealengine.com/u/user_fc7b885dcba9875a4966b486881408ab308063894a5483c93e21bf)\
**Post date:** [May 23, 2022, 9:12am UTC](https://forums.unrealengine.com/t/unknown-structure-error-when-cook/339325/37 "2022-05-23T09:12:17Z")

</div>

solved it for 5.0

---

<div class="post-metadata">

**Author:** ![RealAero](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/realaero/32/716140_2.png) [@RealAero](https://forums.unrealengine.com/u/RealAero)\
**Post date:** [July 10, 2022, 11:47pm UTC](https://forums.unrealengine.com/t/unknown-structure-error-when-cook/339325/38 "2022-07-10T23:47:46Z")

</div>

Very simple fix I discovered.

Change the variable type to anything, like Boolean, and then change it back.

---

<div class="post-metadata">

**Author:** ![Bolad\_Daurian](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/bolad_daurian/32/989869_2.png) [@Bolad\_Daurian](https://forums.unrealengine.com/u/Bolad_Daurian)\
**Post date:** [July 22, 2022, 7:47pm UTC](https://forums.unrealengine.com/t/unknown-structure-error-when-cook/339325/39 "2022-07-22T19:47:23Z")

</div>

So this is still a problem 7 years latter, the renaming the variable referencing the struct solved it for me

---

<div class="post-metadata">

**Author:** ![brno32](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@brno32](https://forums.unrealengine.com/u/brno32)\
**Post date:** [September 5, 2022, 6:21am UTC](https://forums.unrealengine.com/t/unknown-structure-error-when-cook/339325/40 "2022-09-05T06:21:09Z")

</div>

Still a problem in UE5 too

[Previous page](https://forums.unrealengine.com/t/unknown-structure-error-when-cook/339325.md?page=1)

[Next page](https://forums.unrealengine.com/t/unknown-structure-error-when-cook/339325.md?page=3)
