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

Geth to 1.9.23, web3j (Java) call error #21843

Closed
gitzkm opened this issue Nov 13, 2020 · 10 comments
Closed

Geth to 1.9.23, web3j (Java) call error #21843

gitzkm opened this issue Nov 13, 2020 · 10 comments

Comments

@gitzkm
Copy link

gitzkm commented Nov 13, 2020

After geth version is upgraded from 1.9.15 to 1.9.23, the same code reports an error through web3j (Java) call, and the error message is method thread ' java.lang.NoSuchMethodError ' exception.
It can be called when the original geth version is 1.9.15. Geth start command is

nohup ./geth --identity "secbro etherum" --rpc --rpccorsdomain "127.0.0.1" --datadir "/eth/ethdata" --port "30303" --rpcapi="db,eth,net,web3,personal,admin,miner" --rpcaddr 127.0.0.1 --rpcport 9721 --allow-insecure-unlock --syncmode "fast" >> /eth/ethdata/ethlog.log &

System information

Geth version: 1.9.15
OS & Version: centos7.5
Commit hash : (if develop)

Expected behaviour

Actual behaviour

Steps to reproduce the behaviour

Backtrace

[backtrace]
@ligi
Copy link
Member

ligi commented Nov 13, 2020

please provide the java code to reproduce this error

@ligi
Copy link
Member

ligi commented Nov 13, 2020

maybe related the removal of abi.U256() mentioned in #21837

@gitzkm
Copy link
Author

gitzkm commented Nov 13, 2020

请提供Java代码来重现此错误
Thank you. Part of my code is as follows:

HttpService httpService = new HttpService(ethConfig.getServiceUrl(), buildBasicAuthClient(ethConfig), false);
ethConfig.setWeb3j(Web3j.build(httpService));
ethConfig.setAdmin(Admin.build(httpService));
BigInteger lastBlockNumber = ethConfig.getWeb3j().ethBlockNumber().send().getBlockNumber();

web3j version

org.web3j
core
4.5.11

error info
image
image
image

@ligi
Copy link
Member

ligi commented Nov 13, 2020

can you provide ethlog.log when the error was triggered?

@gitzkm
Copy link
Author

gitzkm commented Nov 13, 2020

can you provide ethlog.log when the error was triggered?
No error message found
image

@ligi
Copy link
Member

ligi commented Nov 13, 2020

Part of my code is as follows:

does it trigger this error with that part of the code only? Or is the error maybe triggered in other parts of your code?

@gitzkm
Copy link
Author

gitzkm commented Nov 13, 2020

Part of my code is as follows:

does it trigger this error with that part of the code only? Or is the error maybe triggered in other parts of your code?

The possibility is relatively small, when I even get version 1.9.15, there is no problem, the same code. Is there any restriction on RPC in the recent geth version update? Do you need to add other configuration in the startup command to allow RPC?

@karalabe
Copy link
Member

karalabe commented Nov 16, 2020

@gitzkm Hmm, we've got a report from Infura that their infra was appending weird paths to the RPC endpoint, which old Geth versions ignored, but new ones rejected. I think that might be the case for you too, as the request you are making is to http://IP:8545/eth. Not sure why the library would add that /eth there, but it's wrong, the endpoint is simply the http://IP:8545 (or http://IP:8545/ should also work).

@gitzkm
Copy link
Author

gitzkm commented Nov 17, 2020

@gitzkm Hmm, we've got a report from Infura that their infra was appending weird paths to the RPC endpoint, which old Geth versions ignored, but new ones rejected. I think that might be the case for you too, as the request you are making is to http://IP:8545/eth. Not sure why the library would add that /eth there, but it's wrong, the endpoint is simply the http://IP:8545 (or http://IP:8545/ should also work).

Thank you for your reply. It helped me a lot and solved this problem

@karalabe
Copy link
Member

👍

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

No branches or pull requests

3 participants