Not a string error on 1.16.1
JasonHorkles opened this issue ยท 22 comments
Whenever the server is started up, "Not a string" gets spammed like 15 times in console. The error stops when I regenerate my worlds file. You can find the current one here
In the Discord server we concluded it was a problem with the world file but I'm not sure exactly what's causing it
Had the same problem - not really good at identifying issues, so will leave my log file for people smarter than I to figure out the problem. https://pastebin.com/6baXjkin
Sidenote: I regenned worlds.yml in my multiverse-core folder and left all my adddons configs and had the same issue, so it's not exclusive to core's config whatever's going on.
I'm now pretty sure it has (at least partially) something to do with old maps and the changes to dimension and custom world support in Bukkit/Spigot. I was getting this error while loading maps that were broken in some other ways too and I assume it's printed due to the dimension being stored as a byte id in the past but they are now string IDs in Minecraft. I suggest testing this with the same worlds that caused it normally but with all map files from the main world's data folder removed.
I don't overly know what im doing with this, but would it be feasible to change this to the matching string value? (Obviously this wouldn't work at scale, but for testing purposes.)
Update: was able to check a 1.16 map file, that does seem to be the exclusive difference between them (yes im aware that map isn't a valid dimension anyway) - i'll attempt to generate a 1.15 world, create a few maps on it and change them to test.
Update: proceeded to do this, but did not have the same issue. I'm not sure why, but is it possible it could be related to a higher volume of map files? (The world i've been having issues with has 400+ map files - this test world had 15) - will continue testing.
Update: The plot thickens - after doing some testing, I went to replace my data folder for one of the 1.15 worlds i was testing, and after doing so i've had no issues with the string message. I'm not entirely certain what happened - the data folder was completely replaced, including idcounts.dat. - this error continued to occur with other 1.15 worlds, so I am going to replicate the steps to make it work.
Update (I update a lot): Can confirm, what I believed - after deleting the data folder, booting the server, stopping the server, deleting the recreated one and replacing it with the old one, it booted without the string error.
Will keep updating as time continues:
Loading just the main world with autoLoad off for all others in the config did not improve the issue
I did not have this issue while loading worlds generated in 1.16
Am backing up server data to test your idea now, will just edit this message once ive tried it.
Update: Tried just loading up our main world, after deleting the map.dat files - was not presented with the issue. Would it be possible to modify the .dat files to attempt to correct the fault?
I was getting this error myself on my server, and became very curious about what was trying to be read as a string. I couldn't see anything in bukkit, craftbukkit, spigot, or Multiverse printing a line that just says "Not a string." So I went searching into the net.minecraft.server
classes and found it.
In DynamicOpsNBT
, there was this method
public DataResult<String> getStringValue(NBTBase nbtbase) {
return nbtbase instanceof NBTTagString ? DataResult.success(nbtbase.asString()) : DataResult.error("Not a string");
}
Here's the code. I became curious about what the game was trying to more or less cast as an NBTTagString, so I modified that class and injected it into the latest spigot jar myself. I changed the above code to this.
@Override
public DataResult<String> getStringValue(NBTBase nbtbase) {
if(nbtbase instanceof NBTTagString)
return DataResult.success(nbtbase.asString());
StringBuilder b = new StringBuilder("Not a string.");
b.append(System.lineSeparator());
b.append("This NBTBase object is actually of type ");
b.append(nbtbase.getClass().toString());
b.append(System.lineSeparator());
b.append("This object is represented as the following string $: ");
b.append(nbtbase.toString());
new Error(b.toString()).printStackTrace();;
return DataResult.error("Not a string");
}
I got some very interesting results that you can view at this gist.
Overall, I'm not too sure what to think of this, since there is a wide variety of NBT objects that the game is assuming are NBTString
s but aren't. This doesn't really help at all at trying to figure out what the core, root issue is, but I figure I could post my findings and maybe someone else can give more input.
@shroomdog27 That method is used when loading the dimension ID of maps (the item, as already indicated here) which was a byte in past versions with an offset of 10 for custom worlds. These could not get converted to string IDs so they will cause this error in the log when loading.
If you notice this error check if you have old map files and if it still happens without them.
Do you know any fix for this? Because I also updated our server from 1.15 to 1.16 and get the error at start-up.
@MinecraftiUndCo besides manually fixing or removing the old map files which cause that, no. You can safely ignore them though if you don't mind that some really old map items wont work anymore.
How can I identify which map files are causing the problem and whats the manually fix for them, because I have 25 maps on our buildserver? @Phoenix616
Please see my previous comment and NeonCoding's ones on that subject. To fix it you would basically need to set the dimension nbt tag in the map's .dat file to the correct dimension name which the map belonged to.
@Phoenix616 So what will happen if I just delete the map_x.dat files? And if I want to change it, should I set it to "minecraft:overworld" or what are the new, correct values?
It would be great to have a plugin that can check worlds for this issue and locate the individual files affected. Can anyone identify which action on server start is causing this? Is it something that Multiverse does?
Thanks for letting us know. While it's not our responsibility, I'd just like to keep this issue open until the issue is fixed in Spigot as well.
Fixed in paper build #220
I've reported it to Spigot, https://hub.spigotmc.org/jira/browse/SPIGOT-6181.