GatekeeperV2 icon indicating copy to clipboard operation
GatekeeperV2 copied to clipboard

bug: Command 'add' raised an exception: AttributeError: 'NoneType' object has no attribute 'InstanceName'

Open halkeye opened this issue 1 year ago • 4 comments

Information [REQUIRED]

Which Server Type?

Core Keeper

Which Platform?

Amp, Linux, Docker

Describe the bug

Ran

/bot bannergroup add group_name:Core Keeper channel:#corekeeper server:CoreKeeper | ID: e3382f72-8261-43b9-b75c-fdff94f3804e

Got image

The application did not respond

looking at console log,

20:16:39

01/02/2025 04:16:39 AM [Gatekeeper] [ERROR]  We ran into an issue. Hybrid command raised an error: Command 'add' raised an exception: AttributeError: 'NoneType' object has no attribute 'InstanceName'
Traceback (most recent call last):
  File "/AMP/gatekeeperv2/venv/lib/python3.11/site-packages/discord/app_commands/commands.py", line 857, in _do_call
    return await self._callback(self.binding, interaction, **params)  # type: ignore
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/AMP/gatekeeperv2/GatekeeperV2-main/cogs/banner_cog.py", line 395, in banner_group_add
    return await context.send(content=f"""It appears that {f' `{db_server.InstanceName}`'if server != None else ''}{' and 'if server != None and channel != None else ''}{channel.mention if channel != None else ''} already exists for **{group_name}**, please try again.""", ephemeral=True, delete_after=self._client.Message_Timeout)
                                                                ^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'InstanceName'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "/AMP/gatekeeperv2/venv/lib/python3.11/site-packages/discord/ext/commands/hybrid.py", line 444, in _invoke_with_namespace
    value = await self._do_call(ctx, ctx.kwargs)  # type: ignore
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/AMP/gatekeeperv2/venv/lib/python3.11/site-packages/discord/app_commands/commands.py", line 876, in _do_call
    raise CommandInvokeError(self, e) from e
discord.app_commands.errors.CommandInvokeError: Command 'add' raised an exception: AttributeError: 'NoneType' object has no attribute 'InstanceName'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "/AMP/gatekeeperv2/venv/lib/python3.11/site-packages/discord/ext/commands/hybrid.py", line 444, in _invoke_with_namespace
    value = await self._do_call(ctx, ctx.kwargs)  # type: ignore
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/AMP/gatekeeperv2/venv/lib/python3.11/site-packages/discord/app_commands/commands.py", line 876, in _do_call
    raise CommandInvokeError(self, e) from e
discord.ext.commands.errors.HybridCommandError: Hybrid command raised an error: Command 'add' raised an exception: AttributeError: 'NoneType' object has no attribute 'InstanceName'

halkeye avatar Jan 02 '25 04:01 halkeye

Hello, But did you try to make a banner for displaying the Gatekeeper Instance status? Because that will def fail as the bot doesn't get added to the Database as an Instance.

k8thekat avatar Jan 07 '25 21:01 k8thekat

I don't think so. I was trying to do core keeper. Is there a way to increase logging or dump the db?

halkeye avatar Jan 08 '25 03:01 halkeye

IDK what Core Keeper is, is it a game server? Another discord Bot?

k8thekat avatar Jan 08 '25 14:01 k8thekat

yea, game server. I'm on the wrong computer to login and take a screenshot, but its one of the supported ones.

halkeye avatar Jan 08 '25 18:01 halkeye