简体   繁体   中英

INDEXER Lake Framework - outcome.status.failure not showing execution error

The following transaction https://explorer.near.org/transactions/CkZYiXB3BEoXNuLDqcn5GjErkXghKGCB47yPyyze4kTf#BPYU8T3o5mdsU4ewG3JdCLRe8ivpsGTehKxkifFAsboD

failed whith the following error:

{
  "type": "action",
  "error": {
    "type": "functionCallError",
    "error": {
      "type": "executionError",
      "error": "Smart contract panicked: The contract is not initialized"
    }
  }
}

But what I got on the indexer is the following:

{
   "outcome":{
      "executionOutcome":{
         "blockHash":"8NP4Z2i7CBQzRUxa8CfuummnYZvwfZaCFmif4d6mcgyB",
         "id":"CkZYiXB3BEoXNuLDqcn5GjErkXghKGCB47yPyyze4kTf",
         "outcome":{
            "executorId":"test1.csandi.near",
            "gasBurnt":2428211671420,
            "logs":[
               
            ],
            "metadata":{
               "gasProfile":null,
               "version":1
            },
            "receiptIds":[
               "GrXdFKA9byvCmxGiQkGc9iaFn88FfePk4tfJhvcTGMwc"
            ],
            "status":{
               "SuccessReceiptId":"GrXdFKA9byvCmxGiQkGc9iaFn88FfePk4tfJhvcTGMwc"
            },
            "tokensBurnt":"242821167142000000000"
         },
         "proof":[
            {
               "direction":"Left",
               "hash":"BWhmGBmvzbX3WBP1RZQ59DB749sHSV2xS5pNyF6xAbbh"
            },
            {
               "direction":"Right",
               "hash":"H4YMDcd9Fh68KTwyPTwYuFb89KhfdGUoxRbBYzDcNAze"
            },
            {
               "direction":"Right",
               "hash":"9jv152euKvurdVkDYS5FKiiT4ej6xL1gRYTHoNbjwEZi"
            },
            {
               "direction":"Right",
               "hash":"BqQFHzSYzqDE8tMQkJT8PHFGxLmQrkFBcuTqFP4nTjx7"
            }
         ]
      },
      "receipt":null
   },
   "transaction":{
      "actions":[
         {
            "FunctionCall":{
               "args":"eyJpbml0aWFsX3ByaWNlIjoxLjksInNwYWNpbmciOjIsImFscGhhX2lkIjoidXNuIiwiYmV0YV9pZCI6IndyYXAubmVhciIsInN3YXBfZmVlX3JhdGUiOjAuMDAzLCJwcm90b2NvbF90b2xsIjowLjAxfQ==",
               "deposit":"0",
               "gas":200000000000000,
               "methodName":"create_new_pool"
            }
         }
      ],
      "hash":"CkZYiXB3BEoXNuLDqcn5GjErkXghKGCB47yPyyze4kTf",
      "nonce":75627675000007,
      "publicKey":"ed25519:85yAx5mY8DinTWQfMn47cZTHMhZtLRAWZLpazYmetwno",
      "receiverId":"dev-cliquidity-perk-jorge.near",
      "signature":"ed25519:1CieS8AUSc7Y3S8By8adJaEXXydXcjvSA1uVXPgrdhkmGPpf5ykA7XWqJGZnDhMtymkp6eWDBEQzsBXkhybAbUV",
      "signerId":"test1.csandi.near"
   }
}

So I would like to know if there is anyway to get the failure message from the indexer?

Look in the next blocks for the corresponding receipt from the SuccessReceiptId (id GrXdFKA9byvCmxGiQkGc9iaFn88FfePk4tfJhvcTGMwc ), and in its execution outcome you will find that status.

I cannot recommend more to watch or read the Data Flow in NEAR

FYI, just to follow up and clarify for anyone with this question, after following the above response by "Vlad Frolov", in order to get the Receipt Status, I had to check

shard.receiptExecutionOutcomes

which will provide the results of the receipts, so I started to track the receipts that I am interested in, in this case for SuccessReceiptId (GrXdFKA9byvCmxGiQkGc9iaFn88FfePk4tfJhvcTGMwc)

 "executionOutcome":{ "blockHash":"59F5pES9Myc2VT4JkppE95epCwtGAXYux9okbzpsh95K", "id":"**GrXdFKA9byvCmxGiQkGc9iaFn88FfePk4tfJhvcTGMwc**", "outcome":{ "executorId":"dev-cliquidity-perk-jorge.near", "gasBurnt":2824274578054, "logs":[ ], "metadata":{ "gasProfile":[ { "cost":"BASE", "costCategory":"WASM_HOST_COST", "gasUsed":"1323840555" }, { "cost":"CONTRACT_LOADING_BASE", "costCategory":"WASM_HOST_COST", "gasUsed":"35445963" }, { "cost":"CONTRACT_LOADING_BYTES", "costCategory":"WASM_HOST_COST", "gasUsed":"106584645000" }, { "cost":"READ_MEMORY_BASE", "costCategory":"WASM_HOST_COST", "gasUsed":"5219726400" }, { "cost":"READ_MEMORY_BYTE", "costCategory":"WASM_HOST_COST", "gasUsed":"136847988" }, { "cost":"READ_REGISTER_BASE", "costCategory":"WASM_HOST_COST", "gasUsed":"2517165186" }, { "cost":"READ_REGISTER_BYTE", "costCategory":"WASM_HOST_COST", "gasUsed":"11334630" }, { "cost":"STORAGE_READ_BASE", "costCategory":"WASM_HOST_COST", "gasUsed":"56356845750" }, { "cost":"STORAGE_READ_KEY_BYTE", "costCategory":"WASM_HOST_COST", "gasUsed":"154762665" }, { "cost":"TOUCHING_TRIE_NODE", "costCategory":"WASM_HOST_COST", "gasUsed":"193223471112" }, { "cost":"UTF8_DECODING_BASE", "costCategory":"WASM_HOST_COST", "gasUsed":"3111779061" }, { "cost":"UTF8_DECODING_BYTE", "costCategory":"WASM_HOST_COST", "gasUsed":"9038994849" }, { "cost":"WASM_INSTRUCTION", "costCategory":"WASM_HOST_COST", "gasUsed":"11928316488" }, { "cost":"WRITE_MEMORY_BASE", "costCategory":"WASM_HOST_COST", "gasUsed":"2803794861" }, { "cost":"WRITE_MEMORY_BYTE", "costCategory":"WASM_HOST_COST", "gasUsed":"313233780" }, { "cost":"WRITE_REGISTER_BASE", "costCategory":"WASM_HOST_COST", "gasUsed":"2865522486" }, { "cost":"WRITE_REGISTER_BYTE", "costCategory":"WASM_HOST_COST", "gasUsed":"437179860" } ], "version":1 }, "receiptIds":[ "BPYU8T3o5mdsU4ewG3JdCLRe8ivpsGTehKxkifFAsboD" ], **"status":{ "Failure":{ "ActionError":{ "index":0, "kind":{ "FunctionCallError":{ "ExecutionError":"Smart contract panicked: The contract is not initialized" } } } }** }, "tokensBurnt":"282427457805400000000" }, "proof":[ { "direction":"Left", "hash":"5j1RhLnf5jGChUPxU9CPNbAGwSn6VnzBw7taJe5vSnYD" }, { "direction":"Right", "hash":"AJ2kARUcYAkzsL3xmw4jAETZ61jtQuswf7RvhSxscKCR" }, { "direction":"Left", "hash":"9vXQjFdTaQw5XjUKsRK6N3WFCg5zMVca5Ze2Qqznn3AM" } ] }, "receipt":{ "predecessorId":"test1.csandi.near", "receipt":{ "Action":{ "actions":[ { "FunctionCall":{ "args":"eyJpbml0aWFsX3ByaWNlIjoxLjksInNwYWNpbmciOjIsImFscGhhX2lkIjoidXNuIiwiYmV0YV9pZCI6IndyYXAubmVhciIsInN3YXBfZmVlX3JhdGUiOjAuMDAzLCJwcm90b2NvbF90b2xsIjowLjAxfQ==", "deposit":"0", "gas":200000000000000, "methodName":"create_new_pool" } } ], "gasPrice":"346069590", "inputDataIds":[ ], "outputDataReceivers":[ ], "signerId":"test1.csandi.near", "signerPublicKey":"ed25519:85yAx5mY8DinTWQfMn47cZTHMhZtLRAWZLpazYmetwno" } }, "receiptId":"GrXdFKA9byvCmxGiQkGc9iaFn88FfePk4tfJhvcTGMwc", "receiverId":"dev-cliquidity-perk-jorge.near" } }

And as you can see in the json response,the following status:

"status":{
        "Failure":{
           "ActionError":{
              "index":0,
              "kind":{
                 "FunctionCallError":{
                    "ExecutionError":"Smart contract panicked: The contract is not initialized"
                 }
              }
           }
        }

Anyway to fully understand how transactions/receipts work this document helped a lot.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM