-
Notifications
You must be signed in to change notification settings - Fork 47
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
embedded-postgres issue in Apple Silicon (M1) #115
Comments
Try to add this dependency: https://mvnrepository.com/artifact/io.zonky.test.postgres/embedded-postgres-binaries-darwin-arm64v8 |
@tomix26 The issue still persist even after adding the above mentioned dependency.
|
@tomix26 I can see an error in this file. |
It seems to me like an issues with a postgres driver. What version of the driver are you using? Nevertheless, first I would recommend to try the previous working version of embedded postgres 1.2.6 together with the embedded-postgres-binaries-darwin-arm64v8 dependency. After that step you can try to upgrade to a newer version of embedded postgres. There is a changelog here: https://github.com/zonkyio/embedded-postgres/releases/tag/v2.0.0 If you encounter any other problems, please send me the full log, not images, thank you. |
Hi @tomix26 I have adding both the dependency as suggested.
However, I continue to see the same error; please view the following error log.
By visiting this link, #78, I too attempted to comprehend the problem. appending the command line output for a couple commands for the directory on my local that is causing the problem.
|
Have you tried embedded-postgres 1.2.6 ? |
Yes i have tried embedded-postgres 1.2.6 with embedded-postgres-binaries-darwin-arm64v8 dependency and got the same error as mentioned above. But when i try embedded-postgres 1.2.6 dependency alone. I get the following error
|
Ok, great, good to know. Try to run the binaries manually with the following command in the /private/var/folders/f7/kt5z7zpj61v5b757h_wxcyh80000gn/T/embedded-pg/PG-16f255bae154432086b16236cfb59f2e/bin directory: The output should give you more information about what is wrong and why the database is not starting. |
I tried to execute the above mentioned command in the specified directory, it says that command not found.
As all the three files[initdb, pg_ctl, postgres] inside this directory are Unix Executable Files. I tried with different commands.
|
What about |
Should i add any config related to database cluster in the data directory
|
Yes, you're right. It's been a while since I last tried it. The following command should work: |
Both commands were successful, and I attached the console logs as well. what can be the next steps?
|
Ok, so the database is starting fine. Now run your tests again and send me the full log. If there are any potentially sensitive information in the log you can send it to my private email: [email protected] |
Still i can see the same error log.
I checked the server status as well
|
Run this command: |
This command successful created database cluster configuration.
Below command started the server.
But still i am not able to execute the test case
|
Then I guess it is probably a permissions issue. Are the tests running under the same user as the successfully completed commands above? |
Yes both test-cases and successfully completed commands above are under same user. |
@tomix26 can you help me here. |
Next, you can try to call the command directly from the code, like below. Because that is what the library does. There is the corresponding code here: EmbeddedPostgres.java#L241 ProcessBuilder builder = new ProcessBuilder("/var/folders/f7/kt5z7zpj61v5b757h_wxcyh80000gn/T/embedded-pg/PG-16f255bae154432086b16236cfb59f2e/bin/initdb", "-A", "trust", "-U", "postgres", "-D", "/var/folders/f7/kt5z7zpj61v5b757h_wxcyh80000gn/T/epg6929773607312554948", "-E", "UTF-8");
Process process = builder.start();
// Extract and verify the process output, there is more information here: https://docs.oracle.com/javase/8/docs/api/java/lang/ProcessBuilder.html You can also try to check out this repo and run the included tests to rule out that Scala is the cause of the problem. Because Scala is not officially supported yet and some problems have been reported in relation to the SBT server #65. Maybe the SBT server runs with a different user with different permissions. I don't know, I don't use Scala, I have limited experience in this area, so I can't help more. As a last resort, I would try to debug the code. EmbeddedPostgres.java#L241 is a good starting point. I guess that if you put a thread based breakpoint here EmbeddedPostgres.java#L632, the database error could be printed out to the log. Because logging is done asynchronously in a different thread and probably does not have enough time to print out the error. |
Hi @tomix26, this issue has been resloved. You were correct that the test cases were not running under the same user with administrative access; Every time I run IntelliJ using the Mac launchpad, it was unable to obtain admin access. As a result, I was not able to execute the test case. Solution: After starting IntelliJ by executing the .sh file located at this path: cd /Applications/IntelliJ IDEA CE.app/Contents/MacOS/ via terminal. I was able to execute the test cases. Thank you for your support. |
Glad to hear that. Thanks for letting me know. |
The project i am working on is using the following dependency:
But while executing the test cases i am getting the following errors
Error: Missing postgres binaries
Attempted Solution: Dependency Upgrade
To resolve the missing binaries issue, an attempt was made to upgrade the embedded-postgres dependency to the latest version:
New Error: Process failed during initdb
After upgrading the dependency, a new error is encountered:
Please help to resolve this issue.
The text was updated successfully, but these errors were encountered: