-
Notifications
You must be signed in to change notification settings - Fork 5k
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
getPastEvents failing to decode empty data #1916
Comments
Probably same issue here. Error: Returned values aren't valid, did it run Out of Gas? TestCode:
Did work in beta.35 throws error in beta.26 althougt not in the error handler. |
Same problem on web3 beta.35 and beta.36 |
I'm running into the same issue with Edit: Error occurs in As a workaround I uncommented that error throwing line. I can't see any negative side effects so far. The event is accessable and my DAPP works as intended. It's just that weirdo in between. Here's an example transaction causing web3 to break: https://rinkeby.etherscan.io/tx/0x2f943ce121c47624fc00b7829bf5d8cae26c1fe97365c250063d7da6d9a1f6df The according solidity event: |
have u solved it yet? I have met the same problem |
The comment previous to yours mentions how to fix it. |
Got the same issue.
the output:
|
Same problem on beta.36 |
It looks like given error:
only occures when event definition which You want to read/download using
Use I tested events with mixed fields (2 x indexed, 2 x not indexed) and it works fine for me. |
This seems to be an issue many are hitting including myself. Just attempting to go back through the versions to try and see where this may have started. Can confirm this was introduced in v1.0.0-beta.36 in my case, specifying v1.0.0-beta.35 exactly and re-running brings up events as expected rather than the "Error: Returned values aren't valid, did it run Out of Gas?". |
[email protected] works fine |
Same issue. Downgrading to beta 35 worked for as well. |
Thanks for submitting this issue I will fix that in the next build. |
The issue isn't specific to handling empty data, it fails for me when data is supposed to be returned as well. Just to make that clear :) |
same issue |
I get the same issue using |
Added simple project that demonstrates this issue. It happens also when the event has only indexed values - hence no data. https://github.com/yarrumretep/web3_1916 My fix:
|
Any ETA for the next build? |
I got the same error. The weird things is all worked fine, untill suddenly it gave me that error. @yarrumretep how do we implement your fix? Update: |
1.0.0-beta.35 also solves it for me. Fix this. |
Bump |
Had the same error with version 1.0.
Rinkeby testnet:
Switched to version web3.js 1.0.0-beta.35.
Any idea? |
I had error "Error: Couldn't decode from ABI: 0x." when call get request with wrong contract address |
@Veniamin Thank You! You made my day :-) I was using 'account address', instead of 'contract address' :-P |
Experiencing this with |
Using 1.0.0-beta36, having this issue, this fix works. |
…s with same error message as described here: web3/web3.js#1916 (comment)
Downgrading to beta 33 bring me more trouble than solution For the first campaign in the same address, I was able to get the requests and manipulate on the same, however, while I created another campaign this error started to pop up whenever I try to click on the get request button. |
@DiePlease This means this error still occurs in the latest version? It shouldn't because I've tested it and it worked. 🤔 |
I confirm, faced that issue with beta 46, nothing helped so far and I had to deprecate the events causing this. |
@nivida I am still facing the same issue |
The 4th comment (6 months ago) for this issue mentions how to fix it, comment out one line. I made this change months ago and have not had an issue since. So not sure why this issue still remains unresolved. |
New version is using Promises, |
promises don't work quite the same in a for loop as await/async. This bug is so annoying though. |
facing the same issue in [email protected]. However, code works fine without any problems? Can I ignore this error?
|
also seeing this bug in |
Same issue executing "contract.methods.name().call() .then((result) => { console.log(result); });" I noticed in this method before in a method bytes is "0x" then bytes = "" so always return "Returned values aren't valid, did it run Out of Gas?" |
I'm having the same error when doing truffle migrate. But ONLY when using Ganache GUI, not when using Ganache CLI. Does this imply the problem is not in fact with web3? I tried downgrading web2 to 35 (from 37) like others suggested but it didn't make a difference. |
This got fixed with the PR #2608 and will be released asap. |
Same error on web3:1.0.0-beta.37 - Resolved by downgrading the solc from 0.5.9 to 0.5.3. |
Same error on Web3.js v1.0.0-beta.37 |
Resolved by downgrading the solc compiler version to
|
Same error when call methods.mymethods().call(): But it works by downgrading the solc compiler version to 0.5.1+commit.c8a2cb62 |
I'm experiencing the same problem by running:
directly in
Using a Geth node (Ethereum Grid) and That simple
|
@0xether There might be a problem with the ABI you're passing in. Just tried this call using Web3 1.2.6 and the ABI published to etherscan, here. const web3 = new Web3('https://mainnet.infura.io/v3/<INFURA_ID>');
const abi = [{"inputs":[{"internalType":"uint256","name":"chainId_","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"src","type":"address"},{"indexed":true,"internalType":"address","name":"guy","type":"address"},{"indexed":false,"internalType":"uint256","name":"wad","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":true,"inputs":[{"indexed":true,"internalType":"bytes4","name":"sig","type":"bytes4"},{"indexed":true,"internalType":"address","name":"usr","type":"address"},{"indexed":true,"internalType":"bytes32","name":"arg1","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"arg2","type":"bytes32"},{"indexed":false,"internalType":"bytes","name":"data","type":"bytes"}],"name":"LogNote","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"src","type":"address"},{"indexed":true,"internalType":"address","name":"dst","type":"address"},{"indexed":false,"internalType":"uint256","name":"wad","type":"uint256"}],"name":"Transfer","type":"event"},{"constant":true,"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"PERMIT_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"usr","type":"address"},{"internalType":"uint256","name":"wad","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"usr","type":"address"},{"internalType":"uint256","name":"wad","type":"uint256"}],"name":"burn","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"guy","type":"address"}],"name":"deny","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"usr","type":"address"},{"internalType":"uint256","name":"wad","type":"uint256"}],"name":"mint","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"src","type":"address"},{"internalType":"address","name":"dst","type":"address"},{"internalType":"uint256","name":"wad","type":"uint256"}],"name":"move","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"holder","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"bool","name":"allowed","type":"bool"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"usr","type":"address"},{"internalType":"uint256","name":"wad","type":"uint256"}],"name":"pull","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"usr","type":"address"},{"internalType":"uint256","name":"wad","type":"uint256"}],"name":"push","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"guy","type":"address"}],"name":"rely","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"dst","type":"address"},{"internalType":"uint256","name":"wad","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"src","type":"address"},{"internalType":"address","name":"dst","type":"address"},{"internalType":"uint256","name":"wad","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"version","outputs":[{"internalType":"string","name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"wards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"}];
const contract = new web3.eth.Contract(abi, '0x6b175474e89094c44da98b954eedeac495271d0f');
const balance = await contract.methods.balanceOf('0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1').call();
console.log('balanceOf --> ' + balance); ..outputs balanceOf --> 0 |
Same error when using solidity version ^0.6.0; I did a dump of my ABI from upgrade to 0.6.x (below) and similar dump from 0.5.x:
|
index.js:297 Uncaught (in promise) Error: Returned values aren't valid, did it run Out of Gas? You might also see this error if you are not using the correct ABI for the contract you are retrieving data from, requesting data from a block number that does not exist, or querying a node which is not fully synced. at ABICoder.push../node_modules/web3-eth-abi/lib/index.js.ABICoder.decodeParametersWith (index.js:297) at ABICoder.push../node_modules/web3-eth-abi/lib/index.js.ABICoder.decodeParameters (index.js:284) at Contract.push../node_modules/web3-eth-contract/lib/index.js.Contract._decodeMethodReturn (index.js:469) at Method.outputFormatter (index.js:759) at Method.push../node_modules/web3-core-method/lib/index.js.Method.formatOutput (index.js:146) at sendTxCallback (index.js:522) at cb (util.js:689) at Item.push../node_modules/process/browser.js.Item.run (browser.js:153) at drainQueue (browser.js:123) I am facing same error :- solc 0.7.1 const loadWeb3 = async () => { const loadBlockchainData = async () => {
please help me to solve this error!!! |
Good day. I present the same problem using "web3": "^ 1.5.2" and "solc": "^ 0.8.7-fixed" Grateful for any help. |
still not fixed in latest release |
I am having the exact same issue. Is there anything I can do? It is really blocking... Any workaround, even ugly? Code I can modify etc? |
I'm trying out web3
v1.0.0-beta.36
and having some trouble with pulling events from a contract.The events do not return any data, and
getPastEvents
is throwing this error:The same action works in web3
0.20.7
no problem.Is it possible a bug in decoding of empty event data
0x
may have slipped through the cracks?The text was updated successfully, but these errors were encountered: