27rogi / Fabric2Discord

šŸ¤ Link your Fabric server and Discord with ease!
GNU Lesser General Public License v3.0
13 stars 3 forks source link

Error on Server Start #31

Closed tomozbot closed 6 months ago

tomozbot commented 1 year ago

When the server starts the following error is thrown:

[21:08:08] [DefaultDispatcher-worker-3/ERROR]: Uncaught exception in thread "DefaultDispatcher-worker-3"
kotlinx.serialization.SerializationException: descriptor for kotlin.String was not nullable but null mark was encountered
    at dev.kord.common.entity.optional.Optional$OptionalSerializer.deserialize(Optional.kt:164) ~[f2d-2.3.0+1.20.x.jar:?]
    at dev.kord.common.entity.optional.Optional$OptionalSerializer.deserialize(Optional.kt:155) ~[f2d-2.3.0+1.20.x.jar:?]
    at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:70) ~[org_jetbrains_kotlinx_kotlinx-sen-jvm-1.5.1-795811f38d13c720.jar:?]
    at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableValue(AbstractDecoder.kt:43) ~[org_jetbrains_kotlinx_kotlinx-see-jvm-1.5.1-a7135ab57b637972.jar:?]
    at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableElement(AbstractDecoder.kt:70) ~[org_jetbrains_kotlinx_kotlinx-see-jvm-1.5.1-a7135ab57b637972.jar:?]
    at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableElement(StreamingJsonDecoder.kt:165) ~[org_jetbrains_kotlinx_kotlinx-sen-jvm-1.5.1-795811f38d13c720.jar:?]
    at dev.kord.common.entity.DiscordEmbed$Author$$serializer.deserialize(DiscordMessage.kt:670) ~[f2d-2.3.0+1.20.x.jar:?]
    at dev.kord.common.entity.DiscordEmbed$Author$$serializer.deserialize(DiscordMessage.kt:670) ~[f2d-2.3.0+1.20.x.jar:?]
    at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:70) ~[org_jetbrains_kotlinx_kotlinx-sen-jvm-1.5.1-795811f38d13c720.jar:?]
    at dev.kord.common.entity.optional.Optional$OptionalSerializer.deserialize(Optional.kt:177) ~[f2d-2.3.0+1.20.x.jar:?]
    at dev.kord.common.entity.optional.Optional$OptionalSerializer.deserialize(Optional.kt:155) ~[f2d-2.3.0+1.20.x.jar:?]
    at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:70) ~[org_jetbrains_kotlinx_kotlinx-sen-jvm-1.5.1-795811f38d13c720.jar:?]
    at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableValue(AbstractDecoder.kt:43) ~[org_jetbrains_kotlinx_kotlinx-see-jvm-1.5.1-a7135ab57b637972.jar:?]
    at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableElement(AbstractDecoder.kt:70) ~[org_jetbrains_kotlinx_kotlinx-see-jvm-1.5.1-a7135ab57b637972.jar:?]
    at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableElement(StreamingJsonDecoder.kt:165) ~[org_jetbrains_kotlinx_kotlinx-sen-jvm-1.5.1-795811f38d13c720.jar:?]
    at dev.kord.common.entity.DiscordEmbed$$serializer.deserialize(DiscordMessage.kt:569) ~[f2d-2.3.0+1.20.x.jar:?]
    at dev.kord.common.entity.DiscordEmbed$$serializer.deserialize(DiscordMessage.kt:569) ~[f2d-2.3.0+1.20.x.jar:?]
    at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:70) ~[org_jetbrains_kotlinx_kotlinx-sen-jvm-1.5.1-795811f38d13c720.jar:?]
    at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableValue(AbstractDecoder.kt:43) ~[org_jetbrains_kotlinx_kotlinx-see-jvm-1.5.1-a7135ab57b637972.jar:?]
    at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableElement(AbstractDecoder.kt:70) ~[org_jetbrains_kotlinx_kotlinx-see-jvm-1.5.1-a7135ab57b637972.jar:?]
    at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableElement(StreamingJsonDecoder.kt:165) ~[org_jetbrains_kotlinx_kotlinx-sen-jvm-1.5.1-795811f38d13c720.jar:?]
    at kotlinx.serialization.encoding.CompositeDecoder$DefaultImpls.decodeSerializableElement$default(Decoding.kt:533) ~[org_jetbrains_kotlinx_kotlinx-see-jvm-1.5.1-a7135ab57b637972.jar:?]
    at kotlinx.serialization.internal.CollectionLikeSerializer.readElement(CollectionSerializers.kt:80) ~[org_jetbrains_kotlinx_kotlinx-see-jvm-1.5.1-a7135ab57b637972.jar:?]
    at kotlinx.serialization.internal.AbstractCollectionSerializer.readElement$default(CollectionSerializers.kt:51) ~[org_jetbrains_kotlinx_kotlinx-see-jvm-1.5.1-a7135ab57b637972.jar:?]
    at kotlinx.serialization.internal.AbstractCollectionSerializer.merge(CollectionSerializers.kt:36) ~[org_jetbrains_kotlinx_kotlinx-see-jvm-1.5.1-a7135ab57b637972.jar:?]
    at kotlinx.serialization.internal.AbstractCollectionSerializer.deserialize(CollectionSerializers.kt:43) ~[org_jetbrains_kotlinx_kotlinx-see-jvm-1.5.1-a7135ab57b637972.jar:?]
    at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:70) ~[org_jetbrains_kotlinx_kotlinx-sen-jvm-1.5.1-795811f38d13c720.jar:?]
    at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableValue(AbstractDecoder.kt:43) ~[org_jetbrains_kotlinx_kotlinx-see-jvm-1.5.1-a7135ab57b637972.jar:?]
    at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableElement(AbstractDecoder.kt:70) ~[org_jetbrains_kotlinx_kotlinx-see-jvm-1.5.1-a7135ab57b637972.jar:?]
    at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableElement(StreamingJsonDecoder.kt:165) ~[org_jetbrains_kotlinx_kotlinx-sen-jvm-1.5.1-795811f38d13c720.jar:?]
    at dev.kord.common.entity.DiscordMessage$$serializer.deserialize(DiscordMessage.kt:164) ~[f2d-2.3.0+1.20.x.jar:?]
    at dev.kord.common.entity.DiscordMessage$$serializer.deserialize(DiscordMessage.kt:164) ~[f2d-2.3.0+1.20.x.jar:?]
    at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:70) ~[org_jetbrains_kotlinx_kotlinx-sen-jvm-1.5.1-795811f38d13c720.jar:?]
    at kotlinx.serialization.json.Json.decodeFromString(Json.kt:107) ~[org_jetbrains_kotlinx_kotlinx-sen-jvm-1.5.1-795811f38d13c720.jar:?]
    at dev.kord.rest.route.ValueJsonMapper.deserialize(Route.kt:24) ~[f2d-2.3.0+1.20.x.jar:?]
    at dev.kord.rest.request.KtorRequestHandler.handle(KtorRequestHandler.kt:68) ~[f2d-2.3.0+1.20.x.jar:?]
    at dev.kord.rest.request.KtorRequestHandler$handle$1.invokeSuspend(KtorRequestHandler.kt) ~[f2d-2.3.0+1.20.x.jar:?]
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) ~[org_jetbrains_kotlin_kotlin-stdlib-1.8.22-b3eebd347af2cde2.jar:?]
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) ~[org_jetbrains_kotlinx_kotlinx-coe-jvm-1.7.1-d2fa1ba1e2a4653e.jar:?]
    at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:115) ~[org_jetbrains_kotlinx_kotlinx-coe-jvm-1.7.1-d2fa1ba1e2a4653e.jar:?]
    at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:100) ~[org_jetbrains_kotlinx_kotlinx-coe-jvm-1.7.1-d2fa1ba1e2a4653e.jar:?]
    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584) ~[org_jetbrains_kotlinx_kotlinx-coe-jvm-1.7.1-d2fa1ba1e2a4653e.jar:?]
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793) ~[org_jetbrains_kotlinx_kotlinx-coe-jvm-1.7.1-d2fa1ba1e2a4653e.jar:?]
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697) ~[org_jetbrains_kotlinx_kotlinx-coe-jvm-1.7.1-d2fa1ba1e2a4653e.jar:?]
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684) ~[org_jetbrains_kotlinx_kotlinx-coe-jvm-1.7.1-d2fa1ba1e2a4653e.jar:?]
    Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException

The bot sends a server started message, then all further messages are not sent to the discord channel. Messages from discord to the server are unaffected.

27rogi commented 1 year ago

Can you provide a config file?

tomozbot commented 1 year ago

Sure:

# Do not touch this value, it allows mod to check if config file is outdated or not.
configVersion=2
# Thanks for using Fabric2Discord!
# The configuration might look very complicated, so I made a simple WIKI to help you:
# https://github.com/rogi27/Fabric2Discord/wiki/Introduction
# 
# Since this plugin has a close bound with Placeholder API you might want to check it's WIKI:
# https://placeholders.pb4.eu/
general {
    # Here you specify ids for mod to work, setting value to 0 disables the feature
    ids {
        # Snowflake (id) of the channel used to link Discord and Minecraft messages
        # More on https://github.com/rogi27/Fabric2Discord/wiki/Getting-Started#basic-setup=
        chatChannel=[Hidden]
        # Snowflake (id) of the channel used for join, leave, death and etc. messages
        # More on https://github.com/rogi27/Fabric2Discord/wiki/Getting-Started#basic-setup=
        logChannel=[Hidden]
        # Snowflake (id) of the webhook used to send Minecraft messages using player data
        # Using -1 as parameter will result in creation of new webhook 
        # Using 0 as parameter will result in disabling webhook functionality 
        # More on https://github.com/rogi27/Fabric2Discord/wiki/Getting-Started#connecting-webhook=
        webhook=[Hidden]
    }
    # Here you can enable custom bot statuses
    status {
        # Action type, variants: PLAYING, COMPETING, LISTENING, STREAMING
        action=LISTENING
        # Enables or disables this feature
        enabled=true
        # Status update interval in minutes (min = 1, max = 120)
        interval=1
        # Status type, variants: ONLINE, IDLE, DO_NOT_DISTURB, INVISIBLE, OFFLINE
        type=ONLINE
        # Status variants, chosen randomly.
        # Supports SERVER placeholders
        variants=[
            "%server:online% players online"
        ]
    }
    # Your token should be here, check https://github.com/rogi27/Fabric2Discord/wiki/Getting-Started#connecting-webhook=
    token="[Hidden]"
}
# You can toggle and customize messages that are being sent
# More on https://github.com/rogi27/Fabric2Discord/wiki/Messages
messages {
    # Message that will be sent to chat channel after player sent message in chat
    # Custom placeholders: %message%
    # Supports PLAYER placeholders
    chatMessage {
        color="#b6bdd0"
        enabled=true
        footer=""
        header="%player:name%"
        iconFooter=""
        iconHeader="https://minotar.net/armor/bust/%player:name%/100.png"
        image=""
        message="%message%"
        timestamp=false
    }
    # Formatting for messages from Discord
    # Custom placeholders: %discord_user%, %discord_tag%
    # Supports SERVER placeholders
    format="[<color:7289da>Discord</color>] %discord_user%<gray>#%discord_tag%</gray>: "
    # Formatting for attachments from Discord (merged with `format`)
    # Custom placeholders: %attachment_url%, %attachment_name%
    # Supports SERVER placeholders
    formattedAttachment="<blue><url:'%attachment_url%'>[%attachment_name%]</url></blue>"
    # Message that will be sent to logs channel when player gets and advancement
    # Custom placeholders: %advancement_name%, %advancement_description%, %advancement_id%
    # Supports PLAYER placeholders
    # To broadcast advancements even when 'announceAdvancements' rule is disabled be sure to enable 'ignoreGamerule'
    playerAdvancement {
        color="#ffff66"
        enabled=true
        footer=""
        header="%player:name% has made the advancement %advancement_name%"
        iconFooter=""
        iconHeader=""
        ignoreGamerule=true
        image=""
        message="%advancement_description%"
        timestamp=false
    }
    # Message that will be sent to logs channel when player dies
    # Custom placeholders: %death_by%, %death_message%
    # Supports PLAYER placeholders
    playerDeath {
        color="#696969"
        enabled=true
        footer=""
        header="%death_message%"
        iconFooter=""
        iconHeader=""
        image="https://minotar.net/cube/%player:uuid%/32.png"
        message=""
        timestamp=false
    }
    # Message that will be sent to logs channel after player teleported to another dimension
    # Custom placeholders: %world_origin%, %world_origin_id%
    # Supports PLAYER placeholders
    playerDimension {
        color="#b967ff"
        enabled=false
        footer="Previous location is %world_origin%"
        header="%player:name% has teleported to %player:world%"
        iconFooter=""
        iconHeader="https://minotar.net/cube/%player:name%/100.png"
        image=""
        message=""
        timestamp=false
    }
    # Message that will be sent to logs channel after player connected
    # Supports PLAYER placeholders
    playerJoin {
        color="#4ae485"
        enabled=true
        footer=""
        header="%player:name% joined the game"
        iconFooter=""
        iconHeader="https://minotar.net/cube/%player:name%/100.png"
        image=""
        message=""
        timestamp=false
    }
    # Message that will be sent to logs channel after player disconnected
    # Custom placeholders: %leave_reason%
    # Supports PLAYER placeholders
    playerLeave {
        color="#FF2337"
        enabled=true
        footer=""
        header="%player:name% left the game"
        iconFooter=""
        iconHeader="https://minotar.net/cube/%player:name%/100.png"
        image=""
        message=""
        timestamp=false
    }
    # Message that will be sent to logs channel after server world is loaded
    # Supports SERVER placeholders
    serverStart {
        color="#4ae485"
        enabled=true
        footer=""
        header=":white_check_mark: Server started!"
        iconFooter=""
        iconHeader=""
        image=""
        message="It's %world:time% (day %world:day%) in the overworld."
        timestamp=true
    }
    # Message that will be sent to logs channel before shutdown
    # Supports SERVER placeholders
    serverStop {
        color="#FF2337"
        enabled=true
        footer=""
        header=":stop_sign: Server stopped!"
        iconFooter=""
        iconHeader=""
        image=""
        message="Please ping the owner if you believe this is not intentional."
        timestamp=true
    }
}
27rogi commented 1 year ago

Please format your message using markdown code using ```YML <text>```

tomozbot commented 1 year ago

Sorry, not too familiar with GitHub stuff. Figured there was probably a way to format it correctly but didn't know what. Should be good now.

27rogi commented 1 year ago

Thanks, looks like your config isn't changed that much. I tested this mod on 1.20 and had no issues like that with default config settings. Maybe you are missing some bot permissions? Anyways, I will try to reproduce this error when I can.