Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 300308 - problem with upgrade to dev-db/postgresql-server-8.4.2*
Summary: problem with upgrade to dev-db/postgresql-server-8.4.2*
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: PgSQL Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-09 17:47 UTC by Miroslav Šulc
Modified: 2010-01-09 21:47 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Miroslav Šulc gentoo-dev 2010-01-09 17:47:19 UTC
after today emerge -uDN world, on both servers i updated, dev-db/postgresql-server-8.4.2* is not able to start up because of this error:

could not create IPv6 socket: Address family not supported by protocol family

it does not start at all, not that it would just report the problem and start anyway using just ipv4. as i have several virtual servers, i tried to restart postgresql before world update and it restarted, but after the update, restart failed with the error.

# emerge --info
Portage 2.2_rc61 (hardened/linux/amd64/10.0, gcc-4.3.4, glibc-2.9_p20081201-r2, 2.6.31-vs2.3.0.36.23-gentoo x86_64)
=================================================================
System uname: Linux-2.6.31-vs2.3.0.36.23-gentoo-x86_64-Intel-R-_Core-TM-_i7_CPU_920_@_2.67GHz-with-gentoo-2.0.1
Timestamp of tree: Sat, 09 Jan 2010 14:15:02 +0000
app-shells/bash:     4.0_p35
dev-java/java-config: 2.1.9-r2
dev-lang/python:     2.6.4
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.4.3-r3
sys-apps/sandbox:    2.2
sys-devel/autoconf:  2.63-r1
sys-devel/automake:  1.10.2
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6b
virtual/os-headers:  2.6.27-r2
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA dlj-1.1"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=core2 -msse4 -mcx16 -msahf -O2 -pipe -msse4.1 -msse4.2"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/eselect/postgresql /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-march=core2 -msse4 -mcx16 -msahf -O2 -pipe -msse4.1 -msse4.2"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests distlocks fixpackages news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="ftp://de-mirror.org/distro/gentoo/ http://ftp.fi.muni.cz/pub/linux/gentoo/ http://mirror.leaseweb.com/gentoo/ ftp://mirror.netcologne.de/gentoo/ ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/gentoo"
LDFLAGS="-Wl,-O1"
MAKEOPTS="-j9"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.de.gentoo.org/gentoo-portage"
USE="acl amd64 berkdb bzip2 cli cracklib crypt cups cxx dri gdbm gpm hardened iconv justify mmx modules mudflap multilib ncurses nls nptl nptlonly openmp pam pcre perl pic pppd python readline reflection session spl sse sse2 ssl sysfs tcpd unicode urandom xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga neomagic nv r128 radeon savage sis tdfx trident vesa via vmware voodoo" 
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY

here are updated packages (there is pg 8.4.1 as on this virtual i directly downgraded to 8.4.1 from 8.4.2):

1263058465:  >>> emerge (1 of 9) sys-libs/ncurses-5.7-r3 to /
1263058527:  >>> emerge (2 of 9) sys-libs/gdbm-1.8.3-r4 to /
1263058534:  >>> emerge (3 of 9) dev-libs/mpfr-2.4.1_p5 to /
1263058554:  >>> emerge (4 of 9) sys-libs/readline-6.0_p4 to /
1263058569:  >>> emerge (5 of 9) sys-apps/net-tools-1.60_p20090728014017-r1 to /
1263058576:  >>> emerge (6 of 9) app-admin/eselect-1.2.8 to /
1263058581:  >>> emerge (7 of 9) dev-java/java-config-2.1.9-r2 to /
1263058585:  >>> emerge (8 of 9) dev-db/postgresql-base-8.4.1 to /
1263058624:  >>> emerge (9 of 9) dev-db/postgresql-server-8.4.1-r1 to /


let me know if you need more info
Comment 1 Patrick Lauer gentoo-dev 2010-01-09 17:55:00 UTC
The only ipv6 specific bits I've found are in /var/lib/postgresql/${version}data/pg_hba.conf:

# IPv6 local connections:
host    all         all         ::1/128               trust

Does disabling that entry help?
Comment 2 Miroslav Šulc gentoo-dev 2010-01-09 18:24:23 UTC
unfortunately disabling that line does not fix it. before i made this bug report, i googled a lot and all i was able to find was that the cause is that when postgresql queries system for localhost address, it gets also ipv6 address ... but i tried to put in listen addresses just ipv4 address and that did not help either. i also disabled ipv6 address in /etc/hosts but did not help either.

i also tried to downgrade net-tools but that did not help either.
Comment 3 Miroslav Šulc gentoo-dev 2010-01-09 18:39:41 UTC
i just noticed that i did not state here clearly that 8.4.1 does not have the issue and starts "without problem". it still reports that it could not create ipv6 socket but starts anyway
Comment 4 Miroslav Šulc gentoo-dev 2010-01-09 18:47:49 UTC
ok, just found it:

$ env PGDATA="/var/lib/postgresql/8.4/data/" /usr/lib/postgresql-8.4/bin/pg_ctl start   
server starting
postgres@jade / $ LOG:  could not create IPv6 socket: Address family not supported by protocol family
FATAL:  database files are incompatible with server
DETAIL:  The database cluster was initialized without HAVE_INT64_TIMESTAMP but the server was compiled with HAVE_INT64_TIMESTAMP.
HINT:  It looks like you need to recompile or initdb.

i do not see any change in my use flags so the change seems to be postgresql related
Comment 5 Patrick Lauer gentoo-dev 2010-01-09 18:54:56 UTC
(In reply to comment #4)
> ok, just found it:
> 
> $ env PGDATA="/var/lib/postgresql/8.4/data/" /usr/lib/postgresql-8.4/bin/pg_ctl
> start   
> server starting
> postgres@jade / $ LOG:  could not create IPv6 socket: Address family not
> supported by protocol family
> FATAL:  database files are incompatible with server
> DETAIL:  The database cluster was initialized without HAVE_INT64_TIMESTAMP but
> the server was compiled with HAVE_INT64_TIMESTAMP.
> HINT:  It looks like you need to recompile or initdb.
> 
> i do not see any change in my use flags so the change seems to be postgresql
> related
> 

  <flag name='pg_legacytimestamp'>Use double precision floating-point numbers
    instead of 64-bit integers for timestamp storage.
  </flag>

That one is a bit evil, it's upstream default now. Timestamps affect the on-disk format of the DB ... so starting fails.
You may have to emerge it with this useflag enabled, dump database, disable it, reload database, then you should be back to a fully working state.
Comment 6 Patrick Lauer gentoo-dev 2010-01-09 19:06:31 UTC
Added elog message to ebuild:

        elog "The timestamp format is 64bit integers now. If you upgrade from older databases"
        elog "this may force you to either do a dump and reload or enable pg_legacytimestamp"
        elog "until you find time to do so. If the database can't start please try enabling"
        elog "pg_legacytimestamp and rebuild."
Comment 7 Miroslav Šulc gentoo-dev 2010-01-09 21:47:04 UTC
just confirming solution. thx patrick for help