mojira.dev
MC-173176

Serialization error affecting operators list and whitelist

The bug

[20:52:28] [Server thread/WARN]: Failed to save operators list: 
java.lang.IllegalArgumentException: class zu declares multiple JSON fields named a
        at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:170) ~[server.jar:?]
        []
        at zw.f(SourceFile:114) ~[server.jar:?]
        at wg.B(SourceFile:114) [server.jar:?]
        at wg.<init>(SourceFile:31) [server.jar:?]
        at wh.d(SourceFile:186) [server.jar:?]
        at net.minecraft.server.MinecraftServer.run(SourceFile:634) [server.jar:?]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_222]

Original Description

So i try to add players as op on my server and it says the following message: An unexpected error occurred trying to execute that command

and when i try again it says: Nothing changed. The player already is an operator.

But the problem is that the op text file is empty

Linked issues

MC-173239 Failed to save operators list & unable to op new users Resolved MC-173314 banned-players, banned-ips and ops json files are broken in 20w09a server Resolved MC-173323 Help Resolved MC-173340 Unable to use commands in 20w09a Resolved MC-173350 Newest Snapshot Has Issues With Server Operators and Whitelist Resolved

Attachments

Comments 9

Can you see if in previous versions, oping someone via console adds it into the .txt file?

I'm not sure why .txt files are initially related, but existing ops.json was destroyed while updating from 20w08a to 20w09a.

It now contains a single square bracket ("[").

 
Should I add a number of ops to ops.txt and restart the server,

---- Minecraft Crash Report ----
// Shall we play a game?

Time: 2/26/20 9:55 PM
Description: Exception in server tick loop

com.google.gson.JsonSyntaxException: java.io.EOFException: End of input at line 1 column 2 path $[0]
        at com.google.gson.Gson.fromJson(Gson.java:897)
        at com.google.gson.Gson.fromJson(Gson.java:825)
        at zw.g(SourceFile:125)
        at zr.c(SourceFile:153)
        at wh.bf(SourceFile:538)
        at wh.d(SourceFile:179)
        at net.minecraft.server.MinecraftServer.run(SourceFile:634)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.io.EOFException: End of input at line 1 column 2 path $[0]
        at com.google.gson.stream.JsonReader.nextNonWhitespace(JsonReader.java:1393)
        at com.google.gson.stream.JsonReader.doPeek(JsonReader.java:549)
        at com.google.gson.stream.JsonReader.hasNext(JsonReader.java:414)
        at com.google.gson.internal.bind.TypeAdapters$29.read(TypeAdapters.java:730)
        at com.google.gson.internal.bind.TypeAdapters$29.read(TypeAdapters.java:714)
        at com.google.gson.internal.bind.TypeAdapters$35$1.read(TypeAdapters.java:910)
        at com.google.gson.Gson.fromJson(Gson.java:887)
        ... 7 more


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- System Details --
Details:
        Minecraft Version: 20w09a
        Minecraft Version ID: 20w09a
        Operating System: FreeBSD (amd64) version 12.1-RELEASE-p1
        Java Version: 1.8.0_212, Oracle Corporation
        Java VM Version: OpenJDK 64-Bit Server VM (mixed mode), Oracle Corporation
        Memory: 3903969208 bytes (3723 MB) / 4294967296 bytes (4096 MB) up to 4294967296 bytes (4096 MB)
        CPUs: 4
        JVM Flags: 8 total; -Xmx4096M -Xms4096M -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M
        Data Packs:
        Is Modded: Unknown (can't tell)
        Type: Dedicated Server (map_server.txt)

Had the same issue. My ops.json was alright in the previous snapshot and worked fine. There were multiple ops set.

After updating to new snapshot sadly when the server started up it threw the error I attached and as previous reporter wrote, it saved the ops.json file with single [ character. After restarting another error is thrown since a single [ is invalid JSON.

 

I deleted the file and restarted the server. Worked fine afterwards.

Hello, it is possible that we could get a fix for this quicker? I have no moderation powers on my snapshot server because of this bug. The delete file workaround does not work, as the server would just completely discard the whitelist and ops file next restart.

Replacing the whitelist file with a backup doesn't work either, upon reloading it the server just ignores it, and adding a new user to the whitelist causes the entire file to be lost.

Operator list is never saved, it only ever consists of a single [.

Banned players and ip bans files don't work, making moderation commands useless.
Due to the fact that I can't even control my own snapshots server I had to close it down temporarily.
Is it possible that we could get an emergency snapshot like with the villager bug?

Seconded! I had to roll our server back to 20w08a because of this issue.

The issue is marked as fixed in the next snapshot. Using snapshots comes with the risk of things being broken sometimes. Hotfixes are only made for problems that prevent proper testing of snapshots, so in this case I recommend you use the previous snapshot until the next one is out.

Still seems to happen in 20w10a

Nevermind, I probably made a mistake while restarting the server

Valtteri Venäläinen

boq

Confirmed

Important

Player

20w09a

20w10a

Retrieved