Mailing List Archive

SQL error after upgrade: ":collection_id" => "-1"
Hello,
I just updated my machine from Debian 10 to 11, so Davical has been updated
from version 1.1.8 do 1.1.10.
Now, after the upgrade, I see this error when synchronizing the calendar
using the Android DAVx5 app:

caldav.php: Query: QF: SQL error "23503" - ERRORE: la INSERT o l'UPDATE sulla tabella "sync_tokens" viola il vincolo di chiave esterna "sync_tokens_collection_id_fkey"
DETTAGLI: La chiave (collection_id)=(-1) non è presente nella tabella "collection".
CONTESTO:
caldav.php: Query: QF: istruzione SQL "INSERT INTO sync_tokens(collection_id, sync_token) VALUES( in_collection_id, new_token )" funzione PL/pgSQL new_sync_token(bigint,bigint) riga 31 a istruzione SQL"
caldav.php: Query: QF: SELECT new_sync_token( 0, :collection_id) AS sync_token
caldav.php: Query: QF: ":collection_id" => "-1"
caldav.php: Query: QF: SQL error "23503" - ERRORE: la INSERT o l'UPDATE sulla tabella "sync_tokens" viola il vincolo di chiave esterna "sync_tokens_collection_id_fkey"
DETTAGLI: La chiave (collection_id)=(-1) non è presente nella tabella "collection".
CONTESTO:
caldav.php: Query: QF: istruzione SQL "INSERT INTO sync_tokens(collection_id, sync_token) VALUES( in_collection_id, new_token )" funzione PL/pgSQL new_sync_token(bigint,bigint) riga 31 a istruzione SQL"
caldav.php: Query: QF: SELECT new_sync_token( 0, :collection_id) AS sync_token
caldav.php: Query: QF: ":collection_id" => "-1"
PHP message: davical: BUG: :DAViCal Fatal Error: [0] Problem with database query at /usr/share/davical/inc/DAVResource.php:1359

In fact, PostgreSQL 11 shows the same error:

2023-06-13 11:25:51 CEST [89117-5] davical_app@davical ERRORE: la INSERT o l'UPDATE sulla tabella "sync_tokens" viola il vincolo di chiave esterna "sync_tokens_collection_id_fkey"
2023-06-13 11:25:51 CEST [89117-6] davical_app@davical DETTAGLI: La chiave (collection_id)=(-1) non è presente nella tabella "collection".
2023-06-13 11:25:51 CEST [89117-7] davical_app@davical CONTESTO: istruzione SQL "INSERT INTO sync_tokens(collection_id, sync_token) VALUES( in_collection_id, new_token )"
funzione PL/pgSQL new_sync_token(bigint,bigint) riga 31 a istruzione SQL
2023-06-13 11:25:51 CEST [89117-8] davical_app@davical ISTRUZIONE: SELECT new_sync_token( 0, -1) AS sync_token

Is this a know error? How may I fix it?

Thank you,
Giuseppe


_______________________________________________
Davical-general mailing list
Davical-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/davical-general
Re: SQL error after upgrade: ":collection_id" => "-1" [ In reply to ]
On Tue, 2023-06-13 at 11:59 +0200, Giuseppe Sacco via Davical-general wrote:
> Hello,
> I just updated my machine from Debian 10 to 11, so Davical has been
> updated
> from version 1.1.8 do 1.1.10.

Good news there, Debian 12 has just been released as well! :)

> Now, after the upgrade, I see this error when synchronizing the calendar
> using the Android DAVx5 app:
[snip errors]
> 2023-06-13 11:25:51 CEST [89117-6] davical_app@davical DETTAGLI:  La
> chiave (collection_id)=(-1) non è presente nella tabella "collection".
> 2023-06-13 11:25:51 CEST [89117-7] davical_app@davical CONTESTO: 
> istruzione SQL "INSERT INTO sync_tokens(collection_id, sync_token) VALUES(
> in_collection_id, new_token )"
>         funzione PL/pgSQL new_sync_token(bigint,bigint) riga 31 a
> istruzione SQL
> 2023-06-13 11:25:51 CEST [89117-8] davical_app@davical ISTRUZIONE:  SELECT
> new_sync_token( 0, -1) AS sync_token
>
> Is this a know error? How may I fix it?

It seems that collection_id is -1. I'm going to hazard that you don't have
any collections with a collection_id with -1. How is you SQL, can you
perform some database queries for me?

Cheers,
Andrew
--
Andrew Ruthven, Wellington, New Zealand
andrew@etc.gen.nz |
Catalyst Cloud: | This space intentionally left blank
https://catalystcloud.nz |
Re: SQL error after upgrade: ":collection_id" => "-1" [ In reply to ]
Hello Andrew,

Il giorno mar, 13/06/2023 alle 23.33 +1200, Andrew Ruthven ha scritto:
> On Tue, 2023-06-13 at 11:59 +0200, Giuseppe Sacco via Davical-general
> wrote:
> > Hello,
> > I just updated my machine from Debian 10 to 11, so Davical has been
> > updated
> > from version 1.1.8 do 1.1.10.
>
> Good news there, Debian 12 has just been released as well! :)

I was sure to already have 11 and wanted to upgrade to 12. Then I checked
the system and found it was at 11, so I decided to go one step at a time. I
am unsure about the best way now: should I try fix this problem while in
Debian 11, or should I complete the upgrade to 12 anche check the system at
the end?

> > Now, after the upgrade, I see this error when synchronizing the
> > calendar
> > using the Android DAVx5 app:
> [snip errors]
> > 2023-06-13 11:25:51 CEST [89117-6] davical_app@davical DETTAGLI:  La
> > chiave (collection_id)=(-1) non è presente nella tabella "collection".
> > 2023-06-13 11:25:51 CEST [89117-7] davical_app@davical CONTESTO: 
> > istruzione SQL "INSERT INTO sync_tokens(collection_id, sync_token)
> > VALUES( in_collection_id, new_token )"
> >         funzione PL/pgSQL new_sync_token(bigint,bigint) riga 31 a
> > istruzione SQL
> > 2023-06-13 11:25:51 CEST [89117-8] davical_app@davical ISTRUZIONE: 
> > SELECT new_sync_token( 0, -1) AS sync_token
> >
> > Is this a know error? How may I fix it?
>
> It seems that collection_id is -1. I'm going to hazard that you don't
> have any collections with a collection_id with -1. How is you SQL, can
> you perform some database queries for me?

Sure, I may query the database with psql.

Thank you,
Giuseppe


_______________________________________________
Davical-general mailing list
Davical-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/davical-general
Re: SQL error after upgrade: ":collection_id" => "-1" [ In reply to ]
Hello,
I completed the upgrade to Debian 12 and davical 1.1.12, but I still have the
same issue, so I traced all queries from the client, this is what it does:

SELECT usr.username
FROM group_member
JOIN principal ON (principal_id=group_id)
JOIN usr USING(user_no)
WHERE usr.active=true AND member_id = 1001
UNION
SELECT usr.username
FROM group_member
LEFT JOIN grants ON (to_principal=group_id)
JOIN principal ON (principal_id=by_principal)
JOIN usr USING(user_no)
WHERE usr.active=true AND member_id = 1001 and by_principal != member_id
ORDER BY 1;

0 records selected

SELECT collection.*, path_privs(1001::int8, collection.dav_name,2::int),
p.principal_id, p.type_id AS principal_type_id, p.displayname AS
principal_displayname,
p.default_privileges AS principal_default_privileges, timezones.vtimezone
FROM collection
LEFT JOIN principal p USING (user_no)
LEFT JOIN timezones ON (collection.timezone=timezones.tzid)
WHERE collection.dav_name = '/'
ORDER BY LENGTH(collection.dav_name) DESC
LIMIT 1;

0 records selected

SELECT property_name, property_value
FROM property
WHERE dav_name= '/';

0 records selected

SELECT *, pprivs(1001::int8,principal_id,2::int) AS privileges
FROM dav_principal
WHERE lower(username)=lower(text('giuseppe'));

1 record selected

SELECT usr.username
FROM group_member
JOIN principal ON (principal_id=group_id)
JOIN usr USING(user_no)
WHERE usr.active=true AND member_id = 1001
UNION
SELECT usr.username
FROM group_member
LEFT JOIN grants ON (to_principal=group_id)
JOIN principal ON (principal_id=by_principal)
JOIN usr USING(user_no)
WHERE usr.active=true AND member_id = 1001 and by_principal != member_id
ORDER BY 1;

0 records selected

SELECT new_sync_token( 0, -1) AS sync_token;

postgresql error: Key (collection_id)=(-1) not present in table "collection".

And, this is the error message in nginx log:

2023/06/15 01:20:50 [error] 1443444#1443444: *32 FastCGI sent in stderr: "
PHP message: davical: BUG: :DAViCal Fatal Error: [23503] SQLSTATE[23503]: Foreign key violation: 7 ERRORE: la INSERT o l'UPDATE sulla tabella "sync_tokens" viola il vincolo di chiave esterna "sync_tokens_collection_id_fkey"
DETTAGLI: La chiave (collection_id)=(-1) non è presente nella tabella "collection".
CONTESTO: istruzione SQL "INSERT INTO sync_tokens(collection_id, sync_token) VALUES( in_collection_id, new_token )"
funzione PL/pgSQL new_sync_token(bigint,bigint) riga 31 a istruzione SQL at /usr/share/awl/inc/AwlDatabase.php:94;
PHP message: ================= Stack Trace ===================;
PHP message: davical: LOG: :Response status 500 for PROPFIND /caldav.php/giuseppe/addresses/;
PHP message: davical: LOG: :***************** Response Header ****************;
PHP message: davical: LOG: headers:-->Server: 1.1;
PHP message: davical: LOG: headers:-->DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule;
PHP message: davical: LOG: headers:-->DAV: extended-mkcol, bind, addressbook, calendar-auto-schedule, calendar-proxy;
PHP message: davical: LOG: headers:-->X-DAViCal-Version: DAViCal/1.1.12; DB/1.3.5;
PHP message: davical: LOG: headers:-->Content-type: text/plain; charset="utf-8";
PHP message: davical: LOG: :******************** Response ********************;
PHP message: davical: LOG: response:-->DAViCal Fatal Error" while reading response header from upstream, client: 192.168.222.54, server: cal.domain.tld, request: "PROPFIND /caldav.php/giuseppe/addresses/ HTTP/2.0", upstream: "fastcgi://unix:/run/php/php8.2-fpm.sock:", host: "cal.domain.tld"


Thank you,
Giuseppe


_______________________________________________
Davical-general mailing list
Davical-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/davical-general
Re: SQL error after upgrade: ":collection_id" => "-1" [ In reply to ]
Hi Giuseppe,

It looks like DAViCal is failing to find the collection. Can you please try
running:

SELECT collection.*
FROM usr LEFT JOIN collection USING (user_no)
WHERE usr.username = 'giuseppe';

It certainly feels like things should be bailing out before it tries to use
-1 as a collection_id though!

Cheers,
Andrew

On Thu, 2023-06-15 at 01:30 +0200, Giuseppe Sacco via Davical-general wrote:
> Hello,
> I completed the upgrade to Debian 12 and davical 1.1.12, but I still have
> the
> same issue, so I traced all queries from the client, this is what it does:
>
> SELECT usr.username
> FROM group_member
>   JOIN principal ON (principal_id=group_id)
>   JOIN usr USING(user_no)
> WHERE usr.active=true AND member_id = 1001
> UNION
> SELECT usr.username
> FROM group_member
>   LEFT JOIN grants ON (to_principal=group_id)
>   JOIN principal ON (principal_id=by_principal)
>   JOIN usr USING(user_no)
> WHERE usr.active=true AND member_id = 1001 and by_principal != member_id
> ORDER BY 1;
>
> 0 records selected
>
> SELECT collection.*, path_privs(1001::int8, collection.dav_name,2::int),
>   p.principal_id, p.type_id AS principal_type_id, p.displayname AS
> principal_displayname,
>   p.default_privileges AS principal_default_privileges,
> timezones.vtimezone
> FROM collection
>   LEFT JOIN principal p USING (user_no)
>   LEFT JOIN timezones ON (collection.timezone=timezones.tzid)
> WHERE collection.dav_name = '/'
> ORDER BY LENGTH(collection.dav_name) DESC
> LIMIT 1;
>
> 0 records selected
>
> SELECT property_name, property_value
> FROM property
> WHERE dav_name= '/';
>
> 0 records selected
>
> SELECT *, pprivs(1001::int8,principal_id,2::int) AS privileges
> FROM dav_principal
> WHERE lower(username)=lower(text('giuseppe'));
>
> 1 record selected
>
> SELECT usr.username
> FROM group_member
>   JOIN principal ON (principal_id=group_id)
>   JOIN usr USING(user_no)
> WHERE usr.active=true AND member_id = 1001
> UNION
> SELECT usr.username
> FROM group_member
>   LEFT JOIN grants ON (to_principal=group_id)
>   JOIN principal ON (principal_id=by_principal)
>   JOIN usr USING(user_no)
> WHERE usr.active=true AND member_id = 1001 and by_principal != member_id
> ORDER BY 1;
>
> 0 records selected
>
> SELECT new_sync_token( 0, -1) AS sync_token;
>
> postgresql error: Key (collection_id)=(-1) not present in table
> "collection".
>
> And, this is the error message in nginx log:
>
> 2023/06/15 01:20:50 [error] 1443444#1443444: *32 FastCGI sent in stderr: "
> PHP message: davical: BUG: :DAViCal Fatal Error: [23503] SQLSTATE[23503]:
> Foreign key violation: 7 ERRORE:  la INSERT o l'UPDATE sulla tabella
> "sync_tokens" viola il vincolo di chiave esterna
> "sync_tokens_collection_id_fkey"
> DETTAGLI: La chiave (collection_id)=(-1) non è presente nella tabella
> "collection".
> CONTESTO: istruzione SQL "INSERT INTO sync_tokens(collection_id,
> sync_token) VALUES( in_collection_id, new_token )"
> funzione PL/pgSQL new_sync_token(bigint,bigint) riga 31 a istruzione SQL
> at /usr/share/awl/inc/AwlDatabase.php:94;
> PHP message: ================= Stack Trace ===================;
> PHP message: davical: LOG: :Response status 500 for PROPFIND
> /caldav.php/giuseppe/addresses/;
> PHP message: davical: LOG: :***************** Response Header
> ****************;
> PHP message: davical: LOG: headers:-->Server: 1.1;
> PHP message: davical: LOG: headers:-->DAV: 1, 2, 3, access-control,
> calendar-access, calendar-schedule;
> PHP message: davical: LOG: headers:-->DAV: extended-mkcol, bind,
> addressbook, calendar-auto-schedule, calendar-proxy;
> PHP message: davical: LOG: headers:-->X-DAViCal-Version: DAViCal/1.1.12;
> DB/1.3.5;
> PHP message: davical: LOG: headers:-->Content-type: text/plain;
> charset="utf-8";
> PHP message: davical: LOG: :******************** Response
> ********************;
> PHP message: davical: LOG: response:-->DAViCal Fatal Error" while reading
> response header from upstream, client: 192.168.222.54, server:
> cal.domain.tld, request: "PROPFIND /caldav.php/giuseppe/addresses/
> HTTP/2.0", upstream: "fastcgi://unix:/run/php/php8.2-fpm.sock:", host:
> "cal.domain.tld"
>
>
> Thank you,
> Giuseppe
>
>
> _______________________________________________
> Davical-general mailing list
> Davical-general@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/davical-general

--
Andrew Ruthven, Wellington, New Zealand
andrew@etc.gen.nz |
Catalyst Cloud: | This space intentionally left blank
https://catalystcloud.nz |
Re: SQL error after upgrade: ":collection_id" => "-1" [ In reply to ]
Hello Andrew,
collections are present.

Il giorno gio, 15/06/2023 alle 14.36 +1200, Andrew Ruthven ha scritto:
[...]
> It looks like DAViCal is failing to find the collection. Can you please try
> running:
>
> SELECT collection.*
> FROM usr LEFT JOIN collection USING (user_no)
> WHERE usr.username = 'giuseppe';
[...]

davical=> SELECT collection.user_no, collection.collection_id
FROM usr LEFT JOIN collection USING (user_no)
WHERE usr.username = 'giuseppe';
user_no | collection_id
---------+---------------
1001 | 4523
1001 | 1003
1001 | 1002
(3 rows)

Maybe the problem of the original query is that this user is not member of a
group. In fact, the group_member table is empty, so any JOIN with this table
gives no records.

Bye,
Giuseppe


_______________________________________________
Davical-general mailing list
Davical-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/davical-general
Re: SQL error after upgrade: ":collection_id" => "-1" [ In reply to ]
Hey,

Apologies for the delay, I've been sick the past week.

If the collection belongs to your user, not being a member of a group
shouldn't be a problem.

Can you please turn on
debugging? https://wiki.davical.org/index.php?title=Debugging

Easiest to just add $c->dbg["ALL"] = 1; to your DAViCal config file.

Cheers,
Andrew

On Thu, 2023-06-15 at 08:06 +0200, Giuseppe Sacco via Davical-general wrote:
> Hello Andrew,
> collections are present.
>
> Il giorno gio, 15/06/2023 alle 14.36 +1200, Andrew Ruthven ha scritto:
> [...]
> > It looks like DAViCal is failing to find the collection. Can you please
> > try
> > running:
> >
> > SELECT collection.*
> > FROM usr LEFT JOIN collection USING (user_no)
> > WHERE usr.username = 'giuseppe';
> [...]
>
> davical=> SELECT collection.user_no, collection.collection_id
> FROM usr LEFT JOIN collection USING (user_no)
> WHERE usr.username = 'giuseppe';
>  user_no | collection_id
> ---------+---------------
>     1001 |          4523
>     1001 |          1003
>     1001 |          1002
> (3 rows)
>
> Maybe the problem of the original query is that this user is not member of
> a
> group. In fact, the group_member table is empty, so any JOIN with this
> table
> gives no records.
>
> Bye,
> Giuseppe
>
>
> _______________________________________________
> Davical-general mailing list
> Davical-general@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/davical-general

--
Andrew Ruthven, Wellington, New Zealand
andrew@etc.gen.nz |
Catalyst Cloud: | This space intentionally left blank
https://catalystcloud.nz |
Re: SQL error after upgrade: ":collection_id" => "-1" [ In reply to ]
Hello Andrew,
thank you for your reply.

Il giorno dom, 18/06/2023 alle 14.16 +1200, Andrew Ruthven ha scritto:
> If the collection belongs to your user, not being a member of a group
> shouldn't be a problem.
>
> Can you please turn on
> debugging? https://wiki.davical.org/index.php?title=Debugging

I think this is what you requested, using evolution as a client:

ALL: I18N:Set locale to =it_IT.UTF-8=
ALL: I18N:Bound domain =davical= to location =/usr/share/davical/locale= using character set =UTF-8=
ALL: caldav:Version (1.1.12) == 1001.12
LOG: always: Query: DBGQ: SELECT schema_major, schema_minor, schema_patch FROM awl_db_revision ORDER BY schema_id DESC LIMIT 1;
LOG: always: Query: DBGQ: Took: 0,000621 to find 1 rows.
LOG: always: Query: DBGQ: SET TIMEZONE TO ?
LOG: always: Query: DBGQ: "0" => "UTC"
LOG: always: Query: DBGQ: Took: 0,000275 to find 0 rows.
LOG: :***************** Request Header ****************
LOG: :REPORT /caldav.php/giuseppe/calendar/
LOG: headers:-->Depth: 1
LOG: headers:-->Authorization: Delicious tasty password eaten by debugging monster!
LOG: headers:-->Accept-Language: it-it, it;q=0.9
LOG: headers:-->Accept-Encoding: gzip, deflate, br
LOG: headers:-->Content-Length: 278
LOG: headers:-->Content-Type: application/xml; charset="utf-8"
LOG: headers:-->Pragma: no-cache
LOG: headers:-->Cache-Control: no-cache
LOG: headers:-->User-Agent: Evolution/3.46.4
LOG: headers:-->Host: cal.domani.tld
LOG: :******************** Request ********************
LOG: request:--><calendar-query xmlns="urn:ietf:params:xml:ns:caldav" xmlns:D="DAV:"><D:prop><D:getetag/></D:prop><filter><comp-filter name="VCALENDAR"><comp-filter name="VEVENT"><time-range start="20230514T074916Z" end="20230723T074916Z"/></comp-filter></comp-filter></filter></calendar-query>
ALL: Cache:memcache_servers isn't set, using NoCache dummy interface
LOG: Principal: Query: DBGQ: SELECT *, 0::BIT(24) AS privileges FROM dav_principal WHERE lower(username)=lower(text(:param))
LOG: Principal: Query: DBGQ: ":param" => "giuseppe"
LOG: Principal: Query: DBGQ: Took: 0,001792 to find 1 rows.
LOG: BasicAuth: Query: DBGQ: SELECT role_name FROM role_member m join roles r ON r.role_no = m.role_no WHERE user_no = :user_no
LOG: BasicAuth: Query: DBGQ: ":user_no" => "1001"
LOG: BasicAuth: Query: DBGQ: Took: 0,000435 to find 0 rows.
ALL: Principal:No useful path split possible
LOG: Principal: Query: DBGQ: SELECT *, pprivs(:session_principal::int8,principal_id,:scan_depth::int) AS privileges FROM dav_principal WHERE lower(username)=lower(text(:param))
LOG: Principal: Query: DBGQ: ":session_principal" => "1001"
LOG: Principal: Query: DBGQ: ":scan_depth" => "2"
LOG: Principal: Query: DBGQ: ":param" => "giuseppe"
LOG: Principal: Query: DBGQ: Took: 0,001548 to find 1 rows.
LOG: caldav: Query: DBGQ: SELECT * FROM collection WHERE dav_name = :exact_name OR dav_name = :truncated_name OR dav_name = :trailing_slash_name ORDER BY LENGTH(dav_name) DESC LIMIT 1
LOG: caldav: Query: DBGQ: ":exact_name" => ""
LOG: caldav: Query: DBGQ: ":truncated_name" => ""
LOG: caldav: Query: DBGQ: ":trailing_slash_name" => "/"
LOG: caldav: Query: DBGQ: Took: 0,000459 to find 0 rows.
ALL: caldav: Collection '' is 0, type
ALL: Principal:No useful path split possible
LOG: Principal: Query: DBGQ: SELECT *, pprivs(:session_principal::int8,principal_id,:scan_depth::int) AS privileges FROM dav_principal WHERE lower(username)=lower(text(:param))
LOG: Principal: Query: DBGQ: ":session_principal" => "1001"
LOG: Principal: Query: DBGQ: ":scan_depth" => "2"
LOG: Principal: Query: DBGQ: ":param" => "giuseppe"
LOG: Principal: Query: DBGQ: Took: 0,000383 to find 1 rows.
LOG: DAVPrincipal: Query: DBGQ: SELECT usr.username FROM group_member JOIN principal ON (principal_id=group_id) JOIN usr USING(user_no) WHERE usr.active=true AND member_id = :member_id UNION SELECT usr.username FROM group_member LEFT JOIN grants ON (to_principal=group_id)
LOG: DAVPrincipal: Query: DBGQ: JOIN principal ON (principal_id=by_principal) JOIN usr USING(user_no) WHERE usr.active=true AND member_id = :member_id and by_principal != member_id ORDER BY 1
LOG: DAVPrincipal: Query: DBGQ: ":member_id" => "1001"
LOG: DAVPrincipal: Query: DBGQ: Took: 0,001114 to find 0 rows.
ALL: principal: User: giuseppe (1001) URL: /caldav.php/giuseppe/, By Email: 0
ALL: caldav:Full read permissions for user accessing /
ALL: caldav: Parsed incoming XML request body.
ALL: REPORT:method handler
ng: fopen(/var/log/davical/REPORT.debug): Failed to open stream: File o directory non esistente in /usr/share/davical/inc/caldav-REPORT.php on line 19
ALL: DAVResource::FetchCollection: Looking for collection for "/".
LOG: DAVResource: Query: DBGQ: SELECT collection.*, path_privs(:session_principal::int8, collection.dav_name,:scan_depth::int), p.principal_id, p.type_id AS principal_type_id, p.displayname AS principal_displayname, p.default_privileges AS principal_default_privileges, t
LOG: DAVResource: Query: DBGQ: imezones.vtimezone FROM collection LEFT JOIN principal p USING (user_no) LEFT JOIN timezones ON (collection.timezone=timezones.tzid) WHERE collection.dav_name = :raw_path ORDER BY LENGTH(collection.dav_name) DESC LIMIT 1
LOG: DAVResource: Query: DBGQ: ":raw_path" => "/"
LOG: DAVResource: Query: DBGQ: ":session_principal" => "1001"
LOG: DAVResource: Query: DBGQ: ":scan_depth" => "2"
LOG: DAVResource: Query: DBGQ: Took: 0,000811 to find 0 rows.
ALL: Cache::FetchCollection: Setting cache ns "collection-/" key "dav_resource1001". Type: root
ALL: DAVResource::FetchCollection: Found collection named "/" of type "root".
ALL: DAVResource::FromPath: Path "/" is <DAV::collection/> a collection.
ALL: DAVResource::FetchPrivileges: Read permissions for user accessing /
ALL: DAVResource:Testing any privileges of "Array" (1000000001) against allowed "110001" => "1" (1)
ALL: DAVResource::FetchCollection: Looking for collection for "/".
LOG: DAVResource: Query: DBGQ: SELECT collection.*, path_privs(:session_principal::int8, collection.dav_name,:scan_depth::int), p.principal_id, p.type_id AS principal_type_id, p.displayname AS principal_displayname, p.default_privileges AS principal_default_privileges, t
LOG: DAVResource: Query: DBGQ: imezones.vtimezone FROM collection LEFT JOIN principal p USING (user_no) LEFT JOIN timezones ON (collection.timezone=timezones.tzid) WHERE collection.dav_name = :raw_path ORDER BY LENGTH(collection.dav_name) DESC LIMIT 1
LOG: DAVResource: Query: DBGQ: ":raw_path" => "/"
LOG: DAVResource: Query: DBGQ: ":session_principal" => "1001"
LOG: DAVResource: Query: DBGQ: ":scan_depth" => "2"
LOG: DAVResource: Query: DBGQ: Took: 0,000767 to find 0 rows.
ALL: Cache::FetchCollection: Setting cache ns "collection-/" key "dav_resource1001". Type: root
ALL: DAVResource::FetchCollection: Found collection named "/" of type "root".
ALL: DAVResource::FromPath: Path "/" is <DAV::collection/> a collection.
ALL: I18N:Translated =The calendar-query report must be run against a calendar or a scheduling collection= into =The calendar-query report must be run against a calendar or a scheduling collection=
LOG: :Response status 403 for REPORT /caldav.php/giuseppe/calendar/
LOG: :***************** Response Header ****************
LOG: headers:-->Server: 1.1
LOG: headers:-->DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule
LOG: headers:-->DAV: extended-mkcol, bind, addressbook, calendar-auto-schedule, calendar-proxy
LOG: headers:-->X-DAViCal-Version: DAViCal/1.1.12; DB/1.3.5
LOG: headers:-->Content-type: text/plain; charset="utf-8"
LOG: :******************** Response ********************
LOG: response:-->The calendar-query report must be run against a calendar or a scheduling collection

Thank you very much,
Giuseppe


_______________________________________________
Davical-general mailing list
Davical-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/davical-general
Re: SQL error after upgrade: ":collection_id" => "-1" [ In reply to ]
Hi Giuseppe,

That doesn't appear to be the collection that was mentioned in the last
error, which was /caldav.php/giuseppe/addresses . Although I see this is
also complaining. Just a different error. Are you able to use the web UI to
check the configuration of your collections?

On Sun, 2023-06-18 at 10:00 +0200, Giuseppe Sacco via Davical-general wrote:
> Hello Andrew,
> thank you for your reply.
>
> Il giorno dom, 18/06/2023 alle 14.16 +1200, Andrew Ruthven ha scritto:
> > If the collection belongs to your user, not being a member of a group
> > shouldn't be a problem.
> >
> > Can you please turn on
> > debugging? https://wiki.davical.org/index.php?title=Debugging
>
> I think this is what you requested, using evolution as a client:
>
> ALL: I18N:Set locale to =it_IT.UTF-8=
> ALL: I18N:Bound domain =davical= to location =/usr/share/davical/locale=
> using character set =UTF-8=
> ALL: caldav:Version (1.1.12) == 1001.12
> LOG: always: Query: DBGQ: SELECT schema_major, schema_minor, schema_patch
> FROM awl_db_revision ORDER BY schema_id DESC LIMIT 1;
> LOG: always: Query: DBGQ: Took: 0,000621 to find 1 rows.
> LOG: always: Query: DBGQ: SET TIMEZONE TO ?
> LOG: always: Query: DBGQ:  "0" => "UTC"
> LOG: always: Query: DBGQ: Took: 0,000275 to find 0 rows.
> LOG: :***************** Request Header ****************
> LOG: :REPORT /caldav.php/giuseppe/calendar/
> LOG: headers:-->Depth: 1
> LOG: headers:-->Authorization: Delicious tasty password eaten by debugging
> monster!
> LOG: headers:-->Accept-Language: it-it, it;q=0.9
> LOG: headers:-->Accept-Encoding: gzip, deflate, br
> LOG: headers:-->Content-Length: 278
> LOG: headers:-->Content-Type: application/xml; charset="utf-8"
> LOG: headers:-->Pragma: no-cache
> LOG: headers:-->Cache-Control: no-cache
> LOG: headers:-->User-Agent: Evolution/3.46.4
> LOG: headers:-->Host: cal.domani.tld
> LOG: :******************** Request ********************
> LOG: request:--><calendar-query xmlns="urn:ietf:params:xml:ns:caldav"
> xmlns:D="DAV:"><D:prop><D:getetag/></D:prop><filter><comp-filter
> name="VCALENDAR"><comp-filter name="VEVENT"><time-range
> start="20230514T074916Z" end="20230723T074916Z"/></comp-filter></comp-
> filter></filter></calendar-query>
> ALL: Cache:memcache_servers isn't set, using NoCache dummy interface
> LOG: Principal: Query: DBGQ: SELECT *, 0::BIT(24) AS privileges FROM
> dav_principal WHERE lower(username)=lower(text(:param))
> LOG: Principal: Query: DBGQ:  ":param" => "giuseppe"
> LOG: Principal: Query: DBGQ: Took: 0,001792 to find 1 rows.
> LOG: BasicAuth: Query: DBGQ: SELECT role_name FROM role_member m join
> roles r ON r.role_no = m.role_no WHERE user_no = :user_no
> LOG: BasicAuth: Query: DBGQ:  ":user_no" => "1001"
> LOG: BasicAuth: Query: DBGQ: Took: 0,000435 to find 0 rows.
> ALL: Principal:No useful path split possible
> LOG: Principal: Query: DBGQ: SELECT *,
> pprivs(:session_principal::int8,principal_id,:scan_depth::int) AS
> privileges FROM dav_principal WHERE lower(username)=lower(text(:param))
> LOG: Principal: Query: DBGQ:  ":session_principal" => "1001"
> LOG: Principal: Query: DBGQ:  ":scan_depth" => "2"
> LOG: Principal: Query: DBGQ:  ":param" => "giuseppe"
> LOG: Principal: Query: DBGQ: Took: 0,001548 to find 1 rows.
> LOG: caldav: Query: DBGQ: SELECT * FROM collection WHERE dav_name =
> :exact_name OR dav_name = :truncated_name OR dav_name =
> :trailing_slash_name ORDER BY LENGTH(dav_name) DESC LIMIT 1
> LOG: caldav: Query: DBGQ:  ":exact_name" => ""
> LOG: caldav: Query: DBGQ:  ":truncated_name" => ""
> LOG: caldav: Query: DBGQ:  ":trailing_slash_name" => "/"
> LOG: caldav: Query: DBGQ: Took: 0,000459 to find 0 rows.
> ALL: caldav: Collection '' is 0, type
> ALL: Principal:No useful path split possible
> LOG: Principal: Query: DBGQ: SELECT *,
> pprivs(:session_principal::int8,principal_id,:scan_depth::int) AS
> privileges FROM dav_principal WHERE lower(username)=lower(text(:param))
> LOG: Principal: Query: DBGQ:  ":session_principal" => "1001"
> LOG: Principal: Query: DBGQ:  ":scan_depth" => "2"
> LOG: Principal: Query: DBGQ:  ":param" => "giuseppe"
> LOG: Principal: Query: DBGQ: Took: 0,000383 to find 1 rows.
> LOG: DAVPrincipal: Query: DBGQ: SELECT usr.username FROM group_member JOIN
> principal ON (principal_id=group_id) JOIN usr USING(user_no) WHERE
> usr.active=true AND member_id = :member_id UNION SELECT usr.username FROM
> group_member LEFT JOIN grants ON (to_principal=group_id)
> LOG: DAVPrincipal: Query: DBGQ:  JOIN principal ON
> (principal_id=by_principal) JOIN usr USING(user_no) WHERE usr.active=true
> AND member_id = :member_id and by_principal != member_id ORDER BY 1
> LOG: DAVPrincipal: Query: DBGQ:  ":member_id" => "1001"
> LOG: DAVPrincipal: Query: DBGQ: Took: 0,001114 to find 0 rows.
> ALL: principal: User: giuseppe (1001) URL: /caldav.php/giuseppe/, By
> Email: 0
> ALL: caldav:Full read permissions for user accessing /
> ALL: caldav: Parsed incoming XML request body.
> ALL: REPORT:method handler
> ng:  fopen(/var/log/davical/REPORT.debug): Failed to open stream: File o
> directory non esistente in /usr/share/davical/inc/caldav-REPORT.php on
> line 19
> ALL: DAVResource::FetchCollection: Looking for collection for "/".
> LOG: DAVResource: Query: DBGQ: SELECT collection.*,
> path_privs(:session_principal::int8,
> collection.dav_name,:scan_depth::int), p.principal_id, p.type_id AS
> principal_type_id, p.displayname AS principal_displayname,
> p.default_privileges AS principal_default_privileges, t
> LOG: DAVResource: Query: DBGQ: imezones.vtimezone FROM collection LEFT
> JOIN principal p USING (user_no) LEFT JOIN timezones ON
> (collection.timezone=timezones.tzid) WHERE collection.dav_name = :raw_path
> ORDER BY LENGTH(collection.dav_name) DESC LIMIT 1
> LOG: DAVResource: Query: DBGQ:  ":raw_path" => "/"
> LOG: DAVResource: Query: DBGQ:  ":session_principal" => "1001"
> LOG: DAVResource: Query: DBGQ:  ":scan_depth" => "2"
> LOG: DAVResource: Query: DBGQ: Took: 0,000811 to find 0 rows.
> ALL: Cache::FetchCollection: Setting cache ns "collection-/" key
> "dav_resource1001". Type: root
> ALL: DAVResource::FetchCollection: Found collection named "/" of type
> "root".
> ALL: DAVResource::FromPath: Path "/" is <DAV::collection/> a collection.
> ALL: DAVResource::FetchPrivileges: Read permissions for user accessing /
> ALL: DAVResource:Testing any privileges of "Array" (1000000001) against
> allowed "110001" => "1" (1)
> ALL: DAVResource::FetchCollection: Looking for collection for "/".
> LOG: DAVResource: Query: DBGQ: SELECT collection.*,
> path_privs(:session_principal::int8,
> collection.dav_name,:scan_depth::int), p.principal_id, p.type_id AS
> principal_type_id, p.displayname AS principal_displayname,
> p.default_privileges AS principal_default_privileges, t
> LOG: DAVResource: Query: DBGQ: imezones.vtimezone FROM collection LEFT
> JOIN principal p USING (user_no) LEFT JOIN timezones ON
> (collection.timezone=timezones.tzid) WHERE collection.dav_name = :raw_path
> ORDER BY LENGTH(collection.dav_name) DESC LIMIT 1
> LOG: DAVResource: Query: DBGQ:  ":raw_path" => "/"
> LOG: DAVResource: Query: DBGQ:  ":session_principal" => "1001"
> LOG: DAVResource: Query: DBGQ:  ":scan_depth" => "2"
> LOG: DAVResource: Query: DBGQ: Took: 0,000767 to find 0 rows.
> ALL: Cache::FetchCollection: Setting cache ns "collection-/" key
> "dav_resource1001". Type: root
> ALL: DAVResource::FetchCollection: Found collection named "/" of type
> "root".
> ALL: DAVResource::FromPath: Path "/" is <DAV::collection/> a collection.
> ALL: I18N:Translated =The calendar-query report must be run against a
> calendar or a scheduling collection= into =The calendar-query report must
> be run against a calendar or a scheduling collection=
> LOG: :Response status 403 for REPORT /caldav.php/giuseppe/calendar/
> LOG: :***************** Response Header ****************
> LOG: headers:-->Server: 1.1
> LOG: headers:-->DAV: 1, 2, 3, access-control, calendar-access, calendar-
> schedule
> LOG: headers:-->DAV: extended-mkcol, bind, addressbook, calendar-auto-
> schedule, calendar-proxy
> LOG: headers:-->X-DAViCal-Version: DAViCal/1.1.12; DB/1.3.5
> LOG: headers:-->Content-type: text/plain; charset="utf-8"
> LOG: :******************** Response ********************
> LOG: response:-->The calendar-query report must be run against a calendar
> or a scheduling collection
>
> Thank you very much,
> Giuseppe
>
>
> _______________________________________________
> Davical-general mailing list
> Davical-general@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/davical-general

--
Andrew Ruthven, Wellington, New Zealand
andrew@etc.gen.nz |
Catalyst Cloud: | This space intentionally left blank
https://catalystcloud.nz |
Re: SQL error after upgrade: ":collection_id" => "-1" [ In reply to ]
Hello,
Yes, i may access the web interface with both this user and the admin, as well.

Bye,
Giuseppe

Il 18 giugno 2023 12:12:21 CEST, Andrew Ruthven <andrew@etc.gen.nz> ha scritto:
>Hi Giuseppe,
>
>That doesn't appear to be the collection that was mentioned in the last
>error, which was /caldav.php/giuseppe/addresses . Although I see this is
>also complaining. Just a different error. Are you able to use the web UI to
>check the configuration of your collections?
[...]


_______________________________________________
Davical-general mailing list
Davical-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/davical-general
Re: SQL error after upgrade: ":collection_id" => "-1" [ In reply to ]
Hello Andrew

Il giorno dom, 18/06/2023 alle 22.12 +1200, Andrew Ruthven ha scritto:
> Hi Giuseppe,
>
> That doesn't appear to be the collection that was mentioned in the last
> error, which was /caldav.php/giuseppe/addresses . Although I see this is
> also complaining. Just a different error. Are you able to use the web UI to
> check the configuration of your collections?
[...]

I just created a new log for the original problem, i.e., using the Android
client app. I think it is a little bit long for an email, so I've put it here:
https://www.sguazz.it/~giuseppe/davical_deb12.log.bz2

Thank you,
Giuseppe


_______________________________________________
Davical-general mailing list
Davical-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/davical-general
Re: SQL error after upgrade: ":collection_id" => "-1" [ In reply to ]
Hello Andrew,
I finally found the problem. It was related to nginx & php-fpm configuration
that does not set $_SERVER['PATH_INFO'] in a way similar to other web
servers. 

I created a patch and a merge request:
https://gitlab.com/davical-project/davical/-/merge_requests/114

Thank you,
Giuseppe


_______________________________________________
Davical-general mailing list
Davical-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/davical-general
Re: SQL error after upgrade: ":collection_id" => "-1" [ In reply to ]
Hi Guiseppe,

Great sleuthing! Okay, I was never going to find that by digging through the
database!

Our current testing is only with Apache. Guess this highlights that maybe we
need to add nginx.

Cheers,
Andrew

On Wed, 2023-06-21 at 23:24 +0200, Giuseppe Sacco via Davical-general wrote:
> Hello Andrew,
> I finally found the problem. It was related to nginx & php-fpm
> configuration
> that does not set $_SERVER['PATH_INFO'] in a way similar to other web
> servers. 
>
> I created a patch and a merge request:
> https://gitlab.com/davical-project/davical/-/merge_requests/114
>
> Thank you,
> Giuseppe
>
>
> _______________________________________________
> Davical-general mailing list
> Davical-general@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/davical-general

--
Andrew Ruthven, Wellington, New Zealand
andrew@etc.gen.nz |
Catalyst Cloud: | This space intentionally left blank
https://catalystcloud.nz |