[Nix-dev] nixops mediawiki example

Andreas Herrmann andreash87 at gmx.ch
Fri Jul 18 22:15:52 CEST 2014


Hi everyone,

I'm trying to learn how to use nixops. I already got the trivial example
[1] running on a local virtualbox. Next, I wanted to try a mediawiki config
along the lines of [2], just on my machine in one single virtualbox
instance.

Unfortunately, I am having trouble with the proper set-up.

You can find my configuration under [3]. When I try to deploy it for the
first time, it first creates the VM, imports a lot of derivations, and then
tries to configure the data-base. This fails with the following error
message:

    createuser: could not connect to database postgres: could not connect
to server: No such file or directory

The full output of the command can be found under [4]. It seems that the
postgres service is not up in time for the initialization script.
One, possibly related, issue is a message at the very beginning. It says:

    trace: Warning: job ‘init_mediawiki_db’ has unknown startOn value
‘started postgresql’.

I just copied the `startOn` line from the example code, and it can also be
found in nixpkgs in [5]. Is it wrong? Or is there another reason for the
initialization failing?

Another side question:
When I then try to deploy for a second time I get the following error
message:

    createuser: creation of new role failed: ERROR: role "mediawiki"
already exists

The full output is under [6]. How can I fix this issue without running
`nixops destroy -d trivial` every time?

Thanks in advance.

Best,

Andreas

[1]: http://nixos.org/nixops/manual/#chap-overview
[2]: https://github.com/NixOS/nixops/blob/master/examples/mediawiki.nix
[3]:
https://github.com/aherrmann/nixops-mediawiki-test/tree/ae5cce354bc6dfb84f0d19f04c995bec66ae5433
[4]:
https://gist.github.com/aherrmann/794a47b65e4deea36dc2#file-first_attempt
[5]:
https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/networking/openfire.nix#L10
[6]:
https://gist.github.com/aherrmann/794a47b65e4deea36dc2#file-second_attempt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.science.uu.nl/pipermail/nix-dev/attachments/20140718/1f86baf7/attachment.html 


More information about the nix-dev mailing list