Skip to content

Failes with initdb: error: could not create directory \"/homeless-shelter\": Permission denied? #280

Description

@TheOddler

I'm trying to run my tests as part of my nix flake check, but when I do this tests that use tmp-postgres fail with

InitDbFailed {startErrorStdOut = "The files belonging to this database system will be owned by user \"nixbld\".This user must also own the server process.The database cluster will be initialized with locale \"en_US.UTF-8\".The default database encoding has accordingly been set to \"UTF8\".The default text search configuration will be set to \"english\".Data page checksums are disabled.", startErrorStdErr = "initdb: error: could not create directory \"/homeless-shelter\": Permission denied", startErrorExitCode = ExitFailure 1}

I tried manually setting the cacheTemporaryDirectory and temporaryDirectory to whatever the TMP environment variable is set to (seems to be /build) but that results in the same error, still complaining about homeless-shelter.

What am I missing? Is there a way to make this work inside nix?

(For more code, my project is available at: https://github.com/TheOddler/elmder/tree/pablo/trying-to-fix-backend-nix-build)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions