-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Database initialization fails on Windows for custom data directory #67
Comments
Thanks for the report. I need to test it first, then I'll let you know. However, I don't think removing that line would solve the problem, because on the next line a lock file is created and that also requires the proper permissions. |
Simply creating a The lock file is first used in I'd be happy to provide a PR. But writing a unit test for this problem is rather complicated as it requires permissions to be inherited from a group... |
I've finally tested it and everything worked as expected. There were no problems. Tested on Windows 10 Pro, version 20H2 and also version 21H1, with the same result. Note that I tested it as admin and also as standard user. So what system are you using? Could you provide more information to reproduce the issue? |
@tomix26 would you accept a PR with the change described earlier?
|
@dpeger I would prefer to leave it as is. I think the problem is not the calling of the |
I think manual creation of the data directory is pointless as it is done by As the manual creation is pointless and causing problems, I see no point in keeping it. But it's not up to me to decide. If you really want to keep it, making the eager creation of the data directory optional (with default to eagerly create the directory) would be another possiblity. |
If I use a custom data directory
Creation of the database fails:
This is very strange as my account definitively has "Full Control" privileges (inherited from local Administrators group) on the respective folder. However calling
initdb
directly from command line fails with the same permission denied error. I tested a little bit and was able to makeinitdb
succeed by granting "Write" permission to the data directory to my account directly. Additionallyinitdb
created non existing data directories on the fly (with the correct permissions).Although this actually seems to be an issue with posgres'
initdb
utility I think it would be good to workaround this problem by not eagerly creating the data directory inEmbeddedPostgres
:embedded-postgres/src/main/java/io/zonky/test/db/postgres/embedded/EmbeddedPostgres.java
Line 154 in 81236d6
Simply omitting this line made database initialization succeed.
The text was updated successfully, but these errors were encountered: