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

Cannot read property of blockNumber of null #2246

Closed
0x-genesys opened this issue Jan 28, 2019 · 9 comments
Closed

Cannot read property of blockNumber of null #2246

0x-genesys opened this issue Jan 28, 2019 · 9 comments
Labels
Bug Addressing a bug

Comments

@0x-genesys
Copy link

0x-genesys commented Jan 28, 2019

sendSignedTransaction call back 'confirmation' is called when transaction is mined on ropsten/mainnet

Callback is not called. Error is thrown

Steps to reproduce the behavior

Package.json:

"dependencies": {
  "@babel/runtime": "^7.3.1",
  "async": "^2.6.1",
  "bignumber.js": "^8.0.2",
  "ethereumjs-tx": "^1.3.7",
  "loadash": "^1.0.0",
  "lodash": "^4.17.11",
  "math": "^0.0.3",
  "mathjs": "^5.4.1",
  "moment": "^2.24.0",
  "mysql": "^2.16.0",
  "request": "^2.88.0",
  "solc": "^0.4.24",
  "uuid": "^3.3.2",
  "web3": "^1.0.0-beta.37"
},

call : web3.eth.sendSignedTransaction('0x' + serializedTx)

Error Logs

following error is thrown:

(node:62482) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'blockNumber' of null
    at Object.outputTransactionFormatter (/Users/karanahuja/airflow/dags/node_modules/web3-core-helpers/dist/web3-core-helpers.cjs.js:91:15)
    at GetTransactionReceiptMethod.afterExecution (/Users/karanahuja/airflow/dags/node_modules/web3-core-method/dist/web3-core-method.cjs.js:497:30)
    at GetTransactionReceiptMethod._callee$ (/Users/karanahuja/airflow/dags/node_modules/web3-core-method/dist/web3-core-method.cjs.js:455:39)
    at tryCatch (/Users/karanahuja/airflow/dags/node_modules/regenerator-runtime/runtime.js:62:40)
    at Generator.invoke [as _invoke] (/Users/karanahuja/airflow/dags/node_modules/regenerator-runtime/runtime.js:288:22)
    at Generator.prototype.(anonymous function) [as next] (/Users/karanahuja/airflow/dags/node_modules/regenerator-runtime/runtime.js:114:21)
    at asyncGeneratorStep (/Users/karanahuja/airflow/dags/node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)
    at _next (/Users/karanahuja/airflow/dags/node_modules/@babel/runtime/helpers/asyncToGenerator.js:25:9)
    at <anony
mous>
    at process._tickCallback (internal/process/next_tick.js:189:7)
(node:62482) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:62482) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Versions

[NPM, Node, Web3.js, OS, device...]

Node: v8.12.0
Npm: 6.4.1
web3: "^1.0.0-beta.37"
"@babel/runtime": "^7.3.1",
"solc": "^0.4.24",

@0x-genesys
Copy link
Author

My .on('Confirmation', {} => ) callback is not called after the above error is thrown. Looks like an error in web3core when sendSignedTransaction is called.

@nivida nivida added Bug Addressing a bug In Progress Currently being worked on labels Jan 28, 2019
@nivida
Copy link
Contributor

nivida commented Jan 28, 2019

@0x-genesys Thanks for submitting this issue!

Which provider are you using?

@0x-genesys
Copy link
Author

Thanks for your prompt response @nivida . I am using HttpProvider , with an infura url:

web3 = new Web3(new Web3.providers.HttpProvider("https://ropsten.infura.io/v3/XXX"));

@0x-genesys
Copy link
Author

Oh so issue was in 'receipt' , not 'confirmed'. Once the PR is merged, do I need to re-install node_modules?

@nivida
Copy link
Contributor

nivida commented Jan 28, 2019

@0x-genesys Nope anything is fine :-)
I had to update the afterExecution method of the GetTransactionReceiptMethod class. I didn't handle the case if the method is returning null.

@0x-genesys
Copy link
Author

when can the response from the RPC be null?

@nivida
Copy link
Contributor

nivida commented Jan 28, 2019

As described here, will the eth_getTransactionReceipt JSON-RPC method return the value null when no receipt was found.

@nivida nivida closed this as completed Jan 28, 2019
@0x-genesys
Copy link
Author

Im still facing the error. Tried running:

rm -rf node_modules && npm i

@nivida am I missing something?

@akeem
Copy link

akeem commented Jan 30, 2019

@nivida I'm not sure if it is helpful, but I am experiencing a similar behavior, is it possible that one of the other calls to outputTransactionFormatter is being passed null?

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

No branches or pull requests

3 participants