nextcloud / circles

👪 Create groups with other users on a Nextcloud instance and share with them
GNU Affero General Public License v3.0
147 stars 48 forks source link

Inviting Teams/Circles results in the wrong user count and a error log stating Could not find organizer #1690

Open rutgerputter opened 4 months ago

rutgerputter commented 4 months ago

Steps to reproduce

  1. Create a Team/Circle with myself and a guest email address
  2. When creating a new appointment, add the created Team
  3. The user count will say 12 members in the Team when there are only 2

Expected behavior

  1. The correct count of Team/Circle members is stated
  2. The members get added correctly to the appointment invite

Actual behaviour

  1. A popup appears: Note that members of circles get invited but are not synced yet.
  2. No members show up in the appointment invite
  3. The Nextcloud log shows the error pasted below
  4. The browser console shows an error pasted below as well

Calendar app version

4.7.8 and 4.7.9 and maybe more versions

CalDAV-clients used

n/a

Browser

Chrome Version 126.0.6478.126 (Official Build) (64-bit) but others as well

Client operating system

Fedora 40

Server operating system

Debian 12, using docker with Nextcloud-AIO

Web server

Apache

Database engine version

PostgreSQL

PHP engine version

PHP 8.2

Nextcloud version

Nextcloud Hub 8 (29.0.3)

Updated from an older installed version or fresh install

Updated from an older version

List of activated apps

Enabled:
  - activity: 2.21.1
  - admin_audit: 1.19.0
  - app_api: 2.7.0
  - assistant: 1.1.0
  - bruteforcesettings: 2.9.0
  - calendar: 4.7.9
  - call_summary_bot: 1.1.1
  - camerarawpreviews: 0.8.5
  - circles: 29.0.0-dev
  - cloud_federation_api: 1.12.0
  - comments: 1.19.0
  - contacts: 6.0.0
  - contactsinteraction: 1.10.0
  - dashboard: 7.9.0
  - dav: 1.30.1
  - deck: 1.13.1
  - federatedfilesharing: 1.19.0
  - federation: 1.19.0
  - files: 2.1.0
  - files_antivirus: 5.5.6
  - files_downloadlimit: 2.0.0
  - files_external: 1.21.0
  - files_fulltextsearch: 29.0.0
  - files_pdfviewer: 2.10.0
  - files_reminders: 1.2.0
  - files_retention: 1.18.0
  - files_sharing: 1.21.0
  - files_trashbin: 1.19.0
  - files_versions: 1.22.0
  - fileslibreofficeedit: 1.1.0
  - firstrunwizard: 2.18.0
  - flow_notifications: 1.9.0
  - forms: 4.2.4
  - fulltextsearch: 29.0.0
  - fulltextsearch_elasticsearch: 29.0.1
  - groupfolders: 17.0.1
  - impersonate: 1.16.0
  - integration_giphy: 1.0.10
  - integration_google: 2.2.0
  - integration_openai: 2.0.3
  - integration_youtube: 0.2.1
  - logreader: 2.14.0
  - lookup_server_connector: 1.17.0
  - mail: 3.7.2
  - maps: 1.4.0
  - memegen: 1.0.8
  - memories: 7.3.1
  - nextcloud-aio: 0.6.0
  - nextcloud_announcements: 1.18.0
  - notes: 4.10.0
  - notifications: 2.17.0
  - notify_push: 0.6.12
  - oauth2: 1.17.0
  - oidc: 0.9.1
  - password_policy: 1.19.0
  - photos: 2.5.0
  - previewgenerator: 5.5.0
  - privacy: 1.13.0
  - provisioning_api: 1.19.0
  - recognize: 7.0.0
  - recommendations: 2.1.0
  - related_resources: 1.4.0
  - richdocuments: 8.4.3
  - serverinfo: 1.19.0
  - settings: 1.12.0
  - sharebymail: 1.19.0
  - sociallogin: 5.6.5
  - socialsharing_email: 3.1.0
  - spreed: 19.0.4
  - stt_helper: 1.1.1
  - support: 1.12.0
  - survey_client: 1.17.0
  - suspicious_login: 7.0.0
  - systemtags: 1.19.0
  - tables: 0.7.3
  - tasks: 0.16.0
  - text: 3.10.1
  - theming: 2.4.0
  - twofactor_backupcodes: 1.18.0
  - twofactor_totp: 11.0.0-dev
  - twofactor_webauthn: 1.4.0
  - user_status: 1.9.0
  - viewer: 2.3.0
  - weather_status: 1.9.0
  - workflow_ocr: 1.29.0
  - workflowengine: 2.11.0
Disabled:
  - encryption: 2.17.0
  - updatenotification: 1.19.1 (installed 1.16.0)
  - user_ldap: 1.20.0

Nextcloud configuration

{
    "system": {
        "memcache.local": "\\OC\\Memcache\\APCu",
        "apps_paths": [
            {
                "path": "\/var\/www\/html\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/www\/html\/custom_apps",
                "url": "\/custom_apps",
                "writable": true
            }
        ],
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "password": "***REMOVED SENSITIVE VALUE***",
            "port": 6379
        },
        "overwritehost": "cloud.maas-opleidingen.nl",
        "overwriteprotocol": "https",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "localhost",
            "cloud.maas-opleidingen.nl"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "pgsql",
        "version": "29.0.3.4",
        "overwrite.cli.url": "https:\/\/cloud.maas-opleidingen.nl\/",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "loglevel": 2,
        "log_type": "file",
        "logfile": "\/var\/www\/html\/data\/nextcloud.log",
        "log_rotate_size": "10485760",
        "log.condition": {
            "apps": [
                "admin_audit"
            ]
        },
        "preview_max_x": 2048,
        "preview_max_y": 2048,
        "jpeg_quality": 60,
        "enabledPreviewProviders": {
            "1": "OC\\Preview\\Image",
            "2": "OC\\Preview\\MarkDown",
            "3": "OC\\Preview\\MP3",
            "4": "OC\\Preview\\TXT",
            "5": "OC\\Preview\\OpenDocument",
            "6": "OC\\Preview\\Movie",
            "0": "OC\\Preview\\Imaginary"
        },
        "enable_previews": true,
        "upgrade.disable-web": true,
        "mail_smtpmode": "smtp",
        "trashbin_retention_obligation": "auto, 30",
        "versions_retention_obligation": "auto, 30",
        "activity_expire_days": "30",
        "simpleSignUpLink.shown": false,
        "share_folder": "\/Shared",
        "one-click-instance": true,
        "one-click-instance.user-limit": 100,
        "one-click-instance.link": "https:\/\/nextcloud.com\/all-in-one\/",
        "htaccess.RewriteBase": "\/",
        "files_external_allow_create_new_local": false,
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "allow_local_remote_servers": true,
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_sendmailmode": "smtp",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "465",
        "default_phone_region": "NL",
        "maintenance": false,
        "preview_imaginary_url": "***REMOVED SENSITIVE VALUE***",
        "memories.exiftool": "\/var\/www\/html\/custom_apps\/memories\/bin-ext\/exiftool-amd64-musl",
        "memories.qsv": true,
        "memories.vod.ffmpeg": "\/usr\/bin\/ffmpeg",
        "memories.vod.ffprobe": "\/usr\/bin\/ffprobe",
        "memories.vod.path": "\/var\/www\/html\/custom_apps\/memories\/bin-ext\/go-vod-amd64",
        "memories.vod.disable": false,
        "memories.vod.vaapi": true,
        "memories.vod.nvenc": false,
        "memories.vod.nvenc.scale": "npp",
        "memories.vod.nvenc.temporal_aq": true,
        "updatedirectory": "\/nc-updater",
        "updater.release.channel": "beta",
        "upgrade.cli-upgrade-link": "https:\/\/github.com\/nextcloud\/all-in-one\/discussions\/2726",
        "davstorage.request_timeout": 3600,
        "dbpersistent": false,
        "mail_smtpauth": 1,
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "appsallowlist": false,
        "maintenance_window_start": 100,
        "preview_imaginary_key": "***REMOVED SENSITIVE VALUE***",
        "memories.db.triggers.fcu": true,
        "auth.bruteforce.protection.enabled": true,
        "ratelimit.protection.enabled": true,
        "memories.gis_type": 2
    }
}

Web server error log

{"reqId":"ojIW7Ec8griOEmSYIJhs","level":3,"time":"2024-06-21T19:04:21+00:00","remoteAddr":"192.168.112.1","user":"rutger.putter","app":"index","method":"GET","url":"/index.php/apps/calendar/v1/circles/getmembers?format=json&circleId=FaWg5nkVLV3pqGTgmbESjn7DQYRwMDa","message":"Could not find organizer","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36","version":"29.0.3.3","exception":{"Exception":"OCA\\Calendar\\Service\\ServiceException","Message":"Could not find organizer","Code":0,"Trace":[{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":232,"function":"getCircleMembers","class":"OCA\\Calendar\\Controller\\ContactController","type":"->","args":["FaWg5nkVLV3pqGTgmbESjn7DQYRwMDa"]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":138,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\Calendar\\Controller\\ContactController"],"getCircleMembers"]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":184,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\Calendar\\Controller\\ContactController"],"getCircleMembers"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":338,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Calendar\\Controller\\ContactController","getCircleMembers",["OC\\AppFramework\\DependencyInjection\\DIContainer"],["calendar.contact.getcirclemembers"]]},{"file":"/var/www/html/lib/base.php","line":1050,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/apps/calendar/v1/circles/getmembers"]},{"file":"/var/www/html/index.php","line":49,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/custom_apps/calendar/lib/Controller/ContactController.php","Line":233,"message":"Could not find organizer","exception":{},"CustomMessage":"Could not find organizer"}}

Log file

No response

Browser log

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'forEach')
    at o.resolveCircleMembers (InviteesListSearch.vue:197:1)

circleService.js:84 

       GET https://<URL>/index.php/apps/calendar/v1/circles/getmembers?format=json&circleId=lpB2DM1ymQ82w2nVZjB4cnEWA12LcWq 500 (Internal Server Error)

Additional info

No response

gwnmikedus commented 3 months ago

Confirming this issue on 29.0.4 As of right now it is impossible to efficiently use the circles/teams feature. Yes it does work with Talk rooms and Collectives (which is great for our internal knowledge base!).

Planning meetings however is a pain. For every meeting I have to manually add all team members to the list. I wish I could support on the development of this issue, however I am not capable of that (yet).

Hope you guys can include this issue unified into the current in-development & to-do PR's that are related to calendar, groups and contact groups.

miaulalala commented 2 months ago

Thanks for reporting this issue. Can you please confirm that your organizer email address is unique within your Nextcloud instance? The organizer email will be the logged in user's email address that created the calendar event.

rutgerputter commented 2 months ago

Thanks for reporting this issue. Can you please confirm that your organizer email address is unique within your Nextcloud instance? The organizer email will be the logged in user's email address that created the calendar event.

We have a relatively small instance with less than 20 users and I can confirm all email addresses of the Nextcloud users are unique.

rutgerputter commented 2 months ago

Also, this is still happening on the latest version of Calendar: 4.7.16

miaulalala commented 2 months ago

Unfortunately I can't reproduce the issue - can you send me the ics file either per mail at anna.larch@nextcloud.com or can you post an anonymised version here?

rutgerputter commented 2 months ago

Unfortunately I can't reproduce the issue - can you send me the ics file either per mail at anna.larch@nextcloud.com or can you post an anonymised version here?

This issue occurs while creating the event, before we save the event and send it out. So no ics is available.

When the team has been selected as invitees, the browser shows the following error in the console:

InviteesListSearch.vue:197 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'forEach')
    at o.resolveCircleMembers (InviteesListSearch.vue:197:1)

This is also shown:

GET https://<hostname of nextcloud>/index.php/apps/calendar/v1/circles/getmembers?format=json&circleId=<ID of Circle> 500 (Internal Server Error)

So maybe someone can troubleshoot the o.resolveCircleMembers function to see what's going on? It really looks like there is an issue resoving the members of the Circle/Team we're trying to invite.

miaulalala commented 2 months ago

Would you be willing to apply the fix in the linked PR as a patch and then try again? You can find info on how to apply a patch here: https://docs.nextcloud.com/server/latest/admin_manual/issues/applying_patch.html#patching-apps

rutgerputter commented 2 months ago

Would you be willing to apply the fix in the linked PR as a patch and then try again? You can find info on how to apply a patch here: https://docs.nextcloud.com/server/latest/admin_manual/issues/applying_patch.html#patching-apps

Sure! Please stand-by while I get everything in place. I'll report back soon.

rutgerputter commented 2 months ago

Patching was successful:

9f4c3bdabe60:/var/www/html/custom_apps/calendar# patch -p 1 < ./patch.txt 
patching file lib/Controller/ContactController.php
Hunk nextcloud/calendar#1 succeeded at 30 (offset 23 lines).
Hunk nextcloud/calendar#2 succeeded at 42 (offset 23 lines).
Hunk nextcloud/calendar#3 succeeded at 70 (offset 23 lines).
Hunk nextcloud/calendar#4 succeeded at 201 (offset 23 lines).
patching file lib/Controller/ContactController.php
Hunk nextcloud/calendar#1 succeeded at 235 (offset 23 lines).
patching file lib/Controller/ContactController.php
Hunk nextcloud/calendar#1 succeeded at 235 (offset 23 lines).

But sadly, the problem still exists, here is the console output of Chrome: image

It still shows 12 members in the Team/Circle while there are only 2: image

image

miaulalala commented 2 months ago

anything in the logs?

rutgerputter commented 2 months ago

anything in the logs?

Nothing in nextcloud.log

rutgerputter commented 2 months ago

image From these browser errors, I'm guessing the circleservice.js is outputting the wrong members and that's why the forEach function is having problems.

miaulalala commented 2 months ago

I think it's two different issues - one is the count of a circle, which is provided by the sharing backend, and the other is the getMembers function which also errors out somewhere.

Can you run the following queries?

SELECT * FROM oc_circles_circle where unique_id = 'the-circle-id-from-your-get-request';

and

SELECT * FROM oc_circles_members where circle_id = 'the-circle-id-from-your-get-request';

rutgerputter commented 2 months ago

We may be on to something, the second SELECT statement does not work:

nextcloud_database=> SELECT * FROM oc_circles_circle where unique_id = 'lpB2DM1ymQ82w2nVZjB4cnEWA12LcWq';
 id |            unique_id            |   name    | display_name | sanitized_name | instance | config | source |                 settings                 | description |      creation       | contact_addressbook | contact_groupname 
----+---------------------------------+-----------+--------------+----------------+----------+--------+--------+------------------------------------------+-------------+---------------------+---------------------+-------------------
 27 | lpB2DM1ymQ82w2nVZjB4cnEWA12LcWq | Test Team | Test Team    | Test Team      |          |      0 |     16 | {"population":2,"populationInherited":2} |             | 2024-07-04 06:47:50 |                   0 | 
(1 row)

nextcloud_database=> SELECT * FROM oc_circles_members where circle_id = 'lpB2DM1ymQ82w2nVZjB4cnEWA12LcWq';
ERROR:  relation "oc_circles_members" does not exist
LINE 1: SELECT * FROM oc_circles_members where circle_id = 'lpB2DM1y...
rutgerputter commented 2 months ago

I listed all the tables in the database and found a typo in the table name in the second statement

It's not oc_circles_members but oc_circles_member.

nextcloud_database=> SELECT * FROM oc_circles_member where circle_id = 'lpB2DM1ymQ82w2nVZjB4cnEWA12LcWq';
 id |            single_id            |            circle_id            |            member_id            |          user_id          | user_type | instance |           invited_by            | level | status |                                                                                                                                                                                                                                                   note                                                                                                                                                                                                                                                   |        cached_name        |    cached_update    | contact_id | contact_meta |       joined        
----+---------------------------------+---------------------------------+---------------------------------+---------------------------+-----------+----------+---------------------------------+-------+--------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------+---------------------+------------+--------------+---------------------
 41 | mX9u6DlCy5iJsQv7QD2ySykLCL5VauY | lpB2DM1ymQ82w2nVZjB4cnEWA12LcWq | rL31xBeu6c86BFGl4JoUeAlEW7fy5Cc | rutger.putter@<redacted domain> |         4 |          | q5l317NDo8fF82bpcYFBXjLhfXajt2z |     1 | Member | {"invitedBy":{"id":"q5l317NDo8fF82bpcYFBXjLhfXajt2z","userId":"rutger.putter","userType":1,"displayName":"Rutger Putter","instance":"cloud.maas-opleidingen.nl","basedOn":{"id":"q5l317NDo8fF82bpcYFBXjLhfXajt2z","name":"user:rutger.putter:q5l317NDo8fF82bpcYFBXjLhfXajt2z","displayName":"Rutger Putter","sanitizedName":"","source":1,"population":0,"config":1,"description":"","url":"\/apps\/contacts\/direct\/circle\/q5l317NDo8fF82bpcYFBXjLhfXajt2z","creation":1676205892,"initiator":null}}} | rutger.putter@<redacted domain> | 2024-07-04 06:48:03 |            |              | 2024-07-04 06:48:03
 40 | q5l317NDo8fF82bpcYFBXjLhfXajt2z | lpB2DM1ymQ82w2nVZjB4cnEWA12LcWq | pelcJblEMROfGApoe5rOd72lyveN4Gb | rutger.putter             |         1 |          | q5l317NDo8fF82bpcYFBXjLhfXajt2z |     9 | Member | {"invitedBy":{"id":"q5l317NDo8fF82bpcYFBXjLhfXajt2z","userId":"rutger.putter","userType":1,"displayName":"Rutger Putter","instance":"cloud.maas-opleidingen.nl","basedOn":{"id":"q5l317NDo8fF82bpcYFBXjLhfXajt2z","name":"user:rutger.putter:q5l317NDo8fF82bpcYFBXjLhfXajt2z","displayName":"Rutger Putter","sanitizedName":"","source":1,"population":0,"config":1,"description":"","url":"\/apps\/contacts\/direct\/circle\/q5l317NDo8fF82bpcYFBXjLhfXajt2z","creation":1676205892,"initiator":null}}} | Rutger Putter             | 2024-07-05 07:45:26 |            |              | 2024-07-04 06:47:50
(2 rows)
miaulalala commented 2 months ago

ok, can you observer the request that returns the initial results for the circle?

For me it has the url http://localhost/ocs/v2.php/apps/files_sharing/api/v1/sharees?format=json&search=test&perPage=200&itemType=pringroucipals

It should return a response that looks like this:

image

If you right- click on the request you should be able to copy the response. Please paste it here in its entirety.

rutgerputter commented 2 months ago
{
    "meta": {
        "status": "ok",
        "statuscode": 200,
        "message": "OK"
    },
    "data": {
        "exact": {
            "users": [],
            "groups": [],
            "remotes": [],
            "remote_groups": [],
            "emails": [],
            "circles": [],
            "rooms": []
        },
        "users": [],
        "groups": [],
        "remotes": [],
        "remote_groups": [],
        "emails": [],
        "lookup": [],
        "circles": [
            {
                "label": "Test Team",
                "shareWithDescription": "Circle is eigendom van Rutger Putter",
                "value": {
                    "shareType": 7,
                    "shareWith": "lpB2DM1ymQ82w2nVZjB4cnEWA12LcWq",
                    "circle": {
                        "id": "lpB2DM1ymQ82w2nVZjB4cnEWA12LcWq",
                        "name": "Test Team",
                        "displayName": "Test Team",
                        "sanitizedName": "Test Team",
                        "source": 16,
                        "population": 2,
                        "config": 0,
                        "description": "",
                        "url": "/apps/contacts/direct/circle/lpB2DM1ymQ82w2nVZjB4cnEWA12LcWq",
                        "creation": 1720075670,
                        "initiator": null,
                        "owner": {
                            "id": "pelcJblEMROfGApoe5rOd72lyveN4Gb",
                            "circleId": "lpB2DM1ymQ82w2nVZjB4cnEWA12LcWq",
                            "singleId": "q5l317NDo8fF82bpcYFBXjLhfXajt2z",
                            "userId": "rutger.putter",
                            "userType": 1,
                            "instance": "cloud.maas-opleidingen.nl",
                            "local": true,
                            "level": 9,
                            "status": "Member",
                            "displayName": "Rutger Putter",
                            "displayUpdate": 1720165526,
                            "notes": {
                                "invitedBy": {
                                    "id": "q5l317NDo8fF82bpcYFBXjLhfXajt2z",
                                    "userId": "rutger.putter",
                                    "userType": 1,
                                    "displayName": "Rutger Putter",
                                    "instance": "cloud.maas-opleidingen.nl",
                                    "basedOn": {
                                        "id": "q5l317NDo8fF82bpcYFBXjLhfXajt2z",
                                        "name": "user:rutger.putter:q5l317NDo8fF82bpcYFBXjLhfXajt2z",
                                        "displayName": "Rutger Putter",
                                        "sanitizedName": "",
                                        "source": 1,
                                        "population": 0,
                                        "config": 1,
                                        "description": "",
                                        "url": "/apps/contacts/direct/circle/q5l317NDo8fF82bpcYFBXjLhfXajt2z",
                                        "creation": 1676205892,
                                        "initiator": null
                                    }
                                }
                            },
                            "contactId": "",
                            "contactMeta": "",
                            "joined": 1720075670,
                            "invitedBy": {
                                "id": "q5l317NDo8fF82bpcYFBXjLhfXajt2z",
                                "userId": "rutger.putter",
                                "userType": 1,
                                "displayName": "Rutger Putter",
                                "instance": "cloud.maas-opleidingen.nl",
                                "basedOn": {
                                    "id": "q5l317NDo8fF82bpcYFBXjLhfXajt2z",
                                    "name": "user:rutger.putter:q5l317NDo8fF82bpcYFBXjLhfXajt2z",
                                    "displayName": "Rutger Putter",
                                    "sanitizedName": "",
                                    "source": 1,
                                    "population": 0,
                                    "config": 1,
                                    "description": "",
                                    "url": "/apps/contacts/direct/circle/q5l317NDo8fF82bpcYFBXjLhfXajt2z",
                                    "creation": 1676205892,
                                    "initiator": null
                                }
                            }
                        }
                    }
                }
            }
        ],
        "rooms": [],
        "lookupEnabled": true
    }
}
rutgerputter commented 2 months ago

I found some relevant log entries through the admin panel:

{"reqId":"b2CG3SZ3cJQO1PIl0ib4","level":3,"time":"2024-08-29T09:35:08+00:00","remoteAddr":"127.0.0.1","user":"rutger.putter","app":"calendar","method":"GET","url":"/index.php/apps/calendar/v1/circles/getmembers?format=json&circleId=lCpZLeHRsDOzyqV1QH5oEmwQlcxNC4Z","message":"Could not find user with user idpiet@puk.nl","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36","version":"29.0.4.1","data":{"app":"calendar"}}
{"reqId":"b2CG3SZ3cJQO1PIl0ib4","level":3,"time":"2024-08-29T09:35:08+00:00","remoteAddr":"127.0.0.1","user":"rutger.putter","app":"index","method":"GET","url":"/index.php/apps/calendar/v1/circles/getmembers?format=json&circleId=lCpZLeHRsDOzyqV1QH5oEmwQlcxNC4Z","message":"Could not find circle member","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36","version":"29.0.4.1","exception":{"Exception":"OCA\\Calendar\\Service\\ServiceException","Message":"Could not find circle member","Code":0,"Trace":[{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":232,"function":"getCircleMembers","class":"OCA\\Calendar\\Controller\\ContactController","type":"->","args":["lCpZLeHRsDOzyqV1QH5oEmwQlcxNC4Z"]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":138,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\Calendar\\Controller\\ContactController"],"getCircleMembers"]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":184,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\Calendar\\Controller\\ContactController"],"getCircleMembers"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":338,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Calendar\\Controller\\ContactController","getCircleMembers",["OC\\AppFramework\\DependencyInjection\\DIContainer"],["calendar.contact.getcirclemembers"]]},{"file":"/var/www/html/lib/base.php","line":1050,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/apps/calendar/v1/circles/getmembers"]},{"file":"/var/www/html/index.php","line":49,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/custom_apps/calendar/lib/Controller/ContactController.php","Line":216,"message":"Could not find circle member","exception":{},"CustomMessage":"Could not find circle member"}}

Maybe this helps in troubleshooting the issue?

miaulalala commented 2 months ago

Thank you, that is indeed of help!

miaulalala commented 2 months ago

Could you please check if the user idpiet@puk.nl exists in your instance? If so, could you please check if the user is a member of any circles?

rutgerputter commented 2 months ago

Could you please check if the user idpiet@puk.nl exists in your instance? If so, could you please check if the user is a member of any circles?

That is an external mail address I added to the circle for testing, it does not exist. What’s weird though is that it shows up as ‘idpiet@puk.nl’ while I added the mail address as ‘piet@puk.nl’. Could some function be adding the letters ‘id’ in front of the user resulting in a not found error?

miaulalala commented 2 months ago

Could you please check if the user idpiet@puk.nl exists in your instance? If so, could you please check if the user is a member of any circles?

That is an external mail address I added to the circle for testing, it does not exist. What’s weird though is that it shows up as ‘idpiet@puk.nl’ while I added the mail address as ‘piet@puk.nl’. Could some function be adding the letters ‘id’ in front of the user resulting in a not found error?

Maybe there's a string concatenation somewhere that is causing trouble... I will investigate further :detective:

miaulalala commented 1 month ago

I'm sorry to say that the string concatenation is a false positive from the logging. I think I will need to dig deeper into the circles code to see why the user isn't found.

rutgerputter commented 1 month ago

So, I've taken the plunge into updating to Nextcloud 30 and I now see some logs occurring, having to do with Teams as well, maybe related?

{"reqId":"zFnECdUNstmWtVL0qHqI","level":3,"time":"2024-09-14T19:19:51+00:00","remoteAddr":"127.0.0.1","user":"rutger.putter","app":"no app in context","method":"GET","url":"/ocs/v2.php/teams/resources/account/sabre-vobject-eabedc2b-cadf-4813-b966-f83febf5d893","message":"No provider found for id account","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36","version":"30.0.0.14","exception":{"Exception":"RuntimeException","Message":"No provider found for id account","Code":0,"Trace":[{"file":"/var/www/html/lib/private/Teams/TeamManager.php","line":91,"function":"getProvider","class":"OC\\Teams\\TeamManager","type":"->","args":["account"]},{"file":"/var/www/html/core/Controller/TeamsApiController.php","line":68,"function":"getTeamsForResource","class":"OC\\Teams\\TeamManager","type":"->","args":["account","sabre-vobject-eabedc2b-cadf-4813-b966-f83febf5d893","rutger.putter"]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":208,"function":"listTeams","class":"OC\\Core\\Controller\\TeamsApiController","type":"->","args":["account","sabre-vobject-eabedc2b-cadf-4813-b966-f83febf5d893"]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":114,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OC\\Core\\Controller\\TeamsApiController"],"listTeams"]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":161,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OC\\Core\\Controller\\TeamsApiController"],"listTeams"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":302,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OC\\Core\\Controller\\TeamsApiController","listTeams",["OC\\AppFramework\\DependencyInjection\\DIContainer"],["account","sabre-vobject-eabedc2b-cadf-4813-b966-f83febf5d893","ocs.core.teamsapi.listteams"]]},{"file":"/var/www/html/ocs/v1.php","line":43,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/ocsapp/teams/resources/account/sabre-vobject-eabedc2b-cadf-4813-b966-f83febf5d893"]},{"file":"/var/www/html/ocs/v2.php","line":7,"args":["/var/www/html/ocs/v1.php"],"function":"require_once"}],"File":"/var/www/html/lib/private/Teams/TeamManager.php","Line":65,"message":"No provider found for id account","exception":{},"CustomMessage":"No provider found for id account"}}

rutgerputter commented 3 weeks ago

So, I've been poking around this issue again, trying different things.

First I though there might be an issue where there were only external email-addresses added to the team, but adding another user still causes the count to be wrong in calendar.

Then, I've started adding more external email-addresses to the team, this is what happened to the count:

So, from the above list, I assume that the code is adding a 1 to the beginning of the member count number.

Could this help in figuring out where it's going wrong?