server icon indicating copy to clipboard operation
server copied to clipboard

"Contact could not be saved" when Contacts shared with "everyone"

Open obinine opened this issue 6 years ago • 12 comments

⚠I started getting "Contact could not be saved" to every edit. After messing around I traced it to the "Everyone Group" app and that I had opened up read access for "everyone".

I will file a bug report with that module but wanted to post a note here in case others run into this issue.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

obinine avatar Jan 10 '19 17:01 obinine

GitMate.io thinks possibly related issues are https://github.com/nextcloud/contacts/issues/462 (Contact could not be saved), https://github.com/nextcloud/contacts/issues/405 (Contact could not be saved ), https://github.com/nextcloud/contacts/issues/507 (Contact could not be saved if both birthday and date of birth given), https://github.com/nextcloud/contacts/issues/329 (Ready-only shared contacts shouldn't be editable), and https://github.com/nextcloud/contacts/issues/501 (Contact could not be saved if both anniversary and birthday).

nextcloud-bot avatar Jan 10 '19 17:01 nextcloud-bot

I will need a screenshot of your network requests. Before you do anything, still on the development tools, there is a tab called network. Click on it and then the xhr filter. Do your action and screenshot the network log like this: capture d ecran_2018-09-27_21-49-46

skjnldsv avatar Jan 10 '19 19:01 skjnldsv

screenshot from 2019-01-10 17-02-14

As requested

obinine avatar Jan 11 '19 01:01 obinine

@obinine Thanks You have a 500 error in your log. This means your server failed to process the request.

Could you paste your nextcloud log please?

skjnldsv avatar Jan 11 '19 08:01 skjnldsv

nextcloud.log

This is the logfile that resulted from the single action of trying to add a field in Contact and having the "Contact could not be saved" message appear.

obinine avatar Jan 11 '19 09:01 obinine

Thanks. Moving to /server as this is a database request issue. :)

skjnldsv avatar Jan 11 '19 10:01 skjnldsv

@MorrisJobke @rullzer @georgehrke any clue?

skjnldsv avatar Jan 11 '19 10:01 skjnldsv

The really weird part of it all (at least to me) is that the edit is actually saved, in spite of the message, and is visible if you do an F5 refresh

obinine avatar Jan 11 '19 18:01 obinine

SELECT `uid`, `displayname` FROM `oc_users` `u` LEFT JOIN `oc_preferences` `p` ON (`userid` = `uid`) AND (`appid` = 'settings') AND (`configkey` = 'email') WHERE (`uid`  COLLATE UTF8_general_ci LIKE ?) OR (`displayname`  COLLATE UTF8_general_ci LIKE ?) OR (`configvalue`  COLLATE UTF8_general_ci LIKE ?) ORDER BY `uid_lower` ASC LIMIT -1 OFFSET 0' with params [\"%%\", \"%%\", \"%%\"]

I'm pretty sure LIMIT -1 is not allowed.

Didn't check, but my wild guess would be that this is the origin of the -1: https://github.com/icewind1991/group_everyone/blob/master/lib/GroupBackend.php#L75

cc @icewind1991

georgehrke avatar Jan 12 '19 09:01 georgehrke

Limit should indeed just be ignored when it is set to -1...

rullzer avatar Mar 04 '19 07:03 rullzer

(or 0 for that matter)

rullzer avatar Mar 04 '19 07:03 rullzer

I found this issue on https://ovio.org/projects and would love to contribute! [add other relevant info about you]

EchoPhalcon avatar Sep 16 '22 14:09 EchoPhalcon

Hi, please update to 24.0.8 or better 25.0.2 and report back if it fixes the issue. Thank you!

szaimen avatar Jan 09 '23 12:01 szaimen