Re: [Nix-dev] instructions for setting up apache + mediawiki is broken

2013-07-06 Thread Bjørn Forsman
On 29 June 2013 21:44, Bjørn Forsman bjorn.fors...@gmail.com wrote:
 On 29 June 2013 11:27, Bjørn Forsman bjorn.fors...@gmail.com wrote:
 On 29 June 2013 10:54, Bjørn Forsman bjorn.fors...@gmail.com wrote:
 On 28 June 2013 20:47, Bjørn Forsman bjorn.fors...@gmail.com wrote:
 Hi,

 Today I tried setting up Apache + MediaWiki, following this guide:

 http://nixos.org/wiki/Setting_up_MediaWiki_%26_vhosts

 [...snip...]

 Ok, so now the configuration builds. Then the wiki says I should create 
 users:

 $ mediawiki-main-createAndPromote --bureaucrat God foobar

 But that results in this error:
 mediawiki: Creating and promoting User:God...DB connection error: No
 database connection

 Running with sudo doesn't help. PostgreSQL is running and I can
 manually connect to the mediawiki database:

 $ sudo psql mediawiki

 So what is going on here? Is mediawiki broken in nixos or should I be
 using a different version of postgresql?

 Looking at the log messages from postgres seems to suggest that I
 should run as the mediawiki user, instead of wwwrun:

 juni 29 21:20:21 nixos postgres[3897]: [2-1] LOG:  provided user name
 (mediawiki) and authenticated user name (wwwrun) do not match
 juni 29 21:20:21 nixos postgres[3897]: [3-1] FATAL:  Peer
 authentication failed for user mediawiki

 However...

 $ sudo useradd mediawiki

 $ sudo -u mediawiki mediawiki-main-createAndPromote --bureaucrat God foobar
 mediawiki: Creating and promoting User:God...A database error has
 occurred.  Did you forget to run maintenance/update.php after
 upgrading?  See:
 https://www.mediawiki.org/wiki/Manual:Upgrading#Run_the_update_script
 Query: SELECT  user_id  FROM mwuser  WHERE user_name = 'God'  LIMIT 1
 Function: User::idForName
 Error: 42P01 ERROR:  relation mwuser does not exist
 LINE 1: SELECT /* User::idForName  */  user_id  FROM mwuser  WHERE...

 So now the database connection is ok. But there is an error and it
 suggests that I run the maintenance/update.php script.

 $ sudo -u mediawiki php
 /nix/store/4wgmybdy33hi54nmqbkdd4i1w65jgis9-mediawiki-1.20.5/maintenance/update.php
 MediaWiki 1.20.5 Updater

 Going to run database updates for mediawiki
 Depending on the size of your database this may take a while!
 Abort with control-c in the next five seconds (skip this countdown
 with --quick) ... 0
 Creating sequence logging_log_id_seq
 Creating sequence page_restrictions_pr_id_seq
 Creating sequence filearchive_fa_id_seq
 Fatal error: Call to a member function defaultValue() on a non-object
 in 
 /nix/store/4wgmybdy33hi54nmqbkdd4i1w65jgis9-mediawiki-1.20.5/includes/installer/PostgresUpdater.php
 on line 570

 Ugh... need... help

I found the nixos-org-configurations repo at github which has a
mediawiki configuration:

https://github.com/NixOS/nixos-org-configurations/blob/master/nixos-org/webserver.nix

I will try that.
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] instructions for setting up apache + mediawiki is broken

2013-06-29 Thread Bjørn Forsman
On 28 June 2013 23:57, Marc Weber marco-owe...@gmx.de wrote:
 - Is it not possible to have a default version?
 If you do this you can break the system by updating it. For this reason
 not having a default is the *only* way to protect against suprises.

Ok.

 - If no default version, is there at least a way to print a *human
 readable* error message that hints the user about
 Of course, provide patches. I introduced assertions long time ago.
 Eg see b43.nix - so fix and provide a patch :)

Ok. It's just that I didn't know where to start. The backtrace was
long and scary and listed *lots* of .nix files :-)

- Bjørn
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] instructions for setting up apache + mediawiki is broken

2013-06-29 Thread Bjørn Forsman
On 29 June 2013 08:03, Rob Vermaas rob.verm...@gmail.com wrote:
 Hi Bjorn,

 - If no default version, is there at least a way to print a *human
 readable* error message that hints the user about
 services.postgresql.package? The error you get now is pretty horrible.

 I have changed the error message, if you have the latest nixpkgs, you
 would now see:

   error: user-thrown exception: Option `services.postgresql.package'
 not defined and does not have a default value.

That is much more user friendly. Thanks!

- Bjørn
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] instructions for setting up apache + mediawiki is broken

2013-06-29 Thread Bjørn Forsman
On 28 June 2013 20:47, Bjørn Forsman bjorn.fors...@gmail.com wrote:
 Hi,

 Today I tried setting up Apache + MediaWiki, following this guide:

 http://nixos.org/wiki/Setting_up_MediaWiki_%26_vhosts

 It says I should add this to configuration.nix:

 services.postgresql.enable = true;
 services.httpd.enable = true;
 services.httpd.adminAddr = ad...@example.org;
 services.httpd.extraSubservices =
   [ { serviceType = mediawiki;
   siteName = My Wiki;
   logo = http://www.example.org/wiki-logo.png;; # should be 135x135px
   extraConfig =
 ''
   # See http://www.mediawiki.org/wiki/Manual:Configuration_settings
   $wgEmailConfirmToEdit = true;
 '';
 }
   ];

 But when I nixos-rebuild it fails pretty bad. The build log is below.

 I tried to comment out the httpd config stuff and then I see that
 having just services.prostgresql.enable = true; fails pretty badly
 too.

I've added services.postgresql.package = pkgs.postgresql92; to the wiki.

http://nixos.org/wiki/Setting_up_MediaWiki_%26_vhosts
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] instructions for setting up apache + mediawiki is broken

2013-06-29 Thread Bjørn Forsman
On 29 June 2013 10:54, Bjørn Forsman bjorn.fors...@gmail.com wrote:
 On 28 June 2013 20:47, Bjørn Forsman bjorn.fors...@gmail.com wrote:
 Hi,

 Today I tried setting up Apache + MediaWiki, following this guide:

 http://nixos.org/wiki/Setting_up_MediaWiki_%26_vhosts

 It says I should add this to configuration.nix:

 services.postgresql.enable = true;
 services.httpd.enable = true;
 services.httpd.adminAddr = ad...@example.org;
 services.httpd.extraSubservices =
   [ { serviceType = mediawiki;
   siteName = My Wiki;
   logo = http://www.example.org/wiki-logo.png;; # should be 135x135px
   extraConfig =
 ''
   # See http://www.mediawiki.org/wiki/Manual:Configuration_settings
   $wgEmailConfirmToEdit = true;
 '';
 }
   ];

 But when I nixos-rebuild it fails pretty bad. The build log is below.

 I tried to comment out the httpd config stuff and then I see that
 having just services.prostgresql.enable = true; fails pretty badly
 too.

 I've added services.postgresql.package = pkgs.postgresql92; to the wiki.

 http://nixos.org/wiki/Setting_up_MediaWiki_%26_vhosts

Ok, so now the configuration builds. Then the wiki says I should create users:

$ mediawiki-main-createAndPromote --bureaucrat God foobar

But that results in this error:
mediawiki: Creating and promoting User:God...DB connection error: No
database connection

Running with sudo doesn't help. PostgreSQL is running and I can
manually connect to the mediawiki database:

$ sudo psql mediawiki

So what is going on here? Is mediawiki broken in nixos or should I be
using a different version of postgresql?

- Bjørn
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] instructions for setting up apache + mediawiki is broken

2013-06-29 Thread Bjørn Forsman
On 29 June 2013 11:27, Bjørn Forsman bjorn.fors...@gmail.com wrote:
 On 29 June 2013 10:54, Bjørn Forsman bjorn.fors...@gmail.com wrote:
 On 28 June 2013 20:47, Bjørn Forsman bjorn.fors...@gmail.com wrote:
 Hi,

 Today I tried setting up Apache + MediaWiki, following this guide:

 http://nixos.org/wiki/Setting_up_MediaWiki_%26_vhosts

 It says I should add this to configuration.nix:

 services.postgresql.enable = true;
 services.httpd.enable = true;
 services.httpd.adminAddr = ad...@example.org;
 services.httpd.extraSubservices =
   [ { serviceType = mediawiki;
   siteName = My Wiki;
   logo = http://www.example.org/wiki-logo.png;; # should be 135x135px
   extraConfig =
 ''
   # See http://www.mediawiki.org/wiki/Manual:Configuration_settings
   $wgEmailConfirmToEdit = true;
 '';
 }
   ];

 But when I nixos-rebuild it fails pretty bad. The build log is below.

 I tried to comment out the httpd config stuff and then I see that
 having just services.prostgresql.enable = true; fails pretty badly
 too.

 I've added services.postgresql.package = pkgs.postgresql92; to the wiki.

 http://nixos.org/wiki/Setting_up_MediaWiki_%26_vhosts

 Ok, so now the configuration builds. Then the wiki says I should create users:

 $ mediawiki-main-createAndPromote --bureaucrat God foobar

 But that results in this error:
 mediawiki: Creating and promoting User:God...DB connection error: No
 database connection

 Running with sudo doesn't help. PostgreSQL is running and I can
 manually connect to the mediawiki database:

 $ sudo psql mediawiki

 So what is going on here? Is mediawiki broken in nixos or should I be
 using a different version of postgresql?

Looking at the log messages from postgres seems to suggest that I
should run as the mediawiki user, instead of wwwrun:

juni 29 21:20:21 nixos postgres[3897]: [2-1] LOG:  provided user name
(mediawiki) and authenticated user name (wwwrun) do not match
juni 29 21:20:21 nixos postgres[3897]: [3-1] FATAL:  Peer
authentication failed for user mediawiki

However...

$ sudo useradd mediawiki

$ sudo -u mediawiki mediawiki-main-createAndPromote --bureaucrat God foobar
mediawiki: Creating and promoting User:God...A database error has
occurred.  Did you forget to run maintenance/update.php after
upgrading?  See:
https://www.mediawiki.org/wiki/Manual:Upgrading#Run_the_update_script
Query: SELECT  user_id  FROM mwuser  WHERE user_name = 'God'  LIMIT 1
Function: User::idForName
Error: 42P01 ERROR:  relation mwuser does not exist
LINE 1: SELECT /* User::idForName  */  user_id  FROM mwuser  WHERE...

So now the database connection is ok. But there is an error and it
suggests that I run the maintenance/update.php script.

$ sudo -u mediawiki php
/nix/store/4wgmybdy33hi54nmqbkdd4i1w65jgis9-mediawiki-1.20.5/maintenance/update.php
MediaWiki 1.20.5 Updater

Going to run database updates for mediawiki
Depending on the size of your database this may take a while!
Abort with control-c in the next five seconds (skip this countdown
with --quick) ... 0
Creating sequence logging_log_id_seq
Creating sequence page_restrictions_pr_id_seq
Creating sequence filearchive_fa_id_seq
Fatal error: Call to a member function defaultValue() on a non-object
in 
/nix/store/4wgmybdy33hi54nmqbkdd4i1w65jgis9-mediawiki-1.20.5/includes/installer/PostgresUpdater.php
on line 570

Ugh... need... help

Best regards,
Bjørn Forsman
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] instructions for setting up apache + mediawiki is broken

2013-06-28 Thread Marc Weber
 - Is it not possible to have a default version?
If you do this you can break the system by updating it. For this reason
not having a default is the *only* way to protect against suprises.

 - If no default version, is there at least a way to print a *human
 readable* error message that hints the user about
Of course, provide patches. I introduced assertions long time ago.
Eg see b43.nix - so fix and provide a patch :)

Marc Weber
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev