Consensys / tessera

Tessera - Enterprise Implementation of Quorum's transaction manager
https://docs.tessera.consensys.net/
Apache License 2.0
180 stars 109 forks source link

Tessera throws 500 Internal Server Error for OPTIONS : /storeraw #1385

Open riaz7se opened 2 years ago

riaz7se commented 2 years ago

Web3js-quorum sending private transaction to quorum-7nodes throws 500-Internal Server Error

A request call sending transaction from browser running Reactjs with Web3js-quorum to quorum 7nodes example, using below code, throws 500 internal error in Tessera logs

const web3 = new Web3Quorum(new Web3("http://localhost:22000"), { privateUrl: "http://localhost:9081",}, true);
....
const bytecodeWithInitParam = contract
      .deploy({ data: bytecode, arguments: [<some_value>] })
      .encodeABI();

const tx = await web3.priv.generateAndSendRawTransaction({
          gasPrice: 0,
          gasLimit: 4300000,
          value: 0,
          data: bytecodeWithInitParam,
          from: signAcct,
          isPrivate: true,
          privateFrom: "<tm1.pub>",
          privateFor: ["<tm7.pub>"],
          nonce: txCount,
        });

Making below config changes to tessera also not worked

    {
      "app": "ThirdParty",
      "serverAddress": "http://localhost:9081/",
      "communicationType": "REST",
      "cors" : {
          "allowedMethods" : ["GET", "POST", "PUT", "DELETE", "OPTIONS", "HEAD"],
          "allowedOrigins" : ["http://localhost:3000/", "*"],
          "allowedHeaders" : ["content-type"],
          "allowCredentials" : true
      }

Request from browser to quorum node with url http://localhost:22000 is working with 200 response for preflight request, where as request to tessera with url http://localhost:9081, which gets appended with /storeraw gives cors issue in browser console and preflight request of type OPTIONS fails.

Below stacktrace can be seen in tessera logs.

2022-01-13 18:46:09.966 [qtp630669831-22] INFO  o.g.j.s.w.p.WadlModelProcessor$OptionsHandler - Enter Request : OPTIONS : /storeraw
2022-01-13 18:46:09.985 [qtp630669831-22] ERROR c.q.t.a.e.DefaultExceptionMapper - Error occurred: Unable to make protected javax.ws.rs.core.Response() accessible: module java.ws.rs does not "opens javax.ws.rs.core" to module jersey.server. Root cause: Unable to make protected javax.ws.rs.core.Response() accessible: module java.ws.rs does not "opens javax.ws.rs.core" to module jersey.server
2022-01-13 18:46:09.986 [qtp630669831-22] INFO  o.g.j.s.w.p.WadlModelProcessor$OptionsHandler - Exit Request : OPTIONS : /storeraw
2022-01-13 18:46:09.986 [qtp630669831-22] INFO  o.g.j.s.w.p.WadlModelProcessor$OptionsHandler - Response for storeraw : 500 Internal Server Error

Tried & was unsuccess in below scenarios:

joshuafernandes commented 2 years ago

Any updates on this @macfarla - we've also got a problem with this on one of our products

macfarla commented 2 years ago

@joshuafernandes have you got a scenario for us to reproduce with?

joshuafernandes commented 2 years ago

Hi @macfarla we had a more involved setup than the one here with react - the snippets @riaz7se pretty much sums it up. I can walk you through our code next week if that works?

riaz7se commented 2 years ago

@joshuafernandes by any chance, if i can be part of your code walk through, i would like to be.