PDA

View Full Version : PostgreSQL failure - Combo Installer?



bL1z
06-01-2011, 06:49 PM
When starting HM, I received this error: Failed to establish a connection to '127.0.0.1'.

I have tried literally everything to fix the problem (add lines to 'hosts', reinstall PostgreSQL etc etc etc) but nothing seems to work.

When trying to reinstall PostgreSQL, I had to provide a password. I knew the password, but it didn't work. So I had to delete my account and create a new one. Now I'm not even sure what happened, but I think I messed up. I kept on doing random shit in order to fix the problem. That didn't quite work out (wasn't very smart either). Now what? Do I have to create a new, proper PostgreSQL user or something?

Using your Combo Installer may fix the problem, but will I lose my HM databases? My databases consist of millions of hands and losing them would be a nightmare.

Any help is very much appreciated, so thanks in advance.

Patvs
06-01-2011, 07:53 PM
To fix the initial problem:


This is usually a firewall or windows update issue.

First try to reboot.

If no help, try this:

Start > Programs > PostgreSQL > 8.x > Stop Service

Start > Programs > PostgreSQL > 8.x > Start Service

If that doesnt help delete the \postgresql\8.x\data\postmaster.pid file, if you see it. And reboot. (this .pid file trick usually fixes it)


-----


Which Operating System, Firewall, and Anti-Virus are you using?

Please update to the latest beta - http://www.holdemmanager.com/Downloads/HmUpdate.exe

For W7 and Vista you must set \holdem manager\dbcontrolpanel.exe, holdemmanager.exe and hmhud.exe are started as administrator. Run the windows explorer and navigate to your Holdemmanager installation directory. Right click the executables and select properties... then select "Run as admin" from the compatibility tab.

Turn off User Account Control completely and reboot: How to Disable and Turn Off UAC in Windows 7 « My Digital Life (http://www.mydigitallife.info/2008/12/30/how-to-disable-and-turn-off-uac-in-windows-7/)

Add exceptions to the windows firewall for those files, even if the firewall is turned off. Do the same for pg_ctl.exe and postgres.exe (in the PostgreSQL/8.x/bin folder)



-----



If that doesn't help you will have to reinstall PostgreSQL completely.
If it doesn't accept 'postgrespass' as password, delete the postgres user first.




Use the manual installer from PostgreSQL: The world's most advanced open source database (http://www.postgresql.org)
All your hands are in a PostgreSQL 8.4.x database?
Which error do you get when you reinstall it with the manual installer?

If you install SQL 9.0.4 to port 5433 will it run, or do you get a similar error during the installation??

bL1z
06-02-2011, 08:04 AM
Alright, nothing seems to work and I'm getting more and more frustrated.
However, I do think I know what's wrong.

I've made a back-up of my PostgreSQL data folder, but I didn't follow these instructions (http://faq.holdemmanager.com/questions/368/Move+Database+to+Another+Hard+Drive+or+Partition), I simply copy/pasted the whole folder to an external hard disk.

Does this mean the database is broken/corrupt? I really hope not, because I will probably have to quit online poker.

netsrak
06-02-2011, 10:15 AM
If its so important for you you hopefully do regular database backups and backupped your database before trying to move it?

What happens if you move the data folder back to its original location and restart the postgresql service? Does it work?

If not please try to download and install the same postgresql version as you used before following this FAQ: http://faq.holdemmanager.com/questions/71/Reinstall+PostgreSQL+Preserving+Old+Database

bL1z
06-02-2011, 11:00 AM
I did not do regular database back-ups (yeah yeah, not smart). I wasn't able to back-up my database before trying to move it, because both HM and PostgreSQL stopped working. All I could do was copy my 'data' folder to an external harddisk, which is what I did.

I reinstalled PostgreSQL and copy/replaced the existing data folder with the one on my external harddisk. PostgreSQL seems to work again, however, HM still doesn't work. I'm getting the following message when starting up:

"The following error occurred when trying to open the database: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host."

I think that's because I didn't follow the correct procedure of exporting and importing an existing database. Is there any way to fix this? :( My hopes aren't high at this point.

bL1z
06-02-2011, 11:14 AM
I deleted the file postmaster.pid and rebooted my computer.

Now PostgreSQL doesn't work anymore. When I try to connect to the server (pgAdmin III) it says:


Server doesn't listen

The server doesn't accept connections: the connection libray reports

could not connect to server: Connection refused (0x000027D/10061) Is the server running on host "127.0.0.1" and accepting TCP/IP connections on port 5432?

It implies that there's a firewall problem, but that's not true.
Now what?

bL1z
06-02-2011, 03:27 PM
How do I enable database clustering when installing PostgreSQL 8.4?
It's easy in 8.3, but I cannot see the same option in version 8.4.

edit: nvm.

bL1z
06-02-2011, 06:45 PM
When checking the PostgreSQL log, I found this:

Could not open file "pg_clog/0000": Permission denied.

What does that mean?

Sorry for my double-posts btw, but if I keep on editing my initial post, things will get messy.

Patvs
06-02-2011, 07:17 PM
You have a backup (/data folder) of a PostgreSQL 8.3 database (copied to an external harddisk)


-1 You copied the /data folder back to your computer.
-2 Reinstall PostgreSQL 8.3 to that folder
(don't install PostgreSQL 8.3 first, but install it after you've copied the /data folder, so it will detect the /data folder and detect the old database)

pg_clog/0000": Permission denied: Do you also still have your original handhistories? On which pokersite were all these hands played?

Copying the /data folder, is probably the worst method to "backup" your database. Since re-connecting to that database often fails.
(better backup is creating a .backup file in pgadminIII or using the HoldemManager Backup & Restore utility)

If you can get your hands on the original handhistories, I strongly suggest to install SQL 8.4.x (or 9.0.x) and reimport all the handhistories into a new empty database.

bL1z
06-02-2011, 07:22 PM
edit: I'm using 8.4 now btw, not 8.3.
I tried 8.3, but it said the existing database has another version (8.4).



-2 Reinstall PostgreSQL 8.3 to that folder
(don't install PostgreSQL 8.3 first, but install it after you've copied the /data folder, so it will detect the /data folder and detect the old database)
That's what I did.


pg_clog/0000": Permission denied: Do you also still have your original handhistories? On which pokersite were all these hands played?
I'm afraid not. Just checked my HMArchive folder, but it's empty..
The hands were played at FTP and William Hill. I can probably request some hands through support, but not millions..


Copying the /data folder, is probably the worst method to "backup" your database. Since re-connecting to that database often fails.
(better backup is creating a .backup file in pgadminIII or using the HoldemManager Backup & Restore utility)
I know, but that's the only thing I was able to do. PostgreSQL and HM didn't work, so I had to copy/paste the data folder.

So there's nothing I can do now?

Patvs
06-02-2011, 07:36 PM
FullTilt has every hand you've ever played (2006-2011), so they can sent you those files if you email them. They may not have hands played before 2006 anymore. (2003-2006)

How large is your /data folder?
How large is your /data/pg_log folder?


Which Operating System, Firewall, and Anti-Virus are you using?

For W7 and Vista you must set \holdem manager\dbcontrolpanel.exe, holdemmanager.exe and hmhud.exe are started as administrator. Run the windows explorer and navigate to your Holdemmanager installation directory. Right click the executables and select properties... then select "Run as admin" from the compatibility tab.
Afterwards turn off User Account Control completely and reboot: How to Disable and Turn Off UAC in Windows 7 « My Digital Life (http://www.mydigitallife.info/2008/12/30/how-to-disable-and-turn-off-uac-in-windows-7/)


Add exceptions to the windows firewall for those files, even if the firewall is turned off. If you have a 3rd party firewall, do the equivalent or uninstall it temporarily. Also set exceptions to pg_ctl.exe, postgres.exe (in the PostgreSQL/8.x/bin folder)



Try to create a folder like: C:/PostgreSQL/8.x/data
(just make sure it's NOT a subfolder of the Program Files folder)
Move the data/ backup you have to this folder
Delete the system registry entries directing to the Program Files/PostgreSQL folder. And to the old port number (probably 5432)

Then reinstall it to this new location. And using a different port number (5433)
(this really is the trick for PostgreSQL to detect and connect to the database in the old /data folder again).

Patvs
06-02-2011, 07:38 PM
Which version of PostgreSQL were you using before when you made the backup of the /data folder.

PostgreSQL 8.3 is not compatible with 8.4.
So if you were using 8.3 before. Also now install 8.3 again.
If you were using 8.4. Install 8.4.

bL1z
06-02-2011, 07:44 PM
How large is your /data folder?
How large is your /data/pg_log folder?
- 23.8GB
- <1MB


Try to create a folder like: C:/PostgreSQL/8.x/data
(just make sure it's NOT a subfolder of the Program Files folder)
Move the data/ backup you have to this folder
Delete the system registry entries directing to the Program Files/PostgreSQL folder. And to the old port number (probably 5432)
Could you be more specific about the bold part? I'm not quite sure what files to delete.

bL1z
06-02-2011, 07:45 PM
Which version of PostgreSQL were you using before when you made the backup of the /data folder.

PostgreSQL 8.3 is not compatible with 8.4.
So if you were using 8.3 before. Also now install 8.3 again.
If you were using 8.4. Install 8.4.
I know, that's what I said. ;)

Patvs
06-02-2011, 08:14 PM
Delete the system registry entries directing to the Program Files/PostgreSQL folder. And to the old port number (probably 5432)




Manually run regedit
Search for PostgreSQL
Press F3 to go to the next key.

Example key it should find:
Computer/HKEY_Current_user/software/pgadminIII/server/

Delete every reference to:
C:/Program Files(x86)/PostgreSQL
and port 5432

So the next time you install PostgreSQL if will give you to option to
-1 pick a new location for the install folder (and data folder)
-2 pick a new port number

bL1z
06-02-2011, 08:29 PM
So the next time you install PostgreSQL if will give you to option to
-1 pick a new location for the install folder (and data folder)
-2 pick a new port number
I removed all register referenced and I'm trying to reinstall PostgreSQL.
How do I pick a new port number?

bL1z
06-02-2011, 09:01 PM
I changed the port number through pgAdmin III, but it still gives the same error when trying to connect to the server..

Patvs
06-02-2011, 10:50 PM
Probably a corrupt index in the database.

(I'm hoping you don't have tons of HoldemManager notes in that database, or have a backup of your notes)

Email Full Tilt and request all your handhistories.
And import them into a new database.

bL1z
06-03-2011, 07:22 AM
Probably a corrupt index in the database.

(I'm hoping you don't have tons of HoldemManager notes in that database, or have a backup of your notes)

Email Full Tilt and request all your handhistories.
And import them into a new database.
I though HM notes were being saved in HM.. :( Things are getting worse.

Even if FTP/WH send me all my HH, there will still be xxxK purchased hands missing + hundreds and hundreds of notes gone.

Anyway, thx for trying to help.

bL1z
06-04-2011, 11:38 AM
I've manually opened port 5432 through Windows Firewall, but I'm not sure it's really open.
When I go to cmd and type 'netstat -ano', I can't see '127.0.0.1:5432'. Does anyone know how to fix this?

Patvs
06-04-2011, 07:17 PM
I ran netstat -ano.. and it's also not showing the 5432 port number on my computer, so this seems normal.
It will show several 127.0.0.1 listings all with other ports.

bL1z
06-05-2011, 06:25 AM
PostgreSQL is finally running again.
Now I need to know how to correctly import my old /data folder, so I can use my original database again.

Copy/replacing the existing /data folder doesn't work.

I saw someone on this forum who had the same problem, and solved it by doing this (http://forums.holdemmanager.com/manager-general/31333-copy-paste-data-folder-postgres-doesnt-backup.html#post150627).

However, that doesn't work for me.
Does anyone know the solution?

Patvs
06-05-2011, 07:47 PM
copy "old" data folder to new PostgreSQL data folder
go to the data folder and delete these files
postmaster.opts
postmaster.pid (if exists)
postgresql.bak


Then reinstall PostgreSQL.
During the installation it should detect the old database.
If it doesn't, create a new database and reimport the original handhistories.