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

Weird error when deleting: Natural subtraction underflow #28

Open
vporton opened this issue Feb 27, 2024 · 5 comments
Open

Weird error when deleting: Natural subtraction underflow #28

vporton opened this issue Feb 27, 2024 · 5 comments

Comments

@vporton
Copy link

vporton commented Feb 27, 2024

My software does some puts, attribute modification. Then I try to delete an existing key:

$ dfx canister call ajuq4-ruaaa-aaaaa-qaaga-cai delete '(record{sk="i/1"})'
Warning: The version of DFX used (0.14.1) is different than the version being run (0.16.1).
This might happen because your dfx.json specifies an older version, or DFX_VERSION is set in your environment.
We are forwarding the command line to the old version. To disable this warning, set the DFX_WARNING=-version_check environment variable.

Error: Failed update call.
Caused by: Failed update call.
  The Replica returned an error: code 5, message: "Canister ajuq4-ruaaa-aaaaa-qaaga-cai trapped explicitly: Natural subtraction underflow"

This happens with the latest version of beta, if I did not confuse anything.

@ByronBecker
Copy link
Contributor

@vporton
Copy link
Author

vporton commented Feb 29, 2024

The error made repeatable by https://github.com/vporton/bug-candb-delete test repo.

Now I am working on a minimal example.

@vporton
Copy link
Author

vporton commented Feb 29, 2024

Oops, it is repeatable by commit c6553fc5e5fc9704058a870e52b47fed556db863 in my repo.

@vporton
Copy link
Author

vporton commented Feb 29, 2024

I created a nearly minimal example for CanDB: https://github.com/vporton/bug-candb-delete/tree/candb-minimal

The further work is locating the error in CanDB or more likely in BTree.

origyn-admin pushed a commit that referenced this issue Mar 20, 2024
…in Natural subtraction underflow during deletion
origyn-admin pushed a commit that referenced this issue Mar 20, 2024
Fix for #28: No increment in CanDB.update during creation, resulting in...

See merge request origyn/engineering/opensource/candb-projects/CanDB!25
@ByronBecker
Copy link
Contributor

Fixed in d767609

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants