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

[V3 Config] Overflow error #2091

Closed
Zephyrkul opened this issue Sep 3, 2018 · 2 comments
Closed

[V3 Config] Overflow error #2091

Zephyrkul opened this issue Sep 3, 2018 · 2 comments
Labels
Closed: Won't Fix It's supposed to be this way or we're not interested in fixing this. There's probably a good reason. Type: Bug Unexpected behavior, result, or exception. In case of PRs, it is a fix for the foregoing.

Comments

@Zephyrkul
Copy link
Contributor

Zephyrkul commented Sep 3, 2018

Other bugs

What were you trying to do?

bank set <some integer greater than 2^63-1>

What were you expecting to happen?

The credits to be set to the specified integer.

What actually happened?

ERROR events on_command_error 205: Exception in command 'bank set'
Traceback (most recent call last):
  File "/home/zephyrkul/.pyenv/versions/red/lib/python3.7/site-packages/discord/ext/commands/core.py", line 61, in wrapped
    ret = await coro(*args, **kwargs)
  File "/home/zephyrkul/.pyenv/versions/3.7.0/envs/red/lib/python3.7/site-packages/redbot/cogs/economy/economy.py", line 206, in _set
    await bank.set_balance(to, creds.sum)
  File "/home/zephyrkul/.pyenv/versions/red/lib/python3.7/site-packages/redbot/core/bank.py", line 181, in set_balance
    await group.balance.set(amount)
  File "/home/zephyrkul/.pyenv/versions/red/lib/python3.7/site-packages/redbot/core/config.py", line 152, in set
    await self.driver.set(*self.identifiers, value=value)
  File "/home/zephyrkul/.pyenv/versions/red/lib/python3.7/site-packages/redbot/core/drivers/red_mongo.py", line 95, in set
    upsert=True,
  File "/home/zephyrkul/.pyenv/versions/3.7.0/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/zephyrkul/.pyenv/versions/red/lib/python3.7/site-packages/pymongo/collection.py", line 995, in update_one
    session=session),
  File "/home/zephyrkul/.pyenv/versions/red/lib/python3.7/site-packages/pymongo/collection.py", line 851, in _update_retryable
    _update, session)
  File "/home/zephyrkul/.pyenv/versions/red/lib/python3.7/site-packages/pymongo/mongo_client.py", line 1243, in _retryable_write
    return self._retry_with_session(retryable, func, s, None)
  File "/home/zephyrkul/.pyenv/versions/red/lib/python3.7/site-packages/pymongo/mongo_client.py", line 1196, in _retry_with_session
    return func(session, sock_info, retryable)
  File "/home/zephyrkul/.pyenv/versions/red/lib/python3.7/site-packages/pymongo/collection.py", line 847, in _update
    retryable_write=retryable_write)
  File "/home/zephyrkul/.pyenv/versions/red/lib/python3.7/site-packages/pymongo/collection.py", line 817, in _update
    retryable_write=retryable_write).copy()
  File "/home/zephyrkul/.pyenv/versions/red/lib/python3.7/site-packages/pymongo/pool.py", line 584, in command
    self._raise_connection_failure(error)
  File "/home/zephyrkul/.pyenv/versions/red/lib/python3.7/site-packages/pymongo/pool.py", line 745, in _raise_connection_failure
    raise error
  File "/home/zephyrkul/.pyenv/versions/red/lib/python3.7/site-packages/pymongo/pool.py", line 579, in command
    unacknowledged=unacknowledged)
  File "/home/zephyrkul/.pyenv/versions/red/lib/python3.7/site-packages/pymongo/network.py", line 114, in command
    codec_options, ctx=compression_ctx)
  File "/home/zephyrkul/.pyenv/versions/red/lib/python3.7/site-packages/pymongo/message.py", line 679, in _op_msg
    flags, command, identifier, docs, check_keys, opts)
OverflowError: MongoDB can only handle up to 8-byte ints

How can we reproduce this issue?

Have a mongodb backend and store a config value larger than 2^63-1 (9223372036854775807).

@palmtree5 palmtree5 added Type: Bug Unexpected behavior, result, or exception. In case of PRs, it is a fix for the foregoing. V3 labels Sep 3, 2018
@Zephyrkul Zephyrkul changed the title [V3 Economy] Overflow error [V3 Config] Overflow error Sep 4, 2018
@Tobotimus Tobotimus added this to the RC 1 milestone Sep 7, 2018
@Tobotimus Tobotimus added Category: Docs - Other This is related to documentation that doesn't have its dedicated label. Status: Accepted We want this and removed Category: Docs - Other This is related to documentation that doesn't have its dedicated label. labels Sep 7, 2018
@Tobotimus Tobotimus modified the milestones: RC 1, RC 2 Oct 1, 2018
Tobotimus added a commit to Tobotimus/Red-DiscordBot that referenced this issue Oct 9, 2018
Resolves Cog-Creators#2091.

This doesn't fix every OverflowError with MongoDB; but at least the seemingly easiest one to achieve with core cogs.

Signed-off-by: Toby Harradine <[email protected]>
@Tobotimus Tobotimus added Status: In Progress There's a PR open to deal with this, or an org member is working on this internally and removed Status: Accepted We want this labels Oct 9, 2018
Tobotimus added a commit that referenced this issue Oct 15, 2018
Resolves #2091.

This doesn't fix every OverflowError with MongoDB; but at least the seemingly easiest one to achieve with core cogs.

Signed-off-by: Toby Harradine <[email protected]>
@Tobotimus
Copy link
Member

Mostly resolved by #2211, but this can stay open until we actually put a safeguard in config for this.

@Tobotimus Tobotimus added Status: Accepted We want this and removed Status: In Progress There's a PR open to deal with this, or an org member is working on this internally labels Oct 15, 2018
@Tobotimus Tobotimus removed this from the RC 2 milestone Oct 15, 2018
@Tobotimus Tobotimus added Closed: Won't Fix It's supposed to be this way or we're not interested in fixing this. There's probably a good reason. and removed Status: Accepted We want this labels Feb 6, 2019
@Tobotimus
Copy link
Member

Gonna close this, marking as wontfix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Closed: Won't Fix It's supposed to be this way or we're not interested in fixing this. There's probably a good reason. Type: Bug Unexpected behavior, result, or exception. In case of PRs, it is a fix for the foregoing.
Projects
None yet
Development

No branches or pull requests

3 participants