V3 Economy cog bugs #1400

Closed
opened 2018-03-06 21:50:41 +01:00 by laggron42 · 5 comments
laggron42 commented 2018-03-06 21:50:41 +01:00 (Migrated from github.com)

Type:

  • Suggestion
  • Bug

We noticed there were a lot of problems and bugs with the new economy cog. It would be great if we can list all of them there (just comment) so we can fix all of that.

For myself, I found the following problems

  • credits name is not used in the commands (there may be a problem with saving)
  • no warning when switching bank between global and per-guild (that wipe all banks) thx @aikaterna for finding it
  • error when using [p]bank reset
Exception in command 'bank reset'
Traceback (most recent call last):
  File "/home/palm/redv3/lib/python3.5/site-packages/discord/ext/commands/core.py", line 62, in wrapped
    ret = yield from coro(*args, **kwargs)
  File "/home/palm/redv3/lib/python3.5/site-packages/redbot/cogs/economy/economy.py", line 227, in reset
    success = await bank.wipe_bank()
  File "/home/palm/redv3/lib/python3.5/site-packages/redbot/core/bank.py", line 285, in wipe_bank
    await _conf.clear_all_users()
  File "/home/palm/redv3/lib/python3.5/site-packages/redbot/core/config.py", line 1058, in clear_all_users
    await self._clear_scope(self.USER)
  File "/home/palm/redv3/lib/python3.5/site-packages/redbot/core/config.py", line 1011, in _clear_scope
    await group.clear()
  File "/home/palm/redv3/lib/python3.5/site-packages/redbot/core/config.py", line 153, in clear
    await self.driver.clear(*self.identifiers)
  File "/home/palm/redv3/lib/python3.5/site-packages/redbot/core/drivers/red_json.py", line 70, in clear
    del partial[identifiers[-1]]
KeyError: 'USER'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/palm/redv3/lib/python3.5/site-packages/discord/ext/commands/bot.py", line 886, in invoke
    yield from ctx.command.invoke(ctx)
  File "/home/palm/redv3/lib/python3.5/site-packages/discord/ext/commands/core.py", line 904, in invoke
    yield from ctx.invoked_subcommand.invoke(ctx)
  File "/home/palm/redv3/lib/python3.5/site-packages/discord/ext/commands/core.py", line 498, in invoke
    yield from injected(*ctx.args, **ctx.kwargs)
  File "/home/palm/redv3/lib/python3.5/site-packages/discord/ext/commands/core.py", line 71, in wrapped
    raise CommandInvokeError(e) from e
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: KeyError: 'USER'
  • error when using [p]bankset toggleglobal
Exception in command 'bankset toggleglobal'
Traceback (most recent call last):
  File "/home/palm/redv3/lib/python3.5/site-packages/discord/ext/commands/core.py", line 62, in wrapped
    ret = yield from coro(*args, **kwargs)
  File "/home/palm/redv3/lib/python3.5/site-packages/redbot/cogs/bank/bank.py", line 66, in bankset_toggleglobal
    await bank.set_global(not cur_setting)
  File "/home/palm/redv3/lib/python3.5/site-packages/redbot/core/bank.py", line 422, in set_global
    await _conf.clear_all_users()
  File "/home/palm/redv3/lib/python3.5/site-packages/redbot/core/config.py", line 1058, in clear_all_users
    await self._clear_scope(self.USER)
  File "/home/palm/redv3/lib/python3.5/site-packages/redbot/core/config.py", line 1011, in _clear_scope
    await group.clear()
  File "/home/palm/redv3/lib/python3.5/site-packages/redbot/core/config.py", line 153, in clear
    await self.driver.clear(*self.identifiers)
  File "/home/palm/redv3/lib/python3.5/site-packages/redbot/core/drivers/red_json.py", line 70, in clear
    del partial[identifiers[-1]]
KeyError: 'USER'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/palm/redv3/lib/python3.5/site-packages/discord/ext/commands/bot.py", line 886, in invoke
    yield from ctx.command.invoke(ctx)
  File "/home/palm/redv3/lib/python3.5/site-packages/discord/ext/commands/core.py", line 904, in invoke
    yield from ctx.invoked_subcommand.invoke(ctx)
  File "/home/palm/redv3/lib/python3.5/site-packages/discord/ext/commands/core.py", line 498, in invoke
    yield from injected(*ctx.args, **ctx.kwargs)
  File "/home/palm/redv3/lib/python3.5/site-packages/discord/ext/commands/core.py", line 71, in wrapped
    raise CommandInvokeError(e) from e
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: KeyError: 'USER'

