question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Given NBT stream does not start with a TAG_Compound

See original GitHub issue

Has anyone else seen this issue with backup downloaded from a realm?

8188 of 47821 Chunks render @ 244.8 cps Error in CreateChunkAndRenderBlock: Given NBT stream does not start with a TAG_Compound

When I download from a Bedrock Realm running 1.17.34 I see this about 20 times, then there are chunks in the map that show as black. Usually it’s ones where there is a lot of player constructed objects at multiple Y levels.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:7

github_iconTop GitHub Comments

3reactions
TapeWermcommented, Nov 8, 2021

Probably related, I’m seeing odd version 9 subchunks as of 1.17.34 (using the official bedrock server) that have what appears to be an empty runtime/palette byte.

Manually parsing the data it appears to be where the paletteAndFlag usually are, there are two empty bytes followed by a single nbt.

I made a gist trying to show the data I have, compared to a valid subchunk that’s at the very next subchunk_index https://gist.github.com/wraithgar/a01b99ee7433a9c8a359069952f2147e

If I wrap a if (paletteAndFlag != 0) around

for (int palletId = 0; palletId < localPalette.Size; palletId++)
{
    var (name, val) = GetNbtVal(ms);
    localPalette.Put(palletId, name, val);
}

in https://github.com/papyrus-mc/papyruscs/blob/master/Maploader/World/World.cs the map comes out fine. Heavy emphasis on I am not remotely familiar with the codebase, I would be shocked if that is a proper fix without introducing regressions.

Edit: Adding a basecase to continue before that for loop also works and seems more efficient, but as always remember that I do not know what I am doing. localPalette.Size is almost the max int value on storage 1 for some version 9 chunks. I suspect the Size is not actually reading an int but a string or some other value.

if (paletteAndFlag == 0)
    continue;
for (int palletId = 0; palletId < localPalette.Size; palletId++)
{
    var (name, val) = GetNbtVal(ms);
    localPalette.Put(palletId, name, val);
}

Edit 2: Might be safer to just return than continue to the next loop iteration given the file reader.

1reaction
TapeWermcommented, Oct 23, 2021

I use bedrock dedicated server and see this. I should poke my world and find what NBT is causing this. Edit: The chunks have barrels in common, I have not poked my save data which is a bit big to upload to GitHub.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Given NBT stream does not start with a TAG_Compound??
When you open the page, go to the "Help with games" section in order to find the right path to look for help.....
Read more >
[SOLVED] Read/Write Compressed NBT from/to DataStream
The Inventory loads and saves fine, which suggests the NBT is all in proper order. It seems like writeCompressed only writes data directly...
Read more >
[Library] Edit or create NBT tags with a compact class
The point here is that you can modify existing NBTCompounds, like the tag compound in ItemStack. There's even a convenience method for ...
Read more >
NBTExplorer - NBT Editor for Windows and Mac
NBTExplorer is a low-level graphical NBT data editor originally based on NBTedit. The key difference is NBTExplorer's full support for ...
Read more >
Minecraft 1.9.2 Command /give converted to /summon - Arqade
The NBT input for /give is already starting within the tag compound because the root data (apart from Slot , which cannot be...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found