maticnetwork / terraform-polygon-supernets

31 stars 22 forks source link

502 Bad Gateway when connecting to RPC #16

Open ajruizvargas opened 1 year ago

ajruizvargas commented 1 year ago

I ran the playbook and it seems that it ran successfully. When I try to connect to the RPC I get 502 Bad Gateway error. Any ideas why this is happening?

Screenshot 2023-05-11 at 11 40 45
Gauravk0029 commented 1 year ago

I am also facing same issue RPC is not working

sohan-pelqa commented 1 year ago

Getting same issue

praetoriansentry commented 1 year ago

Hey @Gauravk0029 / @sohan-pelqa / @ajruizvargas can you let me know what command you were using to access the RPC?

I would also ssh into any particular validator or fullnode and double check that edge is running with sudo systemctl status edge if you're getting a 502 it sounds like the lb was created properly and the nodes behind the lb are unhealthy and not running. This can happen in situations where network didn't bootstrap properly for one reason or another.

In my case, I just ran through the full process this evening while doing some testing on mumbai: image

sohanyadav commented 1 year ago

@praetoriansentry edge service not starting error is

2023-05-17T10:56:00.115Z [INFO]  polygon.server: Data dir: path=/var/lib/edge
2023-05-17T10:56:00.117Z [INFO]  polygon.server: Prometheus server started: addr==127.0.0.1:9091
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x1570320]

And Service not starting due to this error

Ak162 commented 1 year ago

Hello @praetoriansentry, yes my bootstarp script is not work properly And not install node when i run script and quick deployment faced same error. Can you please check bootstarp.sh file.

Gauravk0029 commented 1 year ago

@praetoriansentry yes , when i run the ansible playbook, script is not deploying. When i try to run manual through validatore node it's giving errors like below:

fatal: [i-03a65600a90ed31b3]: FAILED! => {"changed": true, "cmd": "cd /var/lib/bootstrap\nexport PRIVATE_KEY=$(cat rootchain-wallet.json | jq -r '.HexPrivateKey')\nexport NATIVE_ERC20_ADDR=$(cat genesis.json | jq -r '.params.engine.polybft.bridge.nativeERC20Address') \nnpm install\nnode /var/lib/bootstrap/deploy-and-run.js > /var/lib/bootstrap/run-deploy-output.txt\n", "delta": "0:00:07.295354", "end": "2023-05-17 10:52:21.876678", "msg": "non-zero return code", "rc": 1, "start": "2023-05-17 10:52:14.581324", "stderr": "cat: genesis.json: No such file or directory\nnpm WARN deprecated har-validator@5.1.5: this library is no longer supported\nnpm WARN deprecated mkdirp-promise@5.0.1: This package is broken and no longer maintained. 'mkdirp' itself supports promises now, please switch to that.\nnpm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.\nnpm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142\nnpm WARN deprecated multicodec@1.0.4: This module has been superseded by the multiformats module\nnpm WARN deprecated multicodec@0.5.7: This module has been superseded by the multiformats module\nnpm WARN deprecated multibase@0.6.1: This module has been superseded by the multiformats module\nnpm WARN deprecated multibase@0.7.0: This module has been superseded by the multiformats module\nnpm WARN deprecated cids@0.7.5: This module has been superseded by the multiformats module\n/var/lib/bootstrap/node_modules/web3-core-helpers/lib/errors.js:125\n return new Error('This contract object doesn\'t have address set yet, please set an address first.');\n ^\n\nError: This contract object doesn't have address set yet, please set an address first.\n at Object.ContractNoAddressDefinedError (/var/lib/bootstrap/node_modules/web3-core-helpers/lib/errors.js:125:16)\n at Object._processExecuteArguments (/var/lib/bootstrap/node_modules/web3-eth-contract/lib/index.js:746:22)\n at Object._executeMethod (/var/lib/bootstrap/node_modules/web3-eth-contract/lib/index.js:762:68)\n at file:///var/lib/bootstrap/deploy-and-run.js:19:102\n\nNode.js v18.16.0", "stderr_lines": ["cat: genesis.json: No such file or directory", "npm WARN deprecated har-validator@5.1.5: this library is no longer supported", "npm WARN deprecated mkdirp-promise@5.0.1: This package is broken and no longer maintained. 'mkdirp' itself supports promises now, please switch to that.", "npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", "npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142", "npm WARN deprecated multicodec@1.0.4: This module has been superseded by the multiformats module", "npm WARN deprecated multicodec@0.5.7: This module has been superseded by the multiformats module", "npm WARN deprecated multibase@0.6.1: This module has been superseded by the multiformats module", "npm WARN deprecated multibase@0.7.0: This module has been superseded by the multiformats module", "npm WARN deprecated cids@0.7.5: This module has been superseded by the multiformats module", "/var/lib/bootstrap/node_modules/web3-core-helpers/lib/errors.js:125", " return new Error('This contract object doesn\'t have address set yet, please set an address first.');", " ^", "", "Error: This contract object doesn't have address set yet, please set an address first.", " at Object.ContractNoAddressDefinedError (/var/lib/bootstrap/node_modules/web3-core-helpers/lib/errors.js:125:16)", " at Object._processExecuteArguments (/var/lib/bootstrap/node_modules/web3-eth-contract/lib/index.js:746:22)", " at Object._executeMethod (/var/lib/bootstrap/node_modules/web3-eth-contract/lib/index.js:762:68)", " at file:///var/lib/bootstrap/deploy-and-run.js:19:102", "", "Node.js v18.16.0"], "stdout": "\nadded 335 packages, and audited 336 packages in 7s\n\n53 packages are looking for funding\n run npm fund for details\n\n6 moderate severity vulnerabilities\n\nTo address all issues (including breaking changes), run:\n npm audit fix --force\n\nRun npm audit for details.", "stdout_lines": ["", "added 335 packages, and audited 336 packages in 7s", "", "53 packages are looking for funding", " run npm fund for details", "", "6 moderate severity vulnerabilities", "", "To address all issues (including breaking changes), run:", " npm audit fix --force", "", "Run npm audit for details."]}

praetoriansentry commented 1 year ago

I think there are different issues going on for different people. I think it's best if in each case you destroy your current environment and do a full reprovision based on the latest code in main. The most common issue I've seen is that the bootstrap doesn't run properly either due to missing the --unlock flag when using cast or issues with funding on the root chain (especially when using Mumbai or some other testnet).

I would try pulling the latest code and resetting your environment.

Gauravk0029 commented 1 year ago

@praetoriansentry Thanks for your update, i have setup the mumbai testnet branch and it's working fine. Now i will also try with main branch.