GeyserMC / GeyserDiscordBot

A bot for the GeyserMC Discord server

Home Page:https://geysermc.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

IllegalArgumentException: Cannot create file when running in docker container

sentry-io opened this issue · comments

Sentry Issue: GEYSERDISCORDBOT-4G

IOException: Permission denied
    at java.io.UnixFileSystem.createFileExclusively(UnixFileSystem.java)
    at java.io.File.createNewFile(File.java:1043)
    at net.dv8tion.jda.api.entities.Message$Attachment.downloadToFile(Message.java:2492)
    at net.dv8tion.jda.api.entities.Message$Attachment.downloadToFile(Message.java:2450)
    at net.dv8tion.jda.api.entities.Message$Attachment.downloadToFile(Message.java:2411)
...
(20 additional frame(s) were not displayed)

IllegalArgumentException: Cannot create file
    at net.dv8tion.jda.api.entities.Message$Attachment.downloadToFile(Message.java:2498)
    at net.dv8tion.jda.api.entities.Message$Attachment.downloadToFile(Message.java:2450)
    at net.dv8tion.jda.api.entities.Message$Attachment.downloadToFile(Message.java:2411)
    at org.geysermc.discordbot.listeners.FileHandler.onMessageReceived(FileHandler.java:85)
    at net.dv8tion.jda.api.hooks.ListenerAdapter.onEvent(ListenerAdapter.java:424)
...
(18 additional frame(s) were not displayed)

One of the EventListeners had an uncaught exception

Likely just need to set a temp dir and set the correct permissions on it

Fixed in dda5f09