energywebfoundation / ewc-validator-node-install-scripts

EWC and Volta affiliate validator node installation scripts
https://energyweb.org/
GNU General Public License v3.0
6 stars 19 forks source link

iptables: No chain/target/match by that name. #26

Open ni3gavhane opened 4 years ago

ni3gavhane commented 4 years ago

Issue: Some validator organization are commenting following lines in the installation scripts which results into unexpected end of the installation script. line 65 to 68

echo "Securing SSH..." writeSShConfig semanage port -a -t ssh_port_t -p tcp 2222 service sshd restart

Result: parity-keygen parity-keygen Creating docker-stack_parity-telemetry_1 ... done Creating docker-stack_nodecontrol_1 ... done Creating docker-stack_parity_1 ... done Waiting 30 sec for parity to come up and generate the enode... Redirecting to /bin/systemctl restart telegraf.service Setting up firewall iptables: No chain/target/match by that name. iptables: Directory not empty. iptables: Chain already exists. iptables: No chain/target/match by that name.

Expected Outcome: Script should end with a proper installation summary.

Details: Installation Script: CentOS: https://github.com/energywebfoundation/ewc-validator-node-install-scripts/blob/master/volta-affiliate/install-validator-centos-7-volta.sh Ubuntu: https://github.com/energywebfoundation/ewc-validator-node-install-scripts/blob/master/volta-affiliate/install-validator-ubuntu-server-18.04-volta.sh

kazmen1983 commented 4 years ago

which distribution you are using? Is this CentOS ?

ni3gavhane commented 4 years ago

One of the member has this problem on CentOS.

kazmen1983 commented 4 years ago

it looks like iptables problem. Can they start script with the bash -x ./install-validator-centos-7-volta.sh and copy output?

Juanyyo82 commented 4 years ago

Hi, Is a virtual server in a local ESX server, with ubuntu 18.04.2 (install-validator-ubuntu-server-18.04-volta.sh). I did the instalation installation from scratch, fresh ubuntu server and full update OS. I have tu put in line 178 "--no-check-certificate", Because we have a proxy server and the installation display this error: "ERROR: cannot verify raw.githubusercontent.com's certificate, issued by ‘CN=Myproxy’:" Is there any problem to install the centos script in a rhel 7 OS? Regards

bartcoelus commented 4 years ago

Hi. It was me facing this issues. First of all important: we configured our SSH on port 2222. The script reconfigures SSH - but can't handle if the config is already set to 2222. Next to that we had a hard time with IPtables

iptables: No chain/target/match by that name. iptables: Directory not empty. iptables: Chain already exists. iptables: No chain/target/match by that name.

bartcoelus commented 4 years ago

still unsolved... waiting for further instructions - Rodger

kazmen1983 commented 4 years ago

I was asking for the running script with bash -x so I can look which Iptables rules are failing.

bartcoelus commented 4 years ago

docker: Error response from daemon: driver failed programming external connectivity on endpoint parity-keygen (59f......): Bind for 127.0.0.1:8545 failed: port is already allocated.

bartcoelus commented 4 years ago

not sure if this is due a previous version/deamon running... also I removed the key-info from this post (59f....) since I don't want to reveal anything harmfull in public

ni3gavhane commented 4 years ago

@bartcoelus can you please post the complete log. you can do something like following: ./installation_script.sh 2>&1 | tee debug.log

and share the debug.log

Also, it seems the parity instance is already running that is why you get the last error. check that with the following command:

ps aux | grep parity

if you see processes running, kill them with kill -9 <PID>

then remove the docker-stack folder rm -rf docker-stack and re-run the script.

bartcoelus commented 4 years ago

done that - can I send you the debug.log somewhere outside github. I don't think we want all this stuff on this public page

kazmen1983 commented 4 years ago

Client sended e-mail that now validator install works.

bartcoelus commented 4 years ago

Let's share important learnings from our case:

  1. The script defines port 2222 - since our firewall and SSH was already configured to use that port we needed to comment these lines. Maybe a good idea to throw-catch the event if the connection is already on that port.
  2. Needed to kill the docker containers in memory in order to clean up a failed install
  3. Important is to make sure the user operates from a root directory and not to install as default root
  4. We'd not recommend to name the node with IP-adress as default suggested in the script. When the IP adress ever changes it can cause confusion.
  5. Removal of docker-directories and spool files is needed in the case you need to redo the install. I refer to the wiki - it contains the directories and files that need to be removed at a failed attempt. https://energyweb.atlassian.net/wiki/spaces/EWF/pages/702513299/Volta+Setting+Up+a+New+Validator+Node