Page 1 of 2 12 LastLast
Results 1 to 15 of 20
  1. #1
    Join Date
    Apr 2009
    Posts
    11

    Unanswered: Installation won't work! PostgreSQL

    Hi everyone, thanks in advance. I'm using Win XP and trying to install PostgreSQL 8.3, i've read the DOCs and followed every step carefully, everything seems to be right on the progress bar untill it stucks and prompts: "Failed to run initdb: 1! Please see the logfile in "blabla"\tmp\initdb.log"

    So here it is:

    The files belonging to this database system will be owned by user "SYSTEM".
    This user must also own the server process.

    The database cluster will be initialized with locale Spanish_Spain.1252.
    The default text search configuration will be set to "spanish".

    creating directory C:/Archivos de programa/PostgreSQL/8.3/data ... ok
    creating subdirectories ... ok
    selecting default max_connections ... 10
    selecting default shared_buffers/max_fsm_pages ... 400kB/20000
    creating configuration files ... ok
    creating template1 database in C:/Archivos de programa/PostgreSQL/8.3/data/base/1 ... child process exited with exit code 1
    initdb: removing data directory "C:/Archivos de programa/PostgreSQL/8.3/data"



    After this, i've tried installing the Postgres Plus Advanced Server 8.3, using operating system local and encoding (by default)...and bang, it won't install either! Thanks to this try, i think i've taken more information about what the real problem is...but i can't go any further. This is thi error i get in postgresplus instalation:

    (Apr 7, 2009 1:49:07 PM), Install, com.enterprisedb.isaction.InitDBFailAction, err, ProductException: (error code = 601; message="Initdb Failed"; additional data = [Data folder [C:\PostgresPlus\8.3AS\data] does not exist.])
    STACK_TRACE: 12
    ProductException: (error code = 601; message="Initdb Failed"; additional data = [Data folder [C:\PostgresPlus\8.3AS\data] does not exist.])
    [and a lot more of junk here, useless in my opinion]

    Install logs are showing:
    ---- initout.txt:
    Calling initdb as user enterprisedb...
    Initializing Database Cluster

    C:\PostgresPlus\8.3AS\dbserver\scripts-win>"C:\PostgresPlus\8.3AS\dbserver\bin\initdb" --pwfile=password.txt -U enterprisedb -D "C:\PostgresPlus\8.3AS\data" -A md5 --locale="Spanish_Spain.1252" --encoding= 1>"C:\PostgresPlus\8.3AS\dbserver\..\install_logs\ initdb_stdout.txt" 2>"C:\PostgresPlus\8.3AS\dbserver\..\install_logs\ initdb_stderr.txt"
    Done!


    ---- initdb_stderr.txt: (this is the one i found interesting)
    2009-04-07 15:49:05 WARNING: could not query value for 'std' to identify Windows timezone: 2
    2009-04-07 15:49:05 WARNING: could not find a match for Windows timezone "Hora de verano romance"
    el proceso hijo terminó con código de salida 1
    initdb: eliminando el directorio de datos «C:/PostgresPlus/8.3AS/data»



    ----- initdb_stdout.txt:
    Los archivos de este cluster serán de propiedad del usuario «Administrador».
    Este usuario también debe ser quien ejecute el proceso servidor.
    El cluster será inicializado con configuración local Spanish_Spain.1252.

    creando el directorio C:/PostgresPlus/8.3AS/data ... hecho
    creating subdirectories ... hecho
    seleccionando el valor para max_connections ... 10
    selecting default shared_buffers/max_fsm_pages ... 400kB/20000
    creando archivos de configuración ... hecho
    creando base de datos template1 en C:/PostgresPlus/8.3AS/data/base/1 ...



    and initerr.txt is void


    I've changed my zone time, changed coding values diferent thant UTF8...i dont know what more can i do! Please guys help me out.

    Thank you! Looking forward to see your replies.

  2. #2
    Join Date
    Nov 2003
    Posts
    2,934
    Provided Answers: 12
    This sound like the permissions on the data directory are such that the postgres (Windows) user cannot write to that directory.

    The postgres user is be a non-admin and you are trying to put the data directory into the "Program Files" directory which is write protected for non-admins. So you should either create the data directory outside the program directory (highly recommended) or set the permissions on the data directory so that the postgres user (or "Everybody") can write to it.

    Then try to run initdb manually.

  3. #3
    Join Date
    Apr 2009
    Posts
    11
    Thanks for your answer.

    I'm not that used to postgreSQL or db software at all so it's gonna be legendary.
    I dunno how can i set permissions (i havent worked that much in windows, i didnt know win xp could set permissions, but i need this to work in this windows comp) So should i create a directory named "data"? And move in when?

    Somebody told me to create a new user named PostGres, add it to the admin group and then use it in the installation process and it didn't work either.

  4. #4
    Join Date
    Nov 2003
    Posts
    2,934
    Provided Answers: 12
    Quote Originally Posted by nmaxcom
    I dunno how can i set permissions (i havent worked that much in windows, i didnt know win xp could set permissions, but i need this to work in this windows comp)
    Use your favorite search engine, the internet is full of examples.

    So should i create a directory named "data"? And move in when?
    Anywhere.
    Just make sure the postgres user has read and write access to the directory (so you could leave it in the program files directory if you set the permissions correctly, it's just not recommended)

    Somebody told me to create a new user named PostGres, add it to the admin group and then use it in the installation process and it didn't work either.
    That user is most probably already created as you have run the installation once. But you can easily check if the user already exists using the control panel

  5. #5
    Join Date
    Apr 2009
    Posts
    11
    Ok, i searched and my windows is not set up for using file nor directory permissions. However the user i created should have full permission since i created it on the admin group.
    I gave another path for the data (C:\data) in the installation progress and i get this:

    (Apr 7, 2009 4:13:17 PM), Install, com.enterprisedb.isaction.InitDBFailAction, err, An error occurred and product installation failed. Look at the log file C:\PostgresPlus\8.3AS\log.txt for details.
    (Apr 7, 2009 4:13:17 PM), Install, com.enterprisedb.isaction.InitDBFailAction, err, ProductException: (error code = 601; message="Initdb Failed"; additional data = [Contents of data folder [C:\data] are invalid.])
    STACK_TRACE: 12
    ProductException: (error code = 601; message="Initdb Failed"; additional data = [Contents of data folder [C:\data] are invalid.])
    at com.enterprisedb.isaction.InitDBFailAction.install (InitDBFailAction.java:108)
    at com.installshield.product.service.product.PureJava ProductServiceImpl.installProductAction(Unknown Source)
    at com.installshield.product.service.product.PureJava ProductServiceImpl$InstallProduct.getResultForProd uctAction(Unknown Source)
    at com.installshield.product.service.product.Installa bleObjectVisitor.visitComponent(Unknown Source)
    at com.installshield.product.service.product.Installa bleObjectVisitor.visitInstallableComponents(Unknow n Source)
    at com.installshield.product.service.product.Installa bleObjectVisitor.visitProductBeans(Unknown Source)
    at com.installshield.product.service.product.PureJava ProductServiceImpl$InstallProduct.install(Unknown Source)
    at com.installshield.product.service.product.PureJava ProductServiceImpl$Installer.execute(Unknown Source)
    at com.installshield.wizard.service.AsynchronousOpera tion.run(Unknown Source)
    at java.lang.Thread.run(Thread.java:595)


    initdb_stderr.txt still says:

    2009-04-07 18:13:15 WARNING: could not query value for 'std' to identify Windows timezone: 2
    2009-04-07 18:13:15 WARNING: could not find a match for Windows timezone "Hora de verano romance"
    el proceso hijo terminó con código de salida 1
    initdb: eliminando el contenido del directorio «C:/data»


    Doesn't has it something to do with the issue?
    Last edited by nmaxcom; 04-07-09 at 13:20.

  6. #6
    Join Date
    Nov 2003
    Posts
    2,934
    Provided Answers: 12
    Quote Originally Posted by nmaxcom
    Ok, i searched and my windows is not set up for using file nor directory permissions. However the user i created should have full permission since i created it on the admin group.
    That is not possible. Windows (especially XP) always uses file permissions
    It might be that FAT32 does not support this, I don't know....
    But then no one who cares for his data would use FAT32 nowadays, especially on a database server.

    You should not put the postgres user into the admin group. Earlier postgres releases actively refused to work with an admin account (for security reasons). I'm not sure if that is still the case.

    I gave another path for the data (C:\data) in the installation progress and i get this:
    Why do you repeat the installation? Did you remove the old one?
    If the installation is still there, just run initdb manually from the commandline.

    Is there anything else in the c:\Data directory?

    2009-04-07 18:13:15 WARNING: could not query value for 'std' to identify Windows timezone: 2
    Looks very weird to me, but I have no idea what that could be.

  7. #7
    Join Date
    Apr 2009
    Posts
    11
    I think data directory has remained empty in the whole process, or at least at the beginning and at the end (from initdb_stderr.txt: "initdb: eliminando el contenido del directorio «C:/data»", that is "initdb: erasing C:/data directory content"). If you take a closer look to the log:

    2009-04-07 18:13:15 WARNING: could not query value for 'std' to identify Windows timezone: 2
    2009-04-07 18:13:15 WARNING: could not find a match for Windows timezone "Hora de verano romance" (which is my zone time, i did change it just to test it and it made no difference)
    el proceso hijo terminó con código de salida 1 (child process ended with code exit 1)
    initdb: eliminando el contenido del directorio «C:/data»
    (Apr 7, 2009 4:13:17 PM), Install, com.enterprisedb.isaction.InitDBFailAction, err, ProductException: (error code = 601; message="Initdb Failed"; additional data = [Contents of data folder [C:\data] are invalid.])


    the "main error" occurs just 2 seconds after the timezone error, which i think is the reason of this mess.

    Regarding to the operating system, this comp is working on NTFS and i can't find anything related to file nor directory permissions. If I right click on the data directory it appears to be "read only" but i can't get that checkbox unchecked (when i uncheck it, close the window properties and open it up again it will show again checked, damn it), lol i'm such a jerk.

    Finally, when the installation pops up with the error, the directory (C:\PostgresPlus\8.3AS\) only has the log files, i mean, theres no other app i can work from with (initdb or whatever).

    So, what's next?

    Thanks
    Last edited by nmaxcom; 04-07-09 at 14:44.

  8. #8
    Join Date
    Apr 2009
    Posts
    11
    Regarding to the file permissions, i don't think it's the reason why it's not working. I run postgres install again (PostgreSQL std, not the "pro" one), using the same postgres user etc:

    Failed to run initdb: 1!

    And the log file

    creating directory C:/Archivos de programa/PostgreSQL/8.3/data ... ok
    creating subdirectories ... ok

    selecting default max_connections ... 10
    selecting default shared_buffers/max_fsm_pages ... 400kB/20000
    creating configuration files ... ok
    creating template1 database in C:/Archivos de programa/PostgreSQL/8.3/data/base/1 ... child process exited with exit code 1
    initdb: removing data directory "C:/Archivos de programa/PostgreSQL/8.3/data"


    So it looks to be able to make directories, right?

  9. #9
    Join Date
    Nov 2003
    Posts
    2,934
    Provided Answers: 12
    Quote Originally Posted by nmaxcom
    Regarding to the operating system, this comp is working on NTFS and i can't find anything related to file nor directory permissions. If I right click on the data directory it appears to be "read only" but i can't get that checkbox unchecked (when i uncheck it, close the window properties and open it up again it will show again checked, damn it), lol i'm such a jerk.
    Right click on the directory, select properties, then you should have a "Security" tab. You might need to turn off "Simplified security".
    I did a quick google search and the first hit that turned up was:
    How to set, view, change, or remove special permissions for files and folders in Windows XP

    You might want to read that or any other article related to directory permissions under windows.

    Finally, when the installation pops up with the error, the directory (C:\PostgresPlus\8.3AS\) only has the log files, i mean, theres no other app i can work from with (initdb or whatever).
    So there is no C:\PostgresPlus\8.3AS\bin directory?
    Then the install indeed didn't work.

    I'd try the installer directly from the Postgres site: http://www.postgresql.org/ftp/binary/v8.3.7/win32/

    Make sure you remove all trace of the previous installs before hand (e.g. deleting all the directories that were "half" created). Make sure there is no service installation left over that doesn't work.

    Before you install Postgres again,

    1) Verify that the postgres user is present. If it is, uncheck the option to create the user during installation. Make sure you know the password for that user.

    2) Create a data directory and make sure the postgres user can write to that directory, either by specifying "Everyone/Full Access" or by logging in using that user and then creating the directory manually. Make sure the postgres is user is not an admin user

    3) During installation select the "DataDir" (or something similar) option in the installer and click on "configure" (or something similar) to change the directory of that "option" (I think it's the second item in the list)

    (Sorry I don't have the installer in front of me right now, so it's a bit vague)


    If you really can't get it to work with the installer you can always download the "-binaries-no-installer" package, unzip the contents and run initdb manually.

    If you need the service to start the database server automatically you can use pg_ctl to manually create and register the service (but not until you have ran initdb successfully)

  10. #10
    Join Date
    Apr 2009
    Posts
    11
    Quote Originally Posted by shammat
    Right click on the directory, select properties, then you should have a "Security" tab. You might need to turn off "Simplified security".
    I did a quick google search and the first hit that turned up was:
    How to set, view, change, or remove special permissions for files and folders in Windows XP

    You might want to read that or any other article related to directory permissions under windows.
    Ok, i did it, and yes i can change directory permissions right now, thank you i just missed it before.

    So there is no C:\PostgresPlus\8.3AS\bin directory?
    Then the install indeed didn't work.

    I'd try the installer directly from the Postgres site: PostgreSQL: File Browser

    Make sure you remove all trace of the previous installs before hand (e.g. deleting all the directories that were "half" created). Make sure there is no service installation left over that doesn't work.
    Ok. All files and directories created are deleted. There's no service appearing on the services tap, deleted the two users i created (postgres and enterprisedb)... and i think that's all.

    Downloaded http://ftp5.es.postgresql.org/mirror...ql-8.3.7-1.zip and ready to install.


    1) Verify that the postgres user is present. If it is, uncheck the option to create the user during installation. Make sure you know the password for that user.
    Ok then i create "postgres" again, inside the normal "users" group.

    2) Create a data directory and make sure the postgres user can write to that directory, either by specifying "Everyone/Full Access" or by logging in using that user and then creating the directory manually. Make sure the postgres is user is not an admin user
    Ok, i gave the group "users" full access to this directory (even that i still can't make it not be read only, sigh, but i can't do this to any directory in this comp dunno why, whatever)


    3) During installation select the "DataDir" (or something similar) option in the installer and click on "configure" (or something similar) to change the directory of that "option" (I think it's the second item in the list)
    In the installation files i downloaded (psql standard), there's no option to select a special directory for the data directory (so yes, i got the same error)

    Installing Postgres Plus, i got also the same error (additional data = [Contents of data folder [C:\data] are invalid.])

    If you really can't get it to work with the installer you can always download the "-binaries-no-installer" package, unzip the contents and run initdb manually.

    If you need the service to start the database server automatically you can use pg_ctl to manually create and register the service (but not until you have ran initdb successfully)

    I created a C:\pgsql\ directory, with full access to everyone, created a C:\pgsql\data and then run "initdb -D "..\data"":

    Code:
    WARNING:  could not query value for 'std' to identify Windows timezone: 2
    WARNING:  could not find a match for Windows timezone "Hora de verano romance"
    hecho
    
    ATENCIÓN: activando autentificación «trust» para conexiones locales.
    Puede cambiar esto editando pg_hba.conf o usando el parámetro -A
    la próxima vez que ejecute initdb.
    
    Completado. Puede iniciar el servidor de bases de datos usando:
    
        "postgres" -D "../data"
    o
        "pg_ctl" -D "../data" -l archivo_de_registro start
    
    C:\pgsql\bin>runas /user:Usuarios\postgres "postgres.exe -D "../data""
    Escriba la contraseña para Usuarios\postgres:
    Intentando iniciar postgres.exe -D ../data como usuario "Usuarios\postgres" ...
    
    C:\pgsql\bin>
    A cmd window appear and disappear in a blink of an eye so i can't read anything on it... did it work?

  11. #11
    Join Date
    Nov 2003
    Posts
    2,934
    Provided Answers: 12
    Quote Originally Posted by nmaxcom
    In the installation files i downloaded (psql standard), there's no option to select a special directory for the data directory (so yes, i got the same error)
    I'm 100% there is an option (because I always use it). Check out the screenshot I have attached.

    You may also want to walk through the description here: http://pginstaller.projects.postgresql.org/

    I created a C:\pgsql\ directory, with full access to everyone, created a C:\pgsql\data and then run "initdb -D "..\data"":
    Hmm, as I have already said: I don't think it's a good idea to make the data dir a sub-directory of the installation dir

    ATENCIÓN: activando autentificación «trust» para conexiones locales.
    Puede cambiar esto editando pg_hba.conf o usando el parámetro -A
    la próxima vez que ejecute initdb.

    Completado. Puede iniciar el servidor de bases de datos usando:

    "postgres" -D "../data"
    o
    "pg_ctl" -D "../data" -l archivo_de_registro start

    C:\pgsql\bin>runas /user:Usuarios\postgres "postgres.exe -D "../data""
    Escriba la contraseña para Usuarios\postgres:
    Intentando iniciar postgres.exe -D ../data como usuario "Usuarios\postgres"
    I have not idea what it says (I don't speak spanish) so I can't tell whether this was successful.

    A cmd window appear and disappear in a blink of an eye so i can't read anything on it... did it work?
    Well, if you have a process postgres.exe running, then yes.

    Check the content of the data directory. It should have the following content:
    Code:
    base\
    global\
    pg_clog\
    pg_log\
    pg_multixact\
    pg_subtrans\
    pg_tblspc\
    pg_twophase\
    pg_xlog\
    PG_VERSION
    pg_hba.conf
    pg_ident.conf
    postgresql.conf
    postmaster.opts
    postmaster.pid
    The names with trailing \ are directories the others are files. postpaster.pid and postmaster.opts may not be there.
    Attached Thumbnails Attached Thumbnails pginst3.png  

  12. #12
    Join Date
    Apr 2009
    Posts
    11
    Quote Originally Posted by shammat
    I'm 100% there is an option (because I always use it). Check out the screenshot I have attached.

    You may also want to walk through the description here: PostgreSQL Installer

    Hmm, as I have already said: I don't think it's a good idea to make the data dir a sub-directory of the installation dir
    Thanks, I found the option (it's just it was showing kind of hidden in spanish) i created a data directory outside the main directory (in C:\pgsqldata\), with full access and it didn't work:

    Code:
    The files belonging to this database system will be owned by user "SYSTEM".
    This user must also own the server process.
    
    The database cluster will be initialized with locale Spanish_Spain.1252.
    The default text search configuration will be set to "spanish".
    
    fixing permissions on existing directory C:/pgsqldata ... ok
    creating subdirectories ... ok
    selecting default max_connections ... 10
    selecting default shared_buffers/max_fsm_pages ... 400kB/20000
    creating configuration files ... ok
    creating template1 database in C:/pgsqldata/base/1 ... child process exited with exit code 1
    initdb: removing contents of data directory "C:/pgsqldata"
    I have not idea what it says (I don't speak spanish) so I can't tell whether this was successful.
    Sorry, it just says something like "Completed. You can now run db server using: "postgres" -D C:/pgsqldata". This directory's screen is attached.

    Ok so i run it:

    Code:
    C:\pgsql\bin>runas /user:Usuarios\postgres "postgres.exe -D "C:\pgsqldata\"
    Type Usuarios\postgres password:
    Trying to run postgres.exe -D C:\pgsqldata" as user "Usuarios\postgres
    " ...
    
    C:\pgsql\bin>
    And i've tried this with postgres, initdb, pg_ctl...and nothing. No answer and no postgres running.

    This new cmd shows up and disappears, probably showing some kind of mistake because there's no process such as "postgres" running.

    Damn it!!!!!!!!!!! Why is it so hard to get this running?? FUCK!

    What can we try now?
    Attached Thumbnails Attached Thumbnails sqldata.jpg  

  13. #13
    Join Date
    Apr 2009
    Posts
    11
    I can't believe it, i think we made it!

    I though i could see the cmd popups by loging in as "postgres" user, and started typing the same (without the annoying "runas")

    Code:
    C:\pgsql\bin>initdb.exe -D C:\pgsqldata\
    Files from this cluster will be property of user «postgres».
    This user must run the server as well.
    This cluster will run under Spanish_Argentina.1252. locale config
    blabla
    
    initdb: «C:/pgsqldata» directory is not empty
    If you want to create a new data cluster, delete or empty«C:/pgsqldata» directory, or run initdb with another argument.
    I emptied the folder and tried again.

    Code:
    C:\pgsql\bin>initdb.exe -D C:\pgsqldata\
    
    WARNING:  could not query value for 'std' to identify Windows timezone: 2
    WARNING:  could not find a match for Windows timezone "Hora de verano romance"
    hecho
    
    ATENCIÓN: setting «trust» autentication for local conections.
    blabla
    
    Done. You can run now the db server using:
    
        "postgres" -D "C:/pgsqldata"
    o
        "pg_ctl" -D "C:/pgsqldata" -l archivo_de_registro start
    
    
    C:\pgsql\bin>postgres.exe -D C:\pgsqldata
    WARNING:  could not query value for 'std' to identify Windows timezone: 2
    WARNING:  could not find a match for Windows timezone "Hora de verano romance"
    LOG:  database system was shut down at 2009-04-08 00:04:02 GMT
    LOG:  LOG db system:  autovacuum launcher started
     data is ready to accept conections
    And it started to work!

    So...what can i do now to make this "permanent"?

    Thanks a lot shammat!

  14. #14
    Join Date
    Nov 2003
    Posts
    2,934
    Provided Answers: 12
    Quote Originally Posted by nmaxcom
    And it started to work!

    So...what can i do now to make this "permanent"?
    Good to hear that!

    You can register Postgres as a Windows service that will automatically startup when you start the computer.

    For that you need to log in with an admin account, then in the bin directory of Postgres run:
    Code:
    pg_ctl register -N PostgresDB -P password -U postgres -D C:\pgsqldata\
    Where "password" is the password of the Windows user account "postgres". That will register a service that will start automatically with Windows.

  15. #15
    Join Date
    Apr 2009
    Posts
    11
    Good morning, here we are again

    Code:
    C:\Usuarios\Administrador>cd C:\pgsql\bin
    
    C:\pgsql\bin>pg_ctl.exe register -N PostgresDB -P postgres -U postgres -D C:\pgs
    qldata\
    
    C:\pgsql\bin>
    It looks like it worked, but then i go to my services tab:

    http://img84.imageshack.us/img84/8618/88411784.jpg

    Right click to properties to run it but damn:

    http://i43.tinypic.com/2j43vix.jpg

    The box says:
    Code:
    Unable to run PostresDB service in localhost.
    Error 1069: Unable to run the service due to a system login error.
    lol?

    I dont know why "login as" (in the services window) shows as ".\postgres" and not just "postgres"

    PS: ok, the password for postgres was wrong in the tab (although i write it well in the cmd). Now the service is up, i'm gonna test it!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •