I am trying to run an installation check for PostgreSQL using make PG_CONFIG=../postgresql-11.17/bin/pg_config installcheck
in the age directory and I am getting an error message saying "pg_regress: initdb failed" with a DETAIL message saying that the data directory has invalid permissions. I have also checked the contents of the initdb.log file which says,
" running bootstrap script … 2023-04-11 09:48:37.706 WAT [1262] FATAL: data directory "/mnt/c/Users/HP/documents/the_age_project/age/./regress/instance/data" has invalid permissions
2023-04-11 09:48:37.706 WAT [1262] DETAIL: Permissions should be u=rwx (0700) or u=rwx,g=rx (0750).
child process exited with exit code 1
initdb: data directory "/mnt/c/Users/HP/documents/the_age_project/age/./regress/instance/data" not removed at user’s request "
Can anyone suggest a solution or troubleshooting steps to resolve this issue? Any help would be greatly appreciated.
I have tried changing the permissions of the data directory to u=rwx and g=rx but the error persists. I have also checked the contents of the initdb.log file but could not identify the cause of the problem.
3
Answers
Thanks guys for the help, I found out that trying to change permissions in the Windows file system do not work because they do not retain Linux permissions by default. However, there's a way to enable that. By creating (using sudo)
/etc/wsl.conf
and adding the following lines:Source 👉 https://superuser.com/questions/1323645/unable-to-change-file-permissions-on-ubuntu-bash-for-windows-10
You may need to check if there is a postgreSQL process running in the background. Using ps -ef| grep postgres. Then try to stop and reinstall after changing the permission of thr file. You may need to use make not sudo make with install check..
And use sudo make install… one last thing make sure the permission is set correctly for linux
If you installed PostgreSQL successfully then I don’t think there should be an issue. However, if you didn’t then I suggest you run the following command
sudo make PG_CONFIG=../postgreql-11.17/bin/pg_config install
prior to that ofinstallcheck
(There’s no need running this afterwards).If this issue persists, I guess you havebto start the process of installing AGE from the beginning.