I’m trying to run the a simple postgres flox environment from floxhub on my m1 mac machine. However, it fails to activate with the -start-services flag.
I’ve pulled the env by using ’ flox pull flox/postgres ’
Then, I’m activate it by using ‘flox activate --start-services’
however it fails by saying:
Error: failed to acquire lockfile
Caused by:
0 : failed to open lockfile
1 : Permission denied (os error 13)
to facilitate the creation, i’ve enabled all the read and write rights for all users for
/Users/{user-name}/.local/share/flox/env-registry.json and env-registry.lock files.
What can i do to get the postgres instance running on my machine ?
Thanks for giving flox a try, sorry you are having troubles.
Would you be able to check what value $XDG_RUNTIME_DIR has (if set) or otherwise $XDG_CACHE_HOME?
The home directory is not shared with any other users. It’s my the home directory after I login to the system with my username.
I activated before with services. However, I could not run postgres as it refuses to run with root previlages. So, i had to activate as a regular user.
When so, I get this message.
Yes, I’m able to create the postgres environment as regular user if reinstall flox as regular user (not as a root using ‘sudo’ command). I must have installed flox as a root user and so i was running into all sorts of permission issues.
Thanks for walking me through the solution and giving pointers as needed. Your direction is much appreciated.
Just an FYI, I’m test driving flox on my dev machine and it’s looking good, we’re doing further testing with different scenario’s. If all goes well, we’ll adopt it as a go-to solution for onboarding new developers.
Glad we got that resolved.
I’m curious what may have led flox to run as root, if it was too easy to create all sorts of permission issues we might want to improve our documentation or runtime checks on that.
Just an FYI, I’m test driving flox on my dev machine and it’s looking good, we’re doing further testing with different scenario’s. If all goes well, we’ll adopt it as a go-to solution for onboarding new developers
That sounds great! Welcome to reach out if you have any further issues.