pi-node / instructions

253 stars 153 forks source link

Pi node Postgres not starting #89

Open victormotaferreira opened 3 years ago

victormotaferreira commented 3 years ago

I have Windows 10 Pro. Everything is working and consensus starts to run but is stuck at postgres check:

pi-consensus container log: pinetwork/pi-node-docker:latest

everything ok, until:

init-postgres:ok waiting for postgres to be available waiting for postgres to be available

I already tested cleaning the blockchain data, and deleting the container, but it restarts and repeats the same error. Some problem with docker? Some way to fix this manually? Thanks in advance four any sugestions!

nicolae788 commented 3 years ago

I had the same problem, but was manifesting on Windows server. After i went with Windows 10 Pro everything worked. Follow these instructions " https://github.com/pi-node/instructions/wiki/(EN)-New-instructions-for-docker-desktop-with-wsl2-(windows-2004) " or check the following

  1. Latest version of Docker.
  2. Pi Node downloaded from official source.
  3. Give full permissions to Everyone on Pi Network folder ( C;\Users{youruser}\AppData\Roaming\Pi.... )
  4. Open ports 31400-31409 in windows firewall for incoming and outgoing.
victormotaferreira commented 3 years ago

Hi nicolae, thanks for the help: 1- updated Docker 2 - Pi Node is the official site version 3 - Gave permissions to everyone 4 - Ports where opened and checked (everything green in the tech setup) 5 - Deleted the container, removed the imge in docker and restarted Pi Node to make sure i had the last image downloaded. The problem persists! (waiting for postgres to be available) :-(

nicolae788 commented 3 years ago

Are you using Hyper-V ?

victormotaferreira commented 3 years ago

With your help I Solved it: the problem was between the keyboard and the chair :-) I completed all the steps in the web link, and finnaly i understood i missed a check box! I had to turn on the WSL2 integration button, in the docker desktop "general" settings!! Sometimes you just have to follow the flight checklist twice hehe. Cheers!

nicolae788 commented 3 years ago

:) cheers. I am glad that you solved it. Ports open in windows firewall are not necessary as docker does a NAT between your computer network interface and the virtual one. In Win firewall docker already has permissions for tcp and udp. I just checked the connection with telnet and disabled the manual rules i have set for the Pi ports. It was redundant without a need to be !

Zantiki commented 3 years ago

Hey guys, I'm running the container on Hyper-V and I've been having the same trouble as describe in the original post. I've been able to circumvent the issue by manually restarting postgresql within the container. For anybody else that might be having this problem, you temporarily fix it like this:

  1. Open docker desktop and press the terminal icon next to the running pi-consensus container.
  2. In the shell that opens, type the following: service postgresql restart
  3. Once it confirms the restart of postgresql you can close the terminal
  4. Check out the troubleshooting section in Pi-node client, and you should now be catching up to the network.
  5. This is not the ideal solution, as you need to do this every time. I honestly have no idea why this is happening, since postgresql is already up and running when the container starts. If you guys have any idea if this is somehow caused by weird behavior with the networking, please let me know :)
osontungo commented 1 year ago

postgresql entered FATAL state, too many start retries too quickly