Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
TheColorman opened this issue Feb 29, 2024 · 9 comments
Closed

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

TheColorman opened this issue Feb 29, 2024 · 9 comments
Labels
bug Something isn't working

Comments

@TheColorman
Copy link

TheColorman commented Feb 29, 2024

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
Copy link
Owner

thomst08 commented Mar 2, 2024

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
Copy link
Author

TheColorman commented Mar 3, 2024

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

@TheColorman
Copy link
Author

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
Copy link
Author

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
Copy link
Author

Issue fixed itself, so apparently it was Discords fault.

@TheColorman
Copy link
Author

It was not Discords fault :)

@TheColorman TheColorman reopened this Mar 10, 2024
@TheColorman TheColorman changed the title [Crit] There was an error registering application commands: Invalid Form Body [Bug] Duplicate category names causes bot start to fail Mar 10, 2024
@TheColorman
Copy link
Author

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
Copy link
Owner

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 thomst08 added the bug Something isn't working label Mar 10, 2024
@thomst08
Copy link
Owner

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. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants