Open rutgerputter opened 4 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.
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.
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.
Also, this is still happening on the latest version of Calendar: 4.7.16
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?
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.
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
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.
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:
It still shows 12 members in the Team/Circle while there are only 2:
anything in the logs?
anything in the logs?
Nothing in nextcloud.log
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.
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';
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...
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)
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:
If you right- click on the request you should be able to copy the response. Please paste it here in its entirety.
{
"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
}
}
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?
Thank you, that is indeed of help!
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?
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?
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:
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.
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"}}
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?
Steps to reproduce
Expected behavior
Actual behaviour
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
Nextcloud configuration
Web server error log
Log file
No response
Browser log
Additional info
No response