w3f / polkadot-validator-setup

Polkadot Validator Secure Setup
Apache License 2.0
217 stars 130 forks source link

Task Polkadot-validator : initialize server keys fails #113

Closed trungngv closed 3 years ago

trungngv commented 3 years ago

I am running ansible to secure the validator as instructed, but it fails at per the below message

TASK [polkadot-validator : initialize server keys] ***** fatal: [IP_ADDRESS]: FAILED! => {"changed": false, "content": "", "msg": "Status code was -1 and not [200]: Request failed: <urlopen error [Errno 111] Connection refused>", "redirected": false, "status": -1, "url": "http://localhost:9933"} to retry, use: --limit @/root/blockchain/ksm_validators/ansible/main.retry

I don't know what this error is and how can it be resolved? Please help.

Thank you.

RomeroYang commented 3 years ago

same issue, waiting for help...

RomeroYang commented 3 years ago

I am running ansible to secure the validator as instructed, but it fails at per the below message

TASK [polkadot-validator : initialize server keys] ***** fatal: [IP_ADDRESS]: FAILED! => {"changed": false, "content": "", "msg": "Status code was -1 and not [200]: Request failed: <urlopen error [Errno 111] Connection refused>", "redirected": false, "status": -1, "url": "http://localhost:9933"} to retry, use: --limit @/root/blockchain/ksm_validators/ansible/main.retry

I don't know what this error is and how can it be resolved? Please help.

Thank you.

I just researched the source code of substrate. This error was cause by the --rpc-methods=Unsafe param here: https://github.com/w3f/polkadot-secure-validator/blob/65e8cf3b99bf32d238c90acd257f8c808ef030ef/ansible/roles/polkadot-validator/templates/polkadot.service.j2#L12

Just change it to lower case: --rpc-methods=unsafe, and the rpc-service will listen on 9933 port.

zcryptox commented 3 years ago

same issue, tried changing it to lower case: --rpc-methods=unsafe but still getting the error. waiting for help fatal: [xx.xx.xx.xx]: FAILED! => {"changed": false, "elapsed": 0, "msg": "Status code was -1 and not [200]: Request failed: <urlopen error [Errno 111] Connection refused>", "redirected": false, "status": -1, "url": "http://localhost:9933"}

simplyvj commented 3 years ago

+1 with this issue

the-love-guru commented 3 years ago

Anyone know why this happens? I am using GCP. Thanks

ilijad1 commented 3 years ago

Other than --rpc-methods=Unsafe issue, there might be issues with the naming format or the start command.

Refer to the process log to gather the exact issue. If its configured trough SystemD check with journalctl -f -n 550 -u polkadot.service

the-love-guru commented 3 years ago

I have updated the --rpc-methods=Unsafe to --rpc-methods=unsafe which made no different.

It's failing on this Ansible step: https://github.com/w3f/polkadot-secure-validator/blob/65e8cf3b99bf32d238c90acd257f8c808ef030ef/ansible/roles/polkadot-validator/tasks/session.yml#L17

All the other tasks work. For troubleshooting I jumped onto the host and tried to telnet to http://localhost:9933 and the connection timed out / got denied.

I will log on and check the process log now. Thanks for getting back to us.

Vj

the-love-guru commented 3 years ago

FIXED! Thanks @TickBrick that enabled to me to see that I had --name set in the main.json file when it wasnt actually needed as it was trying to set the name twice.

I just removed --name which I had added and it worked a treat :)

tweak96 commented 3 years ago

Using ansible and have the same issue

fatal: []: FAILED! => {"changed": false, "content": "", "msg": "Status code was -1 and not [200]: Request failed: <urlopen error [Errno 111] Connection refused>", "redirected": false, "status": -1, "url": "http://localhost:9933"} to retry, use: --limit @/home/ansible_user/polkadot-secure-validator/ansible/main.retry

tried changing --rpc-methods=unsafe but no luck.

Any sloutions?

lamafab commented 3 years ago

@tweak96 Hi, sorry for the late response. What does sudo journalctl -u polkadot.service say? The issues mentioned above have been fixed. Do you by any chance use a custom db path?

Ohmarr commented 3 years ago

FIXED! Thanks @TickBrick that enabled to me to see that I had --name set in the main.json file when it wasnt actually needed as it was trying to set the name twice.

I just removed --name which I had added and it worked a treat :)

If using ansible, comment out the line in below in the inventory.yml file:

node_name='Alice Validator'

Ohmarr commented 3 years ago

NOTE: the original file in the repo is 'inventory.sample', but was renamed to 'inventory.yml'