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

MissingTrieValue error #11174

Open
quick-pawiromitchel opened this issue Apr 28, 2024 · 5 comments
Open

MissingTrieValue error #11174

quick-pawiromitchel opened this issue Apr 28, 2024 · 5 comments
Labels
community Issues created by community investigation required

Comments

@quick-pawiromitchel
Copy link

Describe the bug
Getting this error while calling query request_type: "view_account"

{
  "jsonrpc": "2.0",
  "error": {
    "name": "INTERNAL_ERROR",
    "cause": {
      "info": {
        "error_message": "MissingTrieValue(TrieStorage, 6R5be3snoVFvPBUJ8SnQFqsFEZKXDCxNL84qx5cdFN7u)"
      },
      "name": "INTERNAL_ERROR"
    },
    "code": -32000,
    "message": "Server error",
    "data": "The node reached its limits. Try again later. More details: MissingTrieValue(TrieStorage, 6R5be3snoVFvPBUJ8SnQFqsFEZKXDCxNL84qx5cdFN7u)"
  },
  "id": "dontcare"
}

To Reproduce

{
  "id": "dontcare",
  "jsonrpc": "2.0",
  "method": "query",
  "params": {
    "account_id": "0c314a28fd955d193fd452bf4b29b872dc4450a778b155feb777c52269d436e5",
    "block_id": 114686869,
    "request_type": "view_account"
  }
}

Expected behavior
To not return the error

Version (please complete the following information):
We're running 1.39.1

Additional context
Running the same query against the public RPC returns an error as well

@Longarithm
Copy link
Member

Longarithm commented Apr 29, 2024

For me, against https://rpc.mainnet.near.org/, it returned
Cause: {'info': {'block_hash': 'FnckcaXuh9FcRDYCVjsnRhgtU7chtXwJhwKv3UdXRxim', 'block_height': 114686869}, 'name': 'GARBAGE_COLLECTED_BLOCK'}, Data: The data for block #114686869 is garbage collected on this node, use an archival node to fetch historical data
so I couldn't reproduce it. The block should be indeed garbage collected for RPC nodes.
You can consider querying https://archival-rpc.mainnet.near.org/ but for me it says that account doesn't exist, which is probably true.

@quick-pawiromitchel
Copy link
Author

You can consider querying https://archival-rpc.mainnet.near.org/ but for me it says that account doesn't exist, which is probably true.

I did, the public rpc returns with a different error but it doesn't make sense

{
  "jsonrpc": "2.0",
  "error": {
    "code": -32000,
    "message": "Server error",
    "data": "account 0c314a28fd955d193fd452bf4b29b872dc4450a778b155feb777c52269d436e5 does not exist while viewing",
    "name": "HANDLER_ERROR",
    "cause": {
      "info": {
        "block_hash": "FnckcaXuh9FcRDYCVjsnRhgtU7chtXwJhwKv3UdXRxim",
        "block_height": 114686869,
        "requested_account_id": "0c314a28fd955d193fd452bf4b29b872dc4450a778b155feb777c52269d436e5"
      },
      "name": "UNKNOWN_ACCOUNT"
    }
  },
  "id": "dontcare"
}

It says unknown account, but the account does exist https://nearblocks.io/address/0c314a28fd955d193fd452bf4b29b872dc4450a778b155feb777c52269d436e5

@Longarithm
Copy link
Member

Ah, I understand your concern. The reason is that NEAR is "pre-state-root" blockchain, so when block is distributed, it includes state root corresponding to state before the block was applied. If you try next height, it will work.

@Longarithm
Copy link
Member

More context - the error itself expected, the error message is not really expected.
What should happen is this - example in python:

ValueError: Cause: {'info': {'block_hash': '7ZqGJgiUfhhn5iWzCJ32puRHX7SCgreVVvtcSBcdHgQ7', 'block_height': 114686870}, 'name': 'GARBAGE_COLLECTED_BLOCK'}, Data: The data for block #114686870 is garbage collected on this node, use an archival node to fetch historical data

Error says that we don't have state for the block anymore.
The MissingTrieValue is an internal error and likely indicates DB corruption.

@telezhnaya
Copy link
Contributor

Could you please check if it's still an issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community Issues created by community investigation required
Projects
None yet
Development

No branches or pull requests

3 participants