hyperledger / iroha-python

Python library for Hyperledger Iroha, a simple distributed ledger.
https://wiki.hyperledger.org/display/iroha
Apache License 2.0
103 stars 81 forks source link

Iroha 2: "Unhandled rejection: ParityScale" #108

Open 6r1d opened 2 years ago

6r1d commented 2 years ago

LoNeWoLf reported an error in Discord:

return self.cl.submit_all_with_metadata(tx, {})
Exception: Error: Unexpected transaction response;
status: 500 Internal Server Error;
response body: Unhandled rejection: ParityScale

It happens with a standard docker-compose.yml, as shown in the tutorial.

Last commit in Iroha-python: 04c7980d6e, iroha2 branch. Last commit in Iroha: 91da336af2, iroha2 branch.

The code used here is the standard example file, test.py. There's the copy to be sure:

Code ```python import iroha2 import json from iroha2 import Client from iroha2.data_model import domain from iroha2.data_model.isi import * from iroha2.data_model.domain import * from iroha2.data_model.expression import * from iroha2.data_model.events import FilterBox, pipeline from iroha2.data_model import * cfg = json.loads(open("./config.json").read()) cl = Client(cfg) domain = NewDomain("iroha_python") register = Register.identifiable(domain) hash = cl.submit_isi(register) filter = FilterBox.Pipeline( pipeline.EventFilter( entity_kind=pipeline.EntityKind.Transaction(), status_kind=pipeline.StatusKind.Committed(), hash=None, )) listener = cl.listen(filter) for event in listener: print(event) if event["Pipeline"]["status"] == "Committed" \ and event["Pipeline"]["hash"] == hash: break ```
baziorek commented 2 years ago

I faced similar problem:

I was trying to execute sample code of Iroha 2 (sample from documentation: https://hyperledger.github.io/iroha-2-docs/guide/python.html#_2-configuring-iroha-2 and https://hyperledger.github.io/iroha-2-docs/guide/python.html#_3-registering-a-domain):

import json
from iroha2 import Client
from iroha2.data_model.isi import *
from iroha2.data_model.domain import *
from iroha2.data_model.expression import *
from iroha2.data_model import *

cfg = json.loads(open("config.json").read())
cl = Client(cfg)

domain = Domain("looking_glass")
register = Register(Expression(Value(Identifiable(domain))))
hash = cl.submit_isi(register)
print(hash)

The error message:

python iroha2_nauka.py
[{'Register': {'object': {'Raw': {'Identifiable': {'Domain': {'id': {'name': 'looking_glass'}, 'logo': 'QmQqzMTavQgT4f4T5v6PWBp7XNKtoPmC9jvn12WPT3gkSE', 'accounts': {}, 'asset_definitions': {}, 'metadata': {}}}}}}}]
Traceback (most recent call last):
  File "/home/agh/Pulpit/blockchain/iroha_code/iroha2/iroha2_nauka.py", line 16, in <module>
    hash = cl.submit_isi(register)
  File "/home/agh/.local/lib/python3.10/site-packages/iroha2/__init__.py", line 41, in submit_isi
    return self.submit_tx([_Instruction(isi)])
  File "/home/agh/.local/lib/python3.10/site-packages/iroha2/__init__.py", line 38, in submit_tx
    return self.cl.submit_all_with_metadata(tx, {})
Exception: Error: Unexpected transaction response; status: 500 Internal Server Error; response body: Unhandled rejection: ParityScale
    0: Unexpected transaction response; status: 500 Internal Server Error; response body: Unhandled rejection: ParityScale

Logs from nodes:

iroha-iroha0-1  | 2022-07-25T11:39:47.637254Z  INFO request{method=POST path=/transaction version=HTTP/1.1 remote.addr=172.19.0.1:59432}: warp::filters::trace: processing request
iroha-iroha0-1  | 2022-07-25T11:39:47.637362Z ERROR request{method=POST path=/transaction version=HTTP/1.1 remote.addr=172.19.0.1:59432}: warp::filters::trace: unable to process request (internal error) status=500 error=Rejection([MethodNotAllowed, ParityScale])
iroha-iroha0-1  | 2022-07-25T11:39:47.637375Z ERROR warp::reject: unhandled custom rejection, returning 500 response: ParityScale
iroha-iroha0-1  | 2022-07-25T11:45:01.298455Z  INFO request{method=POST path=/transaction version=HTTP/1.1 remote.addr=172.19.0.1:43302}: warp::filters::trace: processing request
iroha-iroha0-1  | 2022-07-25T11:45:01.298543Z ERROR request{method=POST path=/transaction version=HTTP/1.1 remote.addr=172.19.0.1:43302}: warp::filters::trace: unable to process request (internal error) status=500 error=Rejection([MethodNotAllowed, ParityScale])
iroha-iroha0-1  | 2022-07-25T11:45:01.298555Z ERROR warp::reject: unhandled custom rejection, returning 500 response: ParityScale
iroha-iroha0-1  | 2022-07-25T11:49:20.269353Z  INFO request{method=POST path=/transaction version=HTTP/1.1 remote.addr=172.19.0.1:59146}: warp::filters::trace: processing request
iroha-iroha0-1  | 2022-07-25T11:49:20.269427Z ERROR request{method=POST path=/transaction version=HTTP/1.1 remote.addr=172.19.0.1:59146}: warp::filters::trace: unable to process request (internal error) status=500 error=Rejection([MethodNotAllowed, ParityScale])
iroha-iroha0-1  | 2022-07-25T11:49:20.269438Z ERROR warp::reject: unhandled custom rejection, returning 500 response: ParityScale
iroha-iroha0-1  | 2022-07-25T11:49:57.016977Z  INFO request{method=POST path=/transaction version=HTTP/1.1 remote.addr=172.19.0.1:57332}: warp::filters::trace: processing request
iroha-iroha0-1  | 2022-07-25T11:49:57.017052Z ERROR request{method=POST path=/transaction version=HTTP/1.1 remote.addr=172.19.0.1:57332}: warp::filters::trace: unable to process request (internal error) status=500 error=Rejection([MethodNotAllowed, ParityScale])
iroha-iroha0-1  | 2022-07-25T11:49:57.017065Z ERROR warp::reject: unhandled custom rejection, returning 500 response: ParityScale

Does anybody know how to fix the problem?

mersalin commented 12 months ago

anyone have any solution on this? I am also facing the same issue. Thanks.

matisalimbene commented 11 months ago

Experiencing same issue on macos M1:

Somo additional contextual data: rustc --version cargo 1.73.0 (9c4383fb5 2023-08-26) rustc 1.73.0 (cc66ad468 2023-10-03)

./iroha_client_cli -c config.json  domain list all 
Error: 
   0: Failed to get all domains
   1: Other error
   2: Unexpected query response; status: 500 Internal Server Error; response body: Unhandled rejection: WarpQueryError(Decode(ParityScale))

Location:
   client_cli/src/main.rs:412

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
                                ⋮ 4 frames hidden ⋮                               
   5: <iroha_client_cli::domain::Args as iroha_client_cli::RunArgs>::run::ha10c9c9b447d966f
      at <unknown source file>:<unknown line>
   6: iroha_client_cli::main::hb8fcdf42008aa0a8
      at <unknown source file>:<unknown line>
   7: std::sys_common::backtrace::__rust_begin_short_backtrace::h9770dd60a57ca46d
      at <unknown source file>:<unknown line>
   8: std::rt::lang_start::{{closure}}::h0e4d6a213f8b3def
      at <unknown source file>:<unknown line>
   9: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h1454cc3029024710
      at /rustc/f7ca9df69549470541fbf542f87a03eb9ed024b6/library/core/src/ops/function.rs:284
  10: std::panicking::try::do_call::h399f2f67c900a70b
      at /rustc/f7ca9df69549470541fbf542f87a03eb9ed024b6/library/std/src/panicking.rs:500
  11: std::panicking::try::hc4a13c82eeea7219
      at /rustc/f7ca9df69549470541fbf542f87a03eb9ed024b6/library/std/src/panicking.rs:464
  12: std::panic::catch_unwind::h5c74b0c7572df1e6
      at /rustc/f7ca9df69549470541fbf542f87a03eb9ed024b6/library/std/src/panic.rs:142
  13: std::rt::lang_start_internal::{{closure}}::h7577686ca6f0aae1
      at /rustc/f7ca9df69549470541fbf542f87a03eb9ed024b6/library/std/src/rt.rs:148
  14: std::panicking::try::do_call::hb26301b45a73cdf0
      at /rustc/f7ca9df69549470541fbf542f87a03eb9ed024b6/library/std/src/panicking.rs:500
  15: std::panicking::try::hd1bc13fd3af35eb2
      at /rustc/f7ca9df69549470541fbf542f87a03eb9ed024b6/library/std/src/panicking.rs:464
  16: std::panic::catch_unwind::hf8d847a54f41c423
      at /rustc/f7ca9df69549470541fbf542f87a03eb9ed024b6/library/std/src/panic.rs:142
  17: std::rt::lang_start_internal::hb28c3e78008b9306
      at /rustc/f7ca9df69549470541fbf542f87a03eb9ed024b6/library/std/src/rt.rs:148
  18: _main<unknown>
      at <unknown source file>:<unknown line>
matisalimbene commented 11 months ago

@mersalin I started trying other compose files and starting the network with docker-compose.dev.yml did work.

docker-compose.yml and docker-compose.stable.yml failed with the ParityScale error for me.

mersalin commented 9 months ago

@matisalimbene Thank you very much, It worked.