all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#22619: postgresql-service error checking wtf
       [not found] <20160210200143.4a9f95c2@scratchpost.org>
@ 2016-02-10 23:12 ` Glenn Morris
  2016-02-12 14:14   ` Ludovic Courtès
  2016-02-12 14:14 ` Ludovic Courtès
  1 sibling, 1 reply; 5+ messages in thread
From: Glenn Morris @ 2016-02-10 23:12 UTC (permalink / raw)
  To: Danny Milosavljevic; +Cc: 22619

Danny Milosavljevic wrote:

> Package: postgresql

There's no postgresql package on debbugs.gnu.org, so your report
went to the help-debbugs mailing list.

From the rest of your report, I'm guessing this should have been
assigned to guix, so I did that.

> When I first configure operating-system with postgresql-service with
> default config file, then run
>
> guix system reconfigure config.scm,
>
> then configure operating-system with postgresql-service with custom
> config file, then run
>
> guix system reconfigure config.scm,
>
> I get:
>
> ---
> initdb: directory "/var/lib/postgresql/data" exists but is not empty
> If you want to create a new database system, either remove or empty
> the directory "/var/lib/postgresql/data" or run initdb
> with an argument other than "/var/lib/postgresql/data".
> making '/gnu/store/byn534fg4agm0vv9szl5kkfl19n080b2-system' the
> current system...
> Installation finished. No error reported.
> ----
>
> Postgresql doesn't run and the error message still references the
> default config file.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#22619: postgresql-service error checking wtf
       [not found] <20160210200143.4a9f95c2@scratchpost.org>
  2016-02-10 23:12 ` bug#22619: postgresql-service error checking wtf Glenn Morris
@ 2016-02-12 14:14 ` Ludovic Courtès
  2016-02-12 19:48   ` Danny Milosavljevic
  1 sibling, 1 reply; 5+ messages in thread
From: Ludovic Courtès @ 2016-02-12 14:14 UTC (permalink / raw)
  To: Danny Milosavljevic; +Cc: 22619

Danny Milosavljevic <dannym@scratchpost.org> skribis:

> initdb: directory "/var/lib/postgresql/data" exists but is not empty
> If you want to create a new database system, either remove or empty
> the directory "/var/lib/postgresql/data" or run initdb
> with an argument other than "/var/lib/postgresql/data".
> making '/gnu/store/byn534fg4agm0vv9szl5kkfl19n080b2-system' the current system...
> Installation finished. No error reported.
> ----
>
> Postgresql doesn't run

I’m not familiar with PostgreSQL, but perhaps you just need to do what
the message above says?

I’ve tested ‘postgresql-service’ in a pristine system with ‘guix system
vm’ and it starts without any such message.  So I guess there’s stale
data in /var/lib/postgresql/data on your system?

> and the error message still references the default config file.

I don’t see any references to a config file in what you pasted.

HTH,
Ludo’.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#22619: postgresql-service error checking wtf
  2016-02-10 23:12 ` bug#22619: postgresql-service error checking wtf Glenn Morris
@ 2016-02-12 14:14   ` Ludovic Courtès
  0 siblings, 0 replies; 5+ messages in thread
From: Ludovic Courtès @ 2016-02-12 14:14 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 22619

Glenn Morris <rgm@gnu.org> skribis:

> There's no postgresql package on debbugs.gnu.org, so your report
> went to the help-debbugs mailing list.
>
>From the rest of your report, I'm guessing this should have been
> assigned to guix, so I did that.

Indeed, thanks Glenn!

Ludo’.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#22619: postgresql-service error checking wtf
  2016-02-12 14:14 ` Ludovic Courtès
@ 2016-02-12 19:48   ` Danny Milosavljevic
  2016-02-21 11:38     ` Ludovic Courtès
  0 siblings, 1 reply; 5+ messages in thread
From: Danny Milosavljevic @ 2016-02-12 19:48 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 22619

Hi,

I've found out some more details. The message 
 
> > initdb: directory "/var/lib/postgresql/data" exists but is not empty
> > If you want to create a new database system, either remove or empty
> > the directory "/var/lib/postgresql/data" or run initdb
> > with an argument other than "/var/lib/postgresql/data".

is not an error for the entire service. It's initdb refusing to clobber the existing database (which has been created by the postgresql-service instance with no #:config-file argument) and helpful in preventing data loss.

The actual problem only arises because guix reconfigure doesn't deem a change in service arguments as reason to restart (or reconfigure) a service.

I.e. before, my config was:

(postgresql-service )

Then I did guix reconfigure ...

Afterwards, I changed the config to:

(postgresql-service #:config-file ...)

Then I did giux reconfigure   # this erroneously doesn't reload the postgres service!!

> > and the error message still references the default config file.  
> 
> I don’t see any references to a config file in what you pasted.

In the postgres-service definition in guix/gnu/services/databases.scm , there's a %default-postgres-config . That's what I meant.
At all times, the default config file was printed in the log - which was because the postgres service never actually was reconfigured.

>I’ve tested ‘postgresql-service’ in a pristine system with ‘guix system vm’ and it starts without any such message.  So I guess there’s stale data in /var/lib/postgresql/data on your system?

It was left over from the first unsuccessful launch because bug# 22618 hadn't been fixed at the time.

Thanks,
   Danny

^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#22619: postgresql-service error checking wtf
  2016-02-12 19:48   ` Danny Milosavljevic
@ 2016-02-21 11:38     ` Ludovic Courtès
  0 siblings, 0 replies; 5+ messages in thread
From: Ludovic Courtès @ 2016-02-21 11:38 UTC (permalink / raw)
  To: Danny Milosavljevic; +Cc: 22619-done

Danny Milosavljevic <dannym@scratchpost.org> skribis:

> The actual problem only arises because guix reconfigure doesn't deem a change in service arguments as reason to restart (or reconfigure) a service.
>
> I.e. before, my config was:
>
> (postgresql-service )
>
> Then I did guix reconfigure ...
>
> Afterwards, I changed the config to:
>
> (postgresql-service #:config-file ...)
>
> Then I did giux reconfigure   # this erroneously doesn't reload the postgres service!!

Yes, this is a known limitation: <http://bugs.gnu.org/22039>.

Currently, for services that are safe to be restarted, the solution is
to explicitly stop them beforehand, in which case the new service gets
started by ‘guix system reconfigure’:

  # herd stop postgresql
  # guix system reconfigure new-config.scm

I’m closing this bug.  Let me know if anything else is amiss.

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-02-21 11:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20160210200143.4a9f95c2@scratchpost.org>
2016-02-10 23:12 ` bug#22619: postgresql-service error checking wtf Glenn Morris
2016-02-12 14:14   ` Ludovic Courtès
2016-02-12 14:14 ` Ludovic Courtès
2016-02-12 19:48   ` Danny Milosavljevic
2016-02-21 11:38     ` Ludovic Courtès

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.