Gentoo Archives: gentoo-user

From: Mick <michaelkintzios@×××××.com>
To: gentoo-user <gentoo-user@l.g.o>
Subject: Re: [gentoo-user] Postgresql upgrade
Date: Sat, 29 Jul 2017 11:01:13
Message-Id: CAGOe-ex3dQnKOd3NjJmv1NK4tdPTqFdkxf4jZzOKrdLwyx5DXw@mail.gmail.com
In Reply to: Re: [gentoo-user] Postgresql upgrade by Alan McKinnon
1 On 29 July 2017 at 11:12, Alan McKinnon <alan.mckinnon@×××××.com> wrote:
2
3 > On 29/07/2017 11:59, Mick wrote:
4 > > It seems this is one of these things I keep forgetting how to perform
5 > > correctly, despite taking notes and reading the documentation. I
6 > thought I
7 > > had upgraded postgresql from 9.5.7 to 9.6.3-r1 a couple of weeks ago.
8 > >
9 > > Today depclean asked me to remove 9.5.7 and after a moment's hesitation
10 > I went
11 > > along with it. To my surprise I got this at the end of it:
12 > >
13 > > [snip...]
14 > > <<< dir /usr/include/postgresql-9.5/server/catalog
15 > > <<< dir /usr/include/postgresql-9.5/server/bootstrap
16 > > <<< dir /usr/include/postgresql-9.5/server/access
17 > > <<< dir /usr/include/postgresql-9.5/server
18 > > <<< dir /usr/include/postgresql-9.5/libpq
19 > > <<< dir /usr/include/postgresql-9.5/internal/libpq
20 > > <<< dir /usr/include/postgresql-9.5/internal
21 > > <<< dir /usr/include/postgresql-9.5/informix/esql
22 > > <<< dir /usr/include/postgresql-9.5/informix
23 > > <<< dir /usr/include/postgresql-9.5
24 > > --- !empty dir /usr/include
25 > > --- !empty dir /usr/bin
26 > > --- !empty dir /usr
27 > > --- !empty dir /etc/postgresql-9.5
28 > > --- !empty dir /etc/pam.d
29 > > --- !empty dir /etc/init.d
30 > > --- !empty dir /etc/conf.d
31 > > --- !empty dir /etc
32 > > Unsetting 9.5 as default...done.
33 > > Setting 9.6 as the default...ln: failed to create symbolic link
34 > > '/usr/include/libpq-fe.h': File exists
35 > > !!! Error: Unable to create link! postgresql-9.6/libpq-fe.h ->
36 > > /usr/include/libpq-fe.h
37 > > exiting
38 > >>>> Regenerating /etc/ld.so.cache...
39 > > Packages installed: 1321
40 > > Packages in world: 216
41 > > Packages in system: 44
42 > > Required packages: 1321
43 > > Number removed: 1
44 > >
45 > >
46 > > Looking at /usr/include/ I see this:
47 > >
48 > > lrwxrwxrwx 1 root root 29 Jul 16 13:56 postgres_ext.h ->
49 > > postgresql-9.5/postgres_ext.h
50 > > lrwxrwxrwx 1 root root 14 Jul 29 10:34 postgresql -> postgresql-9.6
51 > > drwxr-xr-x 6 root root 4096 Jul 16 13:55 postgresql-9.6
52 > >
53 > > Although the old /usr/include/postgresql-9.5 directory and file
54 > postgres_ext.h
55 > > have been removed, the symlink is still pointint to the old file, rather
56 > than
57 > > having been replaced with a symlink to
58 > > /usr/include/postgresql-9.6/postgres_ext.h:
59 > >
60 > > $ ls -la /usr/include/postgresql-9.6/postgres_ext.h
61 > > -rw-r--r-- 1 root root 2151 Jul 16 13:54
62 > > /usr/include/postgresql-9.6/postgres_ext.h
63 > >
64 > >
65 > > I'm trying to understand why this might have happened. Which
66 > process/action
67 > > is responsible for setting this symlink?
68 > >
69 > > Also, the entry run by depclean above also confused me:
70 > >
71 > > Unsetting 9.5 as default...done.
72 > > Setting 9.6 as the default...
73 > >
74 > > How is the default version of postgresql being set in a system? What
75 > specific
76 > > actions do these two entries entail? I thought with openrc at least it
77 > is a
78 > > matter of setting up the latest postgresql version to start up in
79 > rc-update.
80 > >
81 > > I've replaced the symlink with the live postgresql manually for now - I
82 > hope I
83 > > haven't borked the database ...
84 > >
85 >
86 >
87 > postgresql is slotted, so various headers files and such need symlinks
88 > installed so postgresql uses the correct versioned file. You have 2
89 > versions, which one is correct? - the one the symlink points to.
90 >
91 > Yes, but what confused me is that this symlink was correct:
92
93 postgresql -> postgresql-9.6
94
95 while all others weren't.
96
97
98 > Installing 9.6 on a host with 9.5 present does only that - installs it.
99 > It doesn't run it or set it as default, it only installs it. To run it
100 > or set it as default is an extra step that you decide yourself when you
101 > want to do it.
102 >
103 > depcleaning 9.5 removes the default version, so the obvious thing for
104 > the code to do is set 9.6 as the new default. Maybe the ebuild does it,
105 > maybe it's eselect. Doesn't matter, because something should have
106 > removed those stale symlinks and didn't. This is a reportable bug
107 >
108 > Right, I would report it, except I can't recall if I ran eselect after
109 isntalling 9.6. ... I am *almost* sure I did.
110
111
112 > Meanwhile fix the symlinks to what they should be using "ln -sfn" and
113 > all will be good in the world.
114 >
115 > --
116 > Alan McKinnon
117 > alan.mckinnon@×××××.com
118 >
119 > Thanks Alan, I was hoping this would be the case. However, the blasted
120 akonadi, which is why I am running a database on a laptop in the first
121 place, refuses to start:
122
123 [11:34:27] ~ $ akonadictl start
124 Starting Akonadi Server...
125 done.
126 Connecting to deprecated signal
127 QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)
128 [11:34:38] ~ $ QSqlDatabase: QPSQL driver not loaded
129 QSqlDatabase: available drivers: QSQLITE QPSQL7 QPSQL
130 Invalid database object during initial database connection
131 "[
132 0: akonadiserver(_Z11akBacktracev+0x4a) [0x463ada]
133 1: akonadiserver() [0x463dab]
134 2: /lib64/libc.so.6(+0x33170) [0x7f454d39d170]
135 3: /lib64/libc.so.6(gsignal+0x38) [0x7f454d39d0e8]
136 4: /lib64/libc.so.6(abort+0x16a) [0x7f454d39e53a]
137 5: /usr/lib64/qt4/libQtCore.so.4(_Z17qt_message_output9QtMsgTypePKc+0x8d)
138 [0x7f454ec90e1d]
139 6: akonadiserver(_ZN15FileDebugStream9writeDataEPKcx+0xad) [0x465fbd]
140 7: /usr/lib64/qt4/libQtCore.so.4(_ZN9QIODevice5writeEPKcx+0xa7)
141 [0x7f454ed333d7]
142 8: /usr/lib64/qt4/libQtCore.so.4(+0x120166) [0x7f454ed41166]
143 9: /usr/lib64/qt4/libQtCore.so.4(_ZN11QTextStreamD1Ev+0x31) [0x7f454ed4abe1]
144 10:
145 akonadiserver(_ZN7Akonadi6Server13AkonadiServer14createDatabaseEv+0x163)
146 [0x468433]
147 11: akonadiserver(_ZN7Akonadi6Server13AkonadiServer4initEv+0xc75) [0x46a635]
148 12: akonadiserver() [0x54c579]
149 13: /usr/lib64/qt4/libQtCore.so.4(_ZN7QObject5eventEP6QEvent+0x1d1)
150 [0x7f454edc5581]
151 14:
152 /usr/lib64/qt4/libQtCore.so.4(_ZN16QCoreApplication14notifyInternalEP7QObjectP6QEvent+0x8d)
153 [0x7f454edab7ad]
154 15:
155 /usr/lib64/qt4/libQtCore.so.4(_ZN23QCoreApplicationPrivate16sendPostedEventsEP7QObjectiP11QThreadData+0x376)
156 [0x7f454edaec36]
157 16: /usr/lib64/qt4/libQtCore.so.4(+0x1ba8ee) [0x7f454eddb8ee]
158 17: /usr/lib64/libglib-2.0.so.0(g_main_context_dispatch+0x24d)
159 [0x7f454ca693bd]
160 18: /usr/lib64/libglib-2.0.so.0(+0x4a6a0) [0x7f454ca696a0]
161 19: /usr/lib64/libglib-2.0.so.0(g_main_context_iteration+0x2c)
162 [0x7f454ca6974c]
163 20:
164 /usr/lib64/qt4/libQtCore.so.4(_ZN20QEventDispatcherGlib13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE+0x7e)
165 [0x7f454eddba5e]
166 21:
167 /usr/lib64/qt4/libQtCore.so.4(_ZN10QEventLoop13processEventsE6QFlagsINS_17ProcessEventsFlagEE+0x41)
168 [0x7f454edaa021]
169 22:
170 /usr/lib64/qt4/libQtCore.so.4(_ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE+0x1b5)
171 [0x7f454edaa395]
172 23: /usr/lib64/qt4/libQtCore.so.4(_ZN16QCoreApplication4execEv+0x99)
173 [0x7f454edafd39]
174 24: akonadiserver(main+0x2c9) [0x45ece9]
175 25: /lib64/libc.so.6(__libc_start_main+0xf0) [0x7f454d38a640]
176 26: akonadiserver(_start+0x29) [0x45f5a9]
177 ]
178 "
179 ProcessControl: Application 'akonadiserver' returned with exit code 255
180 (Unknown error)
181 QSqlDatabase: QPSQL driver not loaded
182 QSqlDatabase: available drivers: QSQLITE QPSQL7 QPSQL
183 Invalid database object during initial database connection
184 "[
185 0: akonadiserver(_Z11akBacktracev+0x4a) [0x463ada]
186 [snip ..]
187
188 ProcessControl: Application 'akonadiserver' returned with exit code 255
189 (Unknown error)
190 "akonadiserver" crashed too often and will not be restarted!
191
192
193 So what is this "Invalid database object during initial database
194 connection" and how to fix it. :-(
195
196 --
197 Regards,
198 Mick

Replies

Subject Author
Re: [gentoo-user] Postgresql upgrade Alan McKinnon <alan.mckinnon@×××××.com>