Mailing List Archive

1.1.9.3 partly broken, issue with Postgres >10 ?
Hello all,

I'm migrating a davical instance (medium size, 13 principals, 41
instances) from Ubuntu 16.04 (1.1.9.2) to Debian 10 (1.1.9.3, with awl
0.61). I'm installing from tarballs because Debian has an old version.

Migration went ok (install on new server, restore DB dump, ), but
delegated calendars do not show up, and we have numerous SQL errors (see
below) so I rolled back the migration and I'm now looking for a fix.

This was apparently already discussed in November '20, subject "Unable
to deliver invitation". Jim wrote "I think this is due to a change made
in PostgreSQL 10. See
https://github.com/postgres/postgres/commit/0436f6bde8848b7135f19dd7f8548b8c2ae89a34".

What else ? /setup.php shows all green (except version check but this is
because outgoing http is not allowed so all ok)

Is there anything I miss here ? Can't I use Postgres >= 10 ?

Thanks for the clarification !
Charles

===================

Log entry (somewhat filtered and reformatted)

[Tue Jan 05 11:15:47.017705 2021] [proxy_fcgi:error] [pid 17453:tid
140541619865344] [client 178.82.129.10:38910] AH01071: Got error '

PHP message: davical: LOG: DAVPrincipal: Query: QF: SQL error "0A000" -
ERROR: set-returning functions are not allowed in CASE LINE 4: ...
expanded.g_id FROM (SELECT CASE WHEN $2 > 0 THEN expand_mem... ^ HINT:
You might be able to move the set-returning function into a LATERAL FROM
item. QUERY: SELECT group_id FROM group_member WHERE member_id = $1
UNION SELECT expanded.g_id FROM (SELECT CASE WHEN $2 > 0 THEN
expand_memberships( group_id, $2 - 1) END AS g_id FROM group_member
WHERE member_id = $1) AS expanded WHERE expanded.g_id IS NOT NULL;
CONTEXT: SQL function "expand_memberships" during startup SQL function
"p_has_proxy_access_to" statement 1"

PHP message: davical: LOG: DAVPrincipal: Query: QF: SELECT principal_id,
username, pprivs(:request_principal::int8,principal_id,:scan_depth::int)
FROM principal JOIN usr USING(user_no) WHERE usr.active=true AND
principal_id IN (SELECT * from
p_has_proxy_access_to(:request_principal,:scan_depth))
":request_principal" => "3"    ":scan_depth" => "2"

PHP message: davical: LOG: DAVPrincipal: Query: QF: SQL error "0A000" -
ERROR: set-returning functions are not allowed in CASE LINE 4: ...
expanded.g_id FROM (SELECT CASE WHEN $2 > 0 THEN expand_mem... ^ HINT:
You might be able to move the set-returning function into a LATERAL FROM
item. QUERY: SELECT group_id FROM group_member WHERE member_id = $1
UNION SELECT expanded.g_id FROM (SELECT CASE WHEN $2 > 0 THEN
expand_memberships( group_id, $2 - 1) END AS g_id FROM group_member
WHERE member_id = $1) AS expanded WHERE expanded.g_

PHP message: davical: LOG: DAVPrincipal: Query: QF: id IS NOT NULL;
CONTEXT: SQL function "expand_memberships" during startup SQL statement
"SELECT bit_or(subquery.privileges) FROM ( SELECT privileges FROM grants
WHERE by_principal=in_grantor AND by_collection IS NULL AND
(to_principal=in_accessor OR to_principal IN (SELECT
expand_memberships(in_accessor,in_depth))) UNION SELECT
bit_or(sq2.privileges) FROM ( SELECT 32::BIT(24) AS privileges FROM
expand_memberships(in_accessor,in_depth) WHERE expand_memberships =
in_grantor UNION SELECT default_privileges AS privileges FROM principal
WHERE principal_id = in_grantor ) AS sq2 ) AS subquery" PL/pgSQL
function pprivs(bigint,bigint,integer) line 14 at SQL statement"

PHP message: davical: LOG: DAVPrincipal: Query: QF: SELECT principal_id,
username, pprivs(principal_id,:request_principal::int8,:scan_depth::int)
FROM principal JOIN usr USING(user_no) WHERE usr.active=true AND
principal_id IN (SELECT to_principal FROM grants WHERE by_principal =
:request_principal AND (privileges & 5::BIT(24)) != 0::BIT(24) AND
by_collection IS NULL AND to_principal != :request_principal )
":request_principal" => "3"   ":scan_depth" => "2"', referer:
https://srv.example.com:5743/web/



_______________________________________________
Davical-general mailing list
Davical-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/davical-general
Re: 1.1.9.3 partly broken, issue with Postgres >10 ? [ In reply to ]
Hello again,

answering my own request fo reference. After reading all docs and
checking my config step-by-step, I had to redo the DB migration as

    dba/update-davical-database --dbuser=postgres

(note the --dbuser...). The problems went away and I'm now running
1.1.9.3. The same command without the option apparently wasn't sufficient.

Thanks all for this wonderful piece of software !

Regards,
Charles

On 05.01.21 11:37, Charles Bueche wrote:
> Hello all,
>
> I'm migrating a davical instance (medium size, 13 principals, 41
> instances) from Ubuntu 16.04 (1.1.9.2) to Debian 10 (1.1.9.3, with awl
> 0.61). I'm installing from tarballs because Debian has an old version.
>
> Migration went ok (install on new server, restore DB dump, ), but
> delegated calendars do not show up, and we have numerous SQL errors
> (see below) so I rolled back the migration and I'm now looking for a fix.
>
> This was apparently already discussed in November '20, subject "Unable
> to deliver invitation". Jim wrote "I think this is due to a change
> made in PostgreSQL 10. See
> https://github.com/postgres/postgres/commit/0436f6bde8848b7135f19dd7f8548b8c2ae89a34".
>
> What else ? /setup.php shows all green (except version check but this
> is because outgoing http is not allowed so all ok)
>
> Is there anything I miss here ? Can't I use Postgres >= 10 ?
>
> Thanks for the clarification !
> Charles
>
> ===================
>
> Log entry (somewhat filtered and reformatted)
>
> [Tue Jan 05 11:15:47.017705 2021] [proxy_fcgi:error] [pid 17453:tid
> 140541619865344] [client 178.82.129.10:38910] AH01071: Got error '
>
> PHP message: davical: LOG: DAVPrincipal: Query: QF: SQL error "0A000"
> - ERROR: set-returning functions are not allowed in CASE LINE 4: ...
> expanded.g_id FROM (SELECT CASE WHEN $2 > 0 THEN expand_mem... ^ HINT:
> You might be able to move the set-returning function into a LATERAL
> FROM item. QUERY: SELECT group_id FROM group_member WHERE member_id =
> $1 UNION SELECT expanded.g_id FROM (SELECT CASE WHEN $2 > 0 THEN
> expand_memberships( group_id, $2 - 1) END AS g_id FROM group_member
> WHERE member_id = $1) AS expanded WHERE expanded.g_id IS NOT NULL;
> CONTEXT: SQL function "expand_memberships" during startup SQL function
> "p_has_proxy_access_to" statement 1"
>
> PHP message: davical: LOG: DAVPrincipal: Query: QF: SELECT
> principal_id, username,
> pprivs(:request_principal::int8,principal_id,:scan_depth::int) FROM
> principal JOIN usr USING(user_no) WHERE usr.active=true AND
> principal_id IN (SELECT * from
> p_has_proxy_access_to(:request_principal,:scan_depth))
> ":request_principal" => "3"    ":scan_depth" => "2"
>
> PHP message: davical: LOG: DAVPrincipal: Query: QF: SQL error "0A000"
> - ERROR: set-returning functions are not allowed in CASE LINE 4: ...
> expanded.g_id FROM (SELECT CASE WHEN $2 > 0 THEN expand_mem... ^ HINT:
> You might be able to move the set-returning function into a LATERAL
> FROM item. QUERY: SELECT group_id FROM group_member WHERE member_id =
> $1 UNION SELECT expanded.g_id FROM (SELECT CASE WHEN $2 > 0 THEN
> expand_memberships( group_id, $2 - 1) END AS g_id FROM group_member
> WHERE member_id = $1) AS expanded WHERE expanded.g_
>
> PHP message: davical: LOG: DAVPrincipal: Query: QF: id IS NOT NULL;
> CONTEXT: SQL function "expand_memberships" during startup SQL
> statement "SELECT bit_or(subquery.privileges) FROM ( SELECT privileges
> FROM grants WHERE by_principal=in_grantor AND by_collection IS NULL
> AND (to_principal=in_accessor OR to_principal IN (SELECT
> expand_memberships(in_accessor,in_depth))) UNION SELECT
> bit_or(sq2.privileges) FROM ( SELECT 32::BIT(24) AS privileges FROM
> expand_memberships(in_accessor,in_depth) WHERE expand_memberships =
> in_grantor UNION SELECT default_privileges AS privileges FROM
> principal WHERE principal_id = in_grantor ) AS sq2 ) AS subquery"
> PL/pgSQL function pprivs(bigint,bigint,integer) line 14 at SQL statement"
>
> PHP message: davical: LOG: DAVPrincipal: Query: QF: SELECT
> principal_id, username,
> pprivs(principal_id,:request_principal::int8,:scan_depth::int) FROM
> principal JOIN usr USING(user_no) WHERE usr.active=true AND
> principal_id IN (SELECT to_principal FROM grants WHERE by_principal =
> :request_principal AND (privileges & 5::BIT(24)) != 0::BIT(24) AND
> by_collection IS NULL AND to_principal != :request_principal )
> ":request_principal" => "3"   ":scan_depth" => "2"', referer:
> https://srv.example.com:5743/web/
>
>
>
> _______________________________________________
> Davical-general mailing list
> Davical-general@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/davical-general

--
Charles Bueche <cblists@bueche.ch>



_______________________________________________
Davical-general mailing list
Davical-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/davical-general
Re: 1.1.9.3 partly broken, issue with Postgres >10 ? [ In reply to ]
Charles,

I had largely forgotten about this (set-returning functions are not
allowed) problem. So the update-davical-database change made it work OK?
If so, glad to hear it.

-Jim

On 8 Jan 2021, at 11:06, Charles Bueche wrote:

> Hello again,
>
> answering my own request fo reference. After reading all docs and
> checking my config step-by-step, I had to redo the DB migration as
>
>     dba/update-davical-database --dbuser=postgres
>
> (note the --dbuser...). The problems went away and I'm now running
> 1.1.9.3. The same command without the option apparently wasn't
> sufficient.
>
> Thanks all for this wonderful piece of software !
>
> Regards,
> Charles
>
> On 05.01.21 11:37, Charles Bueche wrote:
>> Hello all,
>>
>> I'm migrating a davical instance (medium size, 13 principals, 41
>> instances) from Ubuntu 16.04 (1.1.9.2) to Debian 10 (1.1.9.3, with
>> awl 0.61). I'm installing from tarballs because Debian has an old
>> version.
>>
>> Migration went ok (install on new server, restore DB dump, ), but
>> delegated calendars do not show up, and we have numerous SQL errors
>> (see below) so I rolled back the migration and I'm now looking for a
>> fix.
>>
>> This was apparently already discussed in November '20, subject
>> "Unable to deliver invitation". Jim wrote "I think this is due to a
>> change made in PostgreSQL 10. See
>> https://github.com/postgres/postgres/commit/0436f6bde8848b7135f19dd7f8548b8c2ae89a34".
>>
>> What else ? /setup.php shows all green (except version check but this
>> is because outgoing http is not allowed so all ok)
>>
>> Is there anything I miss here ? Can't I use Postgres >= 10 ?
>>
>> Thanks for the clarification !
>> Charles
>>
>> ===================
>>
>> Log entry (somewhat filtered and reformatted)
>>
>> [Tue Jan 05 11:15:47.017705 2021] [proxy_fcgi:error] [pid 17453:tid
>> 140541619865344] [client 178.82.129.10:38910] AH01071: Got error '
>>
>> PHP message: davical: LOG: DAVPrincipal: Query: QF: SQL error "0A000"
>> - ERROR: set-returning functions are not allowed in CASE LINE 4: ...
>> expanded.g_id FROM (SELECT CASE WHEN $2 > 0 THEN expand_mem... ^
>> HINT: You might be able to move the set-returning function into a
>> LATERAL FROM item. QUERY: SELECT group_id FROM group_member WHERE
>> member_id = $1 UNION SELECT expanded.g_id FROM (SELECT CASE WHEN $2 >
>> 0 THEN expand_memberships( group_id, $2 - 1) END AS g_id FROM
>> group_member WHERE member_id = $1) AS expanded WHERE expanded.g_id IS
>> NOT NULL; CONTEXT: SQL function "expand_memberships" during startup
>> SQL function "p_has_proxy_access_to" statement 1"
>>
>> PHP message: davical: LOG: DAVPrincipal: Query: QF: SELECT
>> principal_id, username,
>> pprivs(:request_principal::int8,principal_id,:scan_depth::int) FROM
>> principal JOIN usr USING(user_no) WHERE usr.active=true AND
>> principal_id IN (SELECT * from
>> p_has_proxy_access_to(:request_principal,:scan_depth))
>> ":request_principal" => "3"    ":scan_depth" => "2"
>>
>> PHP message: davical: LOG: DAVPrincipal: Query: QF: SQL error "0A000"
>> - ERROR: set-returning functions are not allowed in CASE LINE 4: ...
>> expanded.g_id FROM (SELECT CASE WHEN $2 > 0 THEN expand_mem... ^
>> HINT: You might be able to move the set-returning function into a
>> LATERAL FROM item. QUERY: SELECT group_id FROM group_member WHERE
>> member_id = $1 UNION SELECT expanded.g_id FROM (SELECT CASE WHEN $2 >
>> 0 THEN expand_memberships( group_id, $2 - 1) END AS g_id FROM
>> group_member WHERE member_id = $1) AS expanded WHERE expanded.g_
>>
>> PHP message: davical: LOG: DAVPrincipal: Query: QF: id IS NOT NULL;
>> CONTEXT: SQL function "expand_memberships" during startup SQL
>> statement "SELECT bit_or(subquery.privileges) FROM ( SELECT
>> privileges FROM grants WHERE by_principal=in_grantor AND
>> by_collection IS NULL AND (to_principal=in_accessor OR to_principal
>> IN (SELECT expand_memberships(in_accessor,in_depth))) UNION SELECT
>> bit_or(sq2.privileges) FROM ( SELECT 32::BIT(24) AS privileges FROM
>> expand_memberships(in_accessor,in_depth) WHERE expand_memberships =
>> in_grantor UNION SELECT default_privileges AS privileges FROM
>> principal WHERE principal_id = in_grantor ) AS sq2 ) AS subquery"
>> PL/pgSQL function pprivs(bigint,bigint,integer) line 14 at SQL
>> statement"
>>
>> PHP message: davical: LOG: DAVPrincipal: Query: QF: SELECT
>> principal_id, username,
>> pprivs(principal_id,:request_principal::int8,:scan_depth::int) FROM
>> principal JOIN usr USING(user_no) WHERE usr.active=true AND
>> principal_id IN (SELECT to_principal FROM grants WHERE by_principal =
>> :request_principal AND (privileges & 5::BIT(24)) != 0::BIT(24) AND
>> by_collection IS NULL AND to_principal != :request_principal )
>> ":request_principal" => "3"   ":scan_depth" => "2"', referer:
>> https://srv.example.com:5743/web/
>>
>>
>>
>> _______________________________________________
>> Davical-general mailing list
>> Davical-general@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/davical-general
>
> --
> Charles Bueche <cblists@bueche.ch>
>
>
>
> _______________________________________________
> Davical-general mailing list
> Davical-general@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/davical-general


_______________________________________________
Davical-general mailing list
Davical-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/davical-general