thomst08 / requestrr

Requestrr is a chatbot used to simplify using services like Sonarr/Radarr/Lidarr/Ombi/Overseerr via the use of chat. Current platform is Discord only, but the bot was built around the ideology of quick adaptation for new features as well as new platforms.
MIT License
241 stars 17 forks source link

[Bug] Duplicate category names causes bot start to fail #17

Closed TheColorman closed 8 months ago

TheColorman commented 8 months ago

See this comment for the diagnosed problem:

Issue stemmed from having multiple categories with the same name across Radarr and Sonarr. Making sure no category name was repeated twice fixed the issue (e.g. don't have an anime category in both the Radarr and Sonarr configs).

Original post:

When I start the bot (running in a Docker container) I get the following error:

requestrr  | [2024-02-29 12:46:30 +00:00] [0   /            ] [Crit ] There was an error registering application commands: Invalid Form Body
requestrr  | DSharpPlus.Exceptions.BadRequestException: Bad request: 400
requestrr  |    at DSharpPlus.Net.DiscordApiClient.BulkOverwriteGuildApplicationCommandsAsync(UInt64 application_id, UInt64 guild_id, IEnumerable`1 commands)
requestrr  |    at DSharpPlus.SlashCommands.SlashCommandsExtension.<>c__DisplayClass39_0.<<RegisterCommands>b__0>d.MoveNext()

It has registered slash commands (probably from first boot?), but using any of them results in "The application did not respond", with no activity in the logs.

Only network settings I have set up is that DNS is routed through Pihole, running in an adjacent container. None of my other container have network connectivity problems with my routing setup. docker-compose.yaml:

version: "3.4"
services:
  requestrr:
    image: thomst08/requestrr
    hostname: requestrr
    container_name: requestrr
    ports:
    - 4545:4545
    volumes:
    - ./config:/root/config
    restart: unless-stopped
    dns:
      - 192.168.50.58 # private IP of the raspberry pi hosting both Pihole and requestrr. I also use this setup in other containers.

I have no custom language files. This is from a clean install right after setting up Radarr and Sonarr connections.

Running requestrr 2.1.5

thomst08 commented 8 months ago

Hey @TheColorman, Sorry for the late reply on this issue, I believe this might be linked to the issue #9, but I will test it to find out. Thank you for the detailed information, that gives me something to work with. I will let you know when I have something.

TheColorman commented 8 months ago

Tried to debug a bit on Windows on a dev server, but now I'm not seeing the issue...

TheColorman commented 8 months ago

also don't get the error when starting a container with the exact same compose.yaml on my dev pc. Could it have something to do with the arm architecture?

TheColorman commented 8 months ago

Tried to build it in a container: Dockerfile

FROM mcr.microsoft.com/dotnet/sdk:6.0-alpine

RUN apk add --no-cache \
    git \
    npm

RUN git clone https://github.com/thomst08/requestrr.git /app

WORKDIR /app/Requestrr.WebApi/ClientApp

RUN npm install
RUN npm run build

WORKDIR /app/Requestrr.WebApi

RUN dotnet publish -c release -o publish

WORKDIR /app/Requestrr.WebApi/publish

ENTRYPOINT [ "dotnet", "Requestrr.WebApi.dll" ]

compose.yaml

version: "3.4"
services:
  requestrr:
    build: .
    hostname: requestrr
    container_name: requestrr
    ports:
    - 4545:4545
    volumes:
    - ./config:/app/Requestrr.WebApi/publish/config
    restart: unless-stopped

Again, worked just fine on my PC, but I get the application command error on my raspberry pi.

TheColorman commented 8 months ago

Issue fixed itself, so apparently it was Discords fault.

TheColorman commented 8 months ago

It was not Discords fault :)

TheColorman commented 8 months ago

Issue stemmed from having multiple categories with the same name across Radarr and Sonarr. Making sure no category name was repeated twice fixed the issue (e.g. don't have an anime category in both the Radarr and Sonarr configs).

thomst08 commented 8 months ago

As discussed on Discord, Requestrr does not check for unique category names across movies and tv shows, this will need to be corrected in an update to stop from duplicates happening, if this occurs it will cause the slash commands to fail during setup.

I will add this check in a future update.

thomst08 commented 8 months ago

Hey @TheColorman,

I have just release version 2.1.6, this contains a check for duplicate slash commands. This will stop the bot from building the commands before sending them to Discords API, it shows an error in the logs about this issue. I have also updated the webapp to show feedback when the user enters the same category name as another service, eg, tv vs movies.

As far as I can see, this issue should now be resolved, I will mark this as closed. :)