thx @palmtree5 for finding the 2 last errors

If you have other errors or problem you found, please leave a comment

### Type: - [ ] Suggestion - [x] Bug We noticed there were a lot of problems and bugs with the new economy cog. It would be great if we can list all of them there (just comment) so we can fix all of that. For myself, I found the following problems - credits name is not used in the commands (there may be a problem with saving) - no warning when switching bank between global and per-guild (that wipe all banks) thx @aikaterna for finding it - error when using `[p]bank reset` ```Py Exception in command 'bank reset' Traceback (most recent call last): File "/home/palm/redv3/lib/python3.5/site-packages/discord/ext/commands/core.py", line 62, in wrapped ret = yield from coro(*args, **kwargs) File "/home/palm/redv3/lib/python3.5/site-packages/redbot/cogs/economy/economy.py", line 227, in reset success = await bank.wipe_bank() File "/home/palm/redv3/lib/python3.5/site-packages/redbot/core/bank.py", line 285, in wipe_bank await _conf.clear_all_users() File "/home/palm/redv3/lib/python3.5/site-packages/redbot/core/config.py", line 1058, in clear_all_users await self._clear_scope(self.USER) File "/home/palm/redv3/lib/python3.5/site-packages/redbot/core/config.py", line 1011, in _clear_scope await group.clear() File "/home/palm/redv3/lib/python3.5/site-packages/redbot/core/config.py", line 153, in clear await self.driver.clear(*self.identifiers) File "/home/palm/redv3/lib/python3.5/site-packages/redbot/core/drivers/red_json.py", line 70, in clear del partial[identifiers[-1]] KeyError: 'USER' The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/home/palm/redv3/lib/python3.5/site-packages/discord/ext/commands/bot.py", line 886, in invoke yield from ctx.command.invoke(ctx) File "/home/palm/redv3/lib/python3.5/site-packages/discord/ext/commands/core.py", line 904, in invoke yield from ctx.invoked_subcommand.invoke(ctx) File "/home/palm/redv3/lib/python3.5/site-packages/discord/ext/commands/core.py", line 498, in invoke yield from injected(*ctx.args, **ctx.kwargs) File "/home/palm/redv3/lib/python3.5/site-packages/discord/ext/commands/core.py", line 71, in wrapped raise CommandInvokeError(e) from e discord.ext.commands.errors.CommandInvokeError: Command raised an exception: KeyError: 'USER' ``` - error when using `[p]bankset toggleglobal` ```Py Exception in command 'bankset toggleglobal' Traceback (most recent call last): File "/home/palm/redv3/lib/python3.5/site-packages/discord/ext/commands/core.py", line 62, in wrapped ret = yield from coro(*args, **kwargs) File "/home/palm/redv3/lib/python3.5/site-packages/redbot/cogs/bank/bank.py", line 66, in bankset_toggleglobal await bank.set_global(not cur_setting) File "/home/palm/redv3/lib/python3.5/site-packages/redbot/core/bank.py", line 422, in set_global await _conf.clear_all_users() File "/home/palm/redv3/lib/python3.5/site-packages/redbot/core/config.py", line 1058, in clear_all_users await self._clear_scope(self.USER) File "/home/palm/redv3/lib/python3.5/site-packages/redbot/core/config.py", line 1011, in _clear_scope await group.clear() File "/home/palm/redv3/lib/python3.5/site-packages/redbot/core/config.py", line 153, in clear await self.driver.clear(*self.identifiers) File "/home/palm/redv3/lib/python3.5/site-packages/redbot/core/drivers/red_json.py", line 70, in clear del partial[identifiers[-1]] KeyError: 'USER' The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/home/palm/redv3/lib/python3.5/site-packages/discord/ext/commands/bot.py", line 886, in invoke yield from ctx.command.invoke(ctx) File "/home/palm/redv3/lib/python3.5/site-packages/discord/ext/commands/core.py", line 904, in invoke yield from ctx.invoked_subcommand.invoke(ctx) File "/home/palm/redv3/lib/python3.5/site-packages/discord/ext/commands/core.py", line 498, in invoke yield from injected(*ctx.args, **ctx.kwargs) File "/home/palm/redv3/lib/python3.5/site-packages/discord/ext/commands/core.py", line 71, in wrapped raise CommandInvokeError(e) from e discord.ext.commands.errors.CommandInvokeError: Command raised an exception: KeyError: 'USER' ``` thx @palmtree5 for finding the 2 last errors If you have other errors or problem you found, please leave a comment
tekulvw commented 2018-03-06 21:58:57 +01:00 (Migrated from github.com)

The reset and toggle global bugs should have both been fixed with #1374

The reset and toggle global bugs should have both been fixed with #1374
tekulvw commented 2018-03-13 00:07:16 +01:00 (Migrated from github.com)

What do you mean by "credits name is not used in the commands"?

All other bugs have been fixed.

What do you mean by "credits name is not used in the commands"? All other bugs have been fixed.
laggron42 commented 2018-03-14 23:54:44 +01:00 (Migrated from github.com)

I noticed that it was actually due to the recent switch (I set the bank global just after changing the name, so it was removed without warning (which is also fixed in aikaterna's PR))

I noticed that it was actually due to the recent switch (I set the bank global just after changing the name, so it was removed without warning (which is also fixed in aikaterna's PR))
tekulvw commented 2018-03-14 23:56:19 +01:00 (Migrated from github.com)

So are all the issues here fixed?

So are all the issues here fixed?
laggron42 commented 2018-03-15 07:25:15 +01:00 (Migrated from github.com)

All the known issues are fixed yeah.

All the known issues are fixed yeah.
Sign in to join this conversation.
No labels
Automated PR
Blocked
Blocked By: Damage Control
Blocked By: Dependency
Blocked By: Other PR
Breaking Change
Category: CI
Category: Cogs - Admin
Category: Cogs - Alias
Category: Cogs - Audio
Category: Cogs - Bank
Category: Cogs - Cleanup
Category: Cogs - CustomCommands
Category: Cogs - Dev
Category: Cogs - Downloader
Category: Cogs - Economy
Category: Cogs - Filter
Category: Cogs - General
Category: Cogs - Image
Category: Cogs - Mod
Category: Cogs - Modlog
Category: Cogs - Mutes
Category: Cogs - Permissions
Category: Cogs - Reports
Category: Cogs - Streams
Category: Cogs - Trivia
Category: Cogs - Trivia - Lists
Category: Cogs - Warnings
Category: Core - API - App Commands Package
Category: Core - API - Audio
Category: Core - API - Bank
Category: Core - API - Commands Package
Category: Core - API - Config
Category: Core - API - Other
Category: Core - API - Utils Package
Category: Core - Bot Class
Category: Core - Bot Commands
Category: Core - Command-line Interfaces
Category: Core - Downloader
Category: Core - Help
Category: Core - i18n
Category: Core - Modlog
Category: Core - Other Internals
Category: Core - RPC/ZMQ
Category: Docker
Category: Docs - Changelogs
Category: Docs - For Developers
Category: Docs - Install Guides
Category: Docs - Other
Category: Docs - User Guides
Category: Meta
Category: RPC/ZMQ methods
Category: Vendored Packages
Changelog Entry: Added
Changelog Entry: Pending
Changelog Entry: Skipped
Closed: Duplicate
Closed: External
Closed: Invalid
Closed: User Error
Closed: Won't Fix
Complex Issue
Docs-only
Feature Branch
Good First Issue
Help Wanted
High Priority
Needs Backport To stable-docs
No Activity
No Repro
QA: Bypassed
QA: Changes Requested
QA: Passed
Release Blocker
Status: Accepted
Status: Frozen
Status: In Progress
Status: Needs Discussion
Status: Needs Info
Status: Needs Triage
Status: PRs Welcome
Type: Bug
Type: Dependency Update
Type: Deprecation
Type: Enhancement
Type: Feature
Type: Informational
Type: Merge
Type: Optimisation
Type: Question
Type: Removal
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Mrcoolgamer11/Red-DiscordBot#1400
No description provided.