Skip to content

Pasting a multi-line string into the terminal console causes a crash #13006

Closed

Description

@metabrixkt

Stack trace

$ java -jar paper-1.21.8-42.jar                                                  
Starting org.bukkit.craftbukkit.Main
[21:42:17 INFO]: [bootstrap] Running Java 21 (OpenJDK 64-Bit Server VM 21.0.8+9-LTS; Eclipse Adoptium Temurin-21.0.8+9) on Linux 6.8.0-64-generic (amd64)
[21:42:17 INFO]: [bootstrap] Loading Paper 1.21.8-42-main@b0da38c (2025-08-22T10:35:13Z) for Minecraft 1.21.8
[21:42:17 INFO]: [PluginInitializerManager] Initializing plugins...
[21:42:17 INFO]: [PluginInitializerManager] Initialized 0 plugins
[21:42:21 INFO]: Environment: Environment[sessionHost=https://sessionserver.mojang.com, servicesHost=https://api.minecraftservices.com, name=PROD]
[21:42:22 INFO]: Loaded 1407 recipes
[21:42:22 INFO]: Loaded 1520 advancements
[21:42:22 INFO]: [ca.spottedleaf.dataconverter.minecraft.datatypes.MCTypeRegistry] Initialising converters for DataConverter...
[21:42:23 INFO]: [ca.spottedleaf.dataconverter.minecraft.datatypes.MCTypeRegistry] Finished initialising converters for DataConverter in 355,5ms
[21:42:23 INFO]: Starting minecraft server version 1.21.8
[21:42:23 INFO]: Loading properties
[21:42:23 INFO]: This server is running Paper version 1.21.8-42-main@b0da38c (2025-08-22T10:35:13Z) (Implementing API version 1.21.8-R0.1-SNAPSHOT)
[21:42:23 INFO]: [spark] This server bundles the spark profiler. For more information please visit https://docs.papermc.io/paper/profiling
[21:42:23 INFO]: Server Ping Player Sample Count: 12
[21:42:23 INFO]: Using 4 threads for Netty based IO
[21:42:24 INFO]: [MoonriseCommon] Paper is using 1 worker threads, 1 I/O threads
[21:42:24 INFO]: [ChunkTaskScheduler] Chunk system is using population gen parallelism: true
[21:42:24 INFO]: Default game type: SURVIVAL
[21:42:24 INFO]: Generating keypair
[21:42:24 INFO]: Starting Minecraft server on *:25565
[21:42:24 INFO]: Using epoll channel type
[21:42:24 INFO]: Paper: Using libdeflate (Linux x86_64) compression from Velocity.
[21:42:24 INFO]: Paper: Using OpenSSL 3.x.x (Linux x86_64) cipher from Velocity.
[21:42:24 INFO]: Server permissions file permissions.yml is empty, ignoring it
[21:42:24 INFO]: Preparing level "world"
[21:42:25 INFO]: Preparing start region for dimension minecraft:overworld
[21:42:25 INFO]: Preparing spawn area: 0%
[21:42:25 INFO]: Preparing spawn area: 26%
[21:42:25 INFO]: Time elapsed: 770 ms
[21:42:25 INFO]: Preparing start region for dimension minecraft:the_nether
[21:42:25 INFO]: Preparing spawn area: 0%
[21:42:26 INFO]: Time elapsed: 168 ms
[21:42:26 INFO]: Preparing start region for dimension minecraft:the_end
[21:42:26 INFO]: Preparing spawn area: 0%
[21:42:26 INFO]: Time elapsed: 78 ms
[21:42:26 INFO]: [spark] Starting background profiler...
[21:42:26 INFO]: Done preparing level "world" (1.586s)
[21:42:26 INFO]: Running delayed init tasks
[21:42:26 INFO]: Done (9.824s)! For help, type "help"
> test command 1
> test command 2
> test command 3
> test command 4
> test command 5
[21:42:29 ERROR]: Encountered an unexpected exception
java.lang.RuntimeException: Failed to encode Minecraft Component: empty[style={color=gray,clickEvent=SuggestCommand[command=/test command 1                                                                                                 
test command 2                                                                                                                                                                                                                              
test command 3                                                                                                                                                                                                                              
test command 4                                                                                                                                                                                                                              
test command 5]}, siblings=[literal{test }, literal{command 1                                                                                                                                                                               
test command 2                                                                                                                                                                                                                              
test command 3                                                                                                                                                                                                                              
test command 4                                                                                                                                                                                                                              
test command 5}[style={color=red,underlined}], translation{key='command.context.here', args=[]}[style={color=red,italic}]]]; Disallowed chat character: '                                                                                   
'                                                                                                                                                                                                                                           
        at io.papermc.paper.adventure.WrapperAwareSerializer.lambda$deserialize$0(WrapperAwareSerializer.java:28) ~[paper-1.21.8.jar:1.21.8-42-b0da38c]                                                                                     
        at com.mojang.serialization.DataResult$Error.getOrThrow(DataResult.java:287) ~[datafixerupper-8.0.16.jar:?]                                                                                                                         
        at io.papermc.paper.adventure.WrapperAwareSerializer.deserialize(WrapperAwareSerializer.java:28) ~[paper-1.21.8.jar:1.21.8-42-b0da38c]                                                                                              
        at io.papermc.paper.adventure.WrapperAwareSerializer.deserialize(WrapperAwareSerializer.java:13) ~[paper-1.21.8.jar:1.21.8-42-b0da38c]                                                                                              
        at io.papermc.paper.adventure.PaperAdventure.asAdventure(PaperAdventure.java:190) ~[paper-1.21.8.jar:1.21.8-42-b0da38c]                                                                                                             
        at net.minecraft.commands.Commands.finishParsing(Commands.java:427) ~[paper-1.21.8.jar:1.21.8-42-b0da38c]                                                                                                                           
        at net.minecraft.commands.Commands.performCommand(Commands.java:353) ~[paper-1.21.8.jar:1.21.8-42-b0da38c]                                                                                                                          
        at net.minecraft.commands.Commands.performCommand(Commands.java:345) ~[paper-1.21.8.jar:1.21.8-42-b0da38c]                                                                                                                          
        at net.minecraft.commands.Commands.performPrefixedCommand(Commands.java:336) ~[paper-1.21.8.jar:1.21.8-42-b0da38c]                                                                                                                  
        at net.minecraft.server.dedicated.DedicatedServer.handleConsoleInputs(DedicatedServer.java:435) ~[paper-1.21.8.jar:1.21.8-42-b0da38c]                                                                                               
        at net.minecraft.server.dedicated.DedicatedServer.tickConnection(DedicatedServer.java:386) ~[paper-1.21.8.jar:1.21.8-42-b0da38c]                                                                                                    
        at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1738) ~[paper-1.21.8.jar:1.21.8-42-b0da38c]                                                                                                               
        at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1530) ~[paper-1.21.8.jar:1.21.8-42-b0da38c]                                                                                                                 
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1252) ~[paper-1.21.8.jar:1.21.8-42-b0da38c]                                                                                                                  
        at net.minecraft.server.MinecraftServer.lambda$spin$2(MinecraftServer.java:310) ~[paper-1.21.8.jar:1.21.8-42-b0da38c]                                                                                                               
        at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?]                                                                                                                                                                          
[21:42:29 ERROR]: This crash report has been saved to: /mnt/data/Загрузки/paper/crash-reports/crash-2025-08-22_21.42.29-server.txt
[21:42:29 INFO]: Stopping server
[21:42:29 INFO]: Saving players
[21:42:29 INFO]: Saving worlds
[21:42:29 INFO]: Saving chunks for level 'ServerLevel[world]'/minecraft:overworld
[21:42:29 INFO]: [ChunkHolderManager] Waiting 60s for chunk system to halt for world 'world'
[21:42:29 INFO]: [ChunkHolderManager] Halted chunk system for world 'world'
[21:42:29 INFO]: [ChunkHolderManager] Saving all chunkholders for world 'world'
[21:42:29 INFO]: [ChunkHolderManager] Saved 49 block chunks, 49 entity chunks, 0 poi chunks in world 'world' in 0,19s
[21:42:29 INFO]: [ChunkHolderManager] Waiting 60s for chunk I/O to halt for world 'world'
[21:42:29 INFO]: [ChunkHolderManager] Halted I/O scheduler for world 'world'
[21:42:29 INFO]: Saving chunks for level 'ServerLevel[world_nether]'/minecraft:the_nether
[21:42:29 INFO]: [ChunkHolderManager] Waiting 60s for chunk system to halt for world 'world_nether'
[21:42:29 INFO]: [ChunkHolderManager] Halted chunk system for world 'world_nether'
[21:42:29 INFO]: [ChunkHolderManager] Saving all chunkholders for world 'world_nether'
[21:42:29 INFO]: [ChunkHolderManager] Saved 49 block chunks, 49 entity chunks, 0 poi chunks in world 'world_nether' in 0,08s
[21:42:29 INFO]: [ChunkHolderManager] Waiting 60s for chunk I/O to halt for world 'world_nether'
[21:42:29 INFO]: [ChunkHolderManager] Halted I/O scheduler for world 'world_nether'
[21:42:29 INFO]: Saving chunks for level 'ServerLevel[world_the_end]'/minecraft:the_end
[21:42:29 INFO]: [ChunkHolderManager] Waiting 60s for chunk system to halt for world 'world_the_end'
[21:42:29 INFO]: [ChunkHolderManager] Halted chunk system for world 'world_the_end'
[21:42:29 INFO]: [ChunkHolderManager] Saving all chunkholders for world 'world_the_end'
[21:42:29 INFO]: [ChunkHolderManager] Saved 49 block chunks, 49 entity chunks, 0 poi chunks in world 'world_the_end' in 0,04s
[21:42:29 INFO]: [ChunkHolderManager] Waiting 60s for chunk I/O to halt for world 'world_the_end'
[21:42:29 INFO]: [ChunkHolderManager] Halted I/O scheduler for world 'world_the_end'
[21:42:29 INFO]: ThreadedAnvilChunkStorage (world): All chunks are saved
[21:42:29 INFO]: ThreadedAnvilChunkStorage (DIM-1): All chunks are saved
[21:42:29 INFO]: ThreadedAnvilChunkStorage (DIM1): All chunks are saved
[21:42:29 INFO]: ThreadedAnvilChunkStorage: All dimensions are saved
[21:42:29 INFO]: Waiting for all RegionFile I/O tasks to complete...
[21:42:29 INFO]: All RegionFile I/O tasks to complete
[21:42:29 INFO]: [MoonriseCommon] Awaiting termination of worker pool for up to 60s...
[21:42:29 INFO]: [MoonriseCommon] Awaiting termination of I/O pool for up to 60s...

Plugin and Datapack List

> plugins
[21:43:46 INFO]: ℹ Server Plugins (0):

Actions to reproduce (if known)

  1. Copy any multi-line string into the clipboard, it isn't required to end with a line break, but must contain a line break somewhere inside of it. Example:
test command 1
test command 2
test command 3
test command 4
test command 5
  1. Paste it into the terminal console
  2. First, nothing happens, but when you press [Enter] the server crashes with the stack trace provided earlier

Paper version

> version
[21:43:59 INFO]: Checking version, please wait...
[21:44:00 INFO]: This server is running Paper version 1.21.8-42-main@b0da38c (2025-08-22T10:35:13Z) (Implementing API version 1.21.8-R0.1-SNAPSHOT)
You are running the latest version
Previous version: 1.21.8-4-aa4ef06 (MC: 1.21.8)

Other

No response

Activity

  1. added theissue type on Aug 22, 2025
  2. added a commit that references this issue on Aug 22, 2025
    4a0f535
  3. Lulu13022002 commented on Aug 22, 2025

    @Lulu13022002
    Contributor

    Known issue related to https://github.com/PaperMC/Paper/tree/fix/clickevent-edge-case there's a lot of way to crash the server that way, for example sending §§§ is enough for the server to die.

  4. metabrixkt commented on Aug 22, 2025

    @metabrixkt
    ContributorAuthor

    Known issue related to https://github.com/PaperMC/Paper/tree/fix/clickevent-edge-case there's a lot of way to crash the server that way, for example sending §§§ is enough for the server to die.

    Yeah, though it would be nice to at least be able to paste multiple commands at once until a proper solution is in place, which is why I made a separate PR just for this use case

  5. added
    status: acceptedDisputed bug is accepted as valid or Feature accepted as desired to be added.
    and removed on Aug 22, 2025
  6. Machine-Maker commented on Aug 23, 2025

    @Machine-Maker
    Member

    I think a better solution would be to just disallow the same characters in the console command that are disallowed in "chat strings". Would that cause issues for anyone?

  7. metabrixkt commented on Aug 23, 2025

    @metabrixkt
    ContributorAuthor

    I think a better solution would be to just disallow the same characters in the console command that are disallowed in "chat strings". Would that cause issues for anyone?

    I think a proper solution would be to still parse multi-line inputs as separate lines but then check each line for disallowed characters independently. Thoughts?

  8. added a commit that references this issue on Aug 23, 2025
    72fc851
  9. Lulu13022002 commented on Aug 27, 2025

    @Lulu13022002
    Contributor

    The only problem with checking disallowed characters in the whole input/splitted is then you can't use the section character in your message (for example /say "see §2.2 for something"), custom commands containing this character will also fail. But I'm not sure if it really matters for anyone since that character will not render for the client but it might be better to just check for the click event and skip it to not break anything.

  10. added 2 commits that reference this issue on Aug 31, 2025
    7b4eac0
    b9923b9
  11. added a commit that references this issue on Jul 26, 2026
    d53c148
  12. added a commit that references this issue on Oct 17, 2026
    e4e3f08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: acceptedDisputed bug is accepted as valid or Feature accepted as desired to be added.version: 1.21.8Game version 1.21.8

    Type

    Fields

    MC Issue

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions