Content
View differences
Updated by Matthew Trescott over 5 years ago
### **Environment**:
Your OpenProject Version: 11.1.2—Self-hosted with Rails 6.1.3; superfluous `postgres_type_cache` patch removed (see [https://github.com/opf/openproject/commit/d497575c491ea5a88e1b37ba9d8f715536878aab](https://github.com/opf/openproject/commit/d497575c491ea5a88e1b37ba9d8f715536878aab))
Server: openSUSE Leap 15.2 with devel:languages:ruby:extensions repository.
Client: openSUSE Tumbleweed, with Firefox
### **Logs**
When attempting to open the list of assignees, the following error is appended to the Puma error log:
```text
/usr/lib64/ruby/gems/2.7.0/gems/grape-1.5.1/lib/grape/middleware/base.rb:41:in `rescue in call!': caught error of type ActiveRecord::StatementInvalid in after callback inside Grape::Middleware::Formatter : PG::AmbiguousColumn: ERROR: column reference "firstname" is ambiguous
```
I enabled debug-level loement that ActiveRecord is sending to PostgreSQL:
```sql
SELECT "users"."id" AS t0_r0,
"users"."login" AS t0_r1,
"users"."firstname" AS t0_r2,
"users"."lastname" AS t0_r3,
"users"."mail" AS t0_r4,
"users"."admin" AS t0_r5,
"users"."status" AS t0_r6,
"users"."last_login_on" AS t0_r7,
"users"."language" AS t0_r8,
"users"."auth_source_id" AS t0_r9,
"users"."created_at" AS t0_r10,
"users"."updated_at" AS t0_r11,
"users"."type" AS t0_r12,
"users"."identity_url" AS t0_r13,
"users"."mail_notification" AS t0_r14,
"users"."first_login" AS t0_r15,
"users"."force_password_change" AS t0_r16,
"users"."failed_login_count" AS t0_r17,
"users"."last_failed_login_on" AS t0_r18,
"users"."consented_at" AS t0_r19,
"members_users"."id" AS t1_r0,
"members_users"."user_id" AS t1_r1,
"members_users"."project_id" AS t1_r2,
"members_users"."created_at" AS t1_r3,
"members_users"."mail_notification" AS t1_r4,
"members_users"."updated_at" AS t1_r5,
"roles_members"."id" AS t2_r0,
"roles_members"."name" AS t2_r1,
"roles_members"."position" AS t2_r2,
"roles_members"."assignable" AS t2_r3,
"roles_members"."builtin" AS t2_r4,
"roles_members"."type" AS t2_r5,
"roles_members"."created_at" AS t2_r6,
"roles_members"."updated_at" AS t2_r7,
"user_preferences"."id" AS t3_r0,
"user_preferences"."user_id" AS t3_r1,
"user_preferences"."others" AS t3_r2,
"user_preferences"."hide_mail" AS t3_r3,
"user_preferences"."time_zone" AS t3_r4
FROM "users"
INNER JOIN "members"
ON "users"."id" = "members"."user_id"
LEFT OUTER JOIN "users" "principals_members"
ON "principals_members"."id" = "members"."user_id"
LEFT OUTER JOIN "member_roles"
ON "member_roles"."member_id" = "members"."id"
LEFT OUTER JOIN "roles"
ON "roles"."id" = "member_roles"."role_id"
LEFT OUTER JOIN "members" "members_users"
ON "members_users"."user_id" = "users"."id"
LEFT OUTER JOIN "roles" "roles_members"
ON "roles_members"."id" = "member_roles"."role_id"
LEFT OUTER JOIN "user_preferences"
ON "user_preferences"."user_id" = "users"."id"
WHERE "members"."project_id" = $1
AND ((
users.type='User'
OR users.type='Group')
AND (
users.status=1
OR users.status=4)
AND roles.assignable = true)
AND "members_users"."project_id" = $2
ORDER BY firstname,
lastname [["project_id", 5],
["project_id", 5]]
```
There is an unnecessary extra left join: the `users` table is joined with itself under the alias `principals_members`. This causes the `ORDER BY firstname, lastname` statement to be ambiguous.
Here's a backtrace (most recent call last) starting at a somewhat-relevant point:
```text
/usr/lib64/ruby/gems/2.7.0/gems/grape-1.5.1/lib/grape/middleware/formatter.rb:30:in `after'
/usr/lib64/ruby/gems/2.7.0/gems/grape-1.5.1/lib/grape/middleware/formatter.rb:46:in `build_formatted_response'
/usr/lib64/ruby/gems/2.7.0/gems/activesupport-6.1.1/lib/active_support/notifications.rb:205:in `instrument'
/usr/lib64/ruby/gems/2.7.0/gems/grape-1.5.1/lib/grape/middleware/formatter.rb:47:in `block in build_formatted_response'
/usr/lib64/ruby/gems/2.7.0/gems/grape-1.5.1/lib/grape/middleware/formatter.rb:47:in `collect'
/usr/lib64/ruby/gems/2.7.0/gems/grape-1.5.1/lib/grape/middleware/formatter.rb:47:in `block (2 levels) in build_formatted_response'
/usr/lib/openproject/lib/api/formatter.rb:37:in `call'
/usr/lib64/ruby/gems/2.7.0/gems/representable-3.0.4/lib/representable/json.rb:44:in `to_json'
/usr/lib64/ruby/gems/2.7.0/gems/roar-1.1.0/lib/roar/json/hal.rb:58:in `to_hash'
/usr/lib64/ruby/gems/2.7.0/gems/representable-3.0.4/lib/representable/hash.rb:34:in `to_hash'
/usr/lib64/ruby/gems/2.7.0/gems/representable-3.0.4/lib/representable.rb:45:in `create_representation_with'
/usr/lib64/ruby/gems/2.7.0/gems/representable-3.0.4/lib/representable.rb:70:in `representable_map!'
/usr/lib64/ruby/gems/2.7.0/gems/representable-3.0.4/lib/representable.rb:51:in `call'
/usr/lib64/ruby/gems/2.7.0/gems/representable-3.0.4/lib/representable.rb:51:in `each'
/usr/lib64/ruby/gems/2.7.0/gems/representable-3.0.4/lib/representable.rb:53:in `block in call'
/usr/lib64/ruby/gems/2.7.0/gems/representable-3.0.4/lib/representable/binding.rb:32:in `compile_fragment'
/usr/lib64/ruby/gems/2.7.0/gems/representable-3.0.4/lib/representable/pipeline.rb:9:in `call'
/usr/lib64/ruby/gems/2.7.0/gems/representable-3.0.4/lib/representable/pipeline.rb:9:in `inject'
/usr/lib64/ruby/gems/2.7.0/gems/representable-3.0.4/lib/representable/pipeline.rb:9:in `each'
/usr/lib64/ruby/gems/2.7.0/gems/representable-3.0.4/lib/representable/pipeline.rb:10:in `block in call'
/usr/lib64/ruby/gems/2.7.0/gems/representable-3.0.4/lib/representable/pipeline.rb:18:in `evaluate'
/usr/lib64/ruby/gems/2.7.0/gems/representable-3.0.4/lib/representable/serializer.rb:3:in `block in <module:Representable>'
/usr/lib64/ruby/gems/2.7.0/gems/representable-3.0.4/lib/representable/binding.rb:46:in `evaluate_option'
/usr/lib/openproject/lib/open_project/patches/declarative_option.rb:37:in `block in lambda_for_proc'
/usr/lib/openproject/lib/open_project/patches/declarative_option.rb:37:in `instance_exec'
/usr/lib/openproject/lib/api/v3/principals/group_or_user_elements.rb:40:in `block (2 levels) in <module:GroupOrUserElements>'
/usr/lib/openproject/lib/api/v3/principals/group_or_user_elements.rb:40:in `map'
/usr/lib64/ruby/gems/2.7.0/gems/activerecord-6.1.1/lib/active_record/relation/delegation.rb:88:in `each'
/usr/lib64/ruby/gems/2.7.0/gems/activerecord-6.1.1/lib/active_record/relation.rb:249:in `records'
/usr/lib64/ruby/gems/2.7.0/gems/activerecord-6.1.1/lib/active_record/relation.rb:638:in `load'
/usr/lib64/ruby/gems/2.7.0/gems/activerecord-6.1.1/lib/active_record/association_relation.rb:44:in `exec_queries'
/usr/lib64/ruby/gems/2.7.0/gems/activerecord-6.1.1/lib/active_record/relation.rb:835:in `exec_queries'
/usr/lib64/ruby/gems/2.7.0/gems/activerecord-6.1.1/lib/active_record/relation.rb:868:in `skip_query_cache_if_necessary'
/usr/lib64/ruby/gems/2.7.0/gems/activerecord-6.1.1/lib/active_record/relation.rb:840:in `block in exec_queries'
/usr/lib64/ruby/gems/2.7.0/gems/activerecord-6.1.1/lib/active_record/relation/finder_methods.rb:421:in `apply_join_dependency'
/usr/lib64/ruby/gems/2.7.0/gems/activerecord-6.1.1/lib/active_record/relation.rb:845:in `block (2 levels) in exec_queries'
/usr/lib64/ruby/gems/2.7.0/gems/activerecord-6.1.1/lib/active_record/connection_adapters/abstract/query_cache.rb:101:in `select_all'
/usr/lib64/ruby/gems/2.7.0/gems/activerecord-6.1.1/lib/active_record/connection_adapters/abstract/query_cache.rb:109:in `cache_sql'
/usr/lib64/ruby/gems/2.7.0/gems/activesupport-6.1.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
/usr/lib64/ruby/gems/2.7.0/gems/activesupport-6.1.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
/usr/lib64/ruby/gems/2.7.0/gems/activesupport-6.1.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
/usr/lib64/ruby/gems/2.7.0/gems/activesupport-6.1.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
/usr/lib64/ruby/gems/2.7.0/gems/activesupport-6.1.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'
/usr/lib64/ruby/gems/2.7.0/gems/activerecord-6.1.1/lib/active_record/connection_adapters/abstract/query_cache.rb:118:in `block in cache_sql'
/usr/lib64/ruby/gems/2.7.0/gems/activerecord-6.1.1/lib/active_record/connection_adapters/abstract/query_cache.rb:101:in `block in select_all'
/usr/lib64/ruby/gems/2.7.0/gems/activerecord-6.1.1/lib/active_record/connection_adapters/abstract/database_statements.rb:69:in `select_all'
/usr/lib64/ruby/gems/2.7.0/gems/activerecord-6.1.1/lib/active_record/connection_adapters/abstract/database_statements.rb:532:in `select'
/usr/lib64/ruby/gems/2.7.0/gems/activerecord-6.1.1/lib/active_record/relation.rb:840:in `block in exec_queries'
/usr/lib64/ruby/gems/2.7.0/gems/representable-3.0.4/lib/representable.rb:70:in `representable_map!'
/usr/lib64/ruby/gems/2.7.0/gems/representable-3.0.4/lib/representable.rb:51:in `call'
/usr/lib64/ruby/gems/2.7.0/gems/representable-3.0.4/lib/representable.rb:51:in `each'
/usr/lib64/ruby/gems/2.7.0/gems/representable-3.0.4/lib/representable.rb:53:in `block in call'
/usr/lib64/ruby/gems/2.7.0/gems/representable-3.0.4/lib/representable/binding.rb:32:in `compile_fragment'
/usr/lib64/ruby/gems/2.7.0/gems/representable-3.0.4/lib/representable/pipeline.rb:9:in `call'
/usr/lib64/ruby/gems/2.7.0/gems/representable-3.0.4/lib/representable/pipeline.rb:9:in `inject'
/usr/lib64/ruby/gems/2.7.0/gems/representable-3.0.4/lib/representable/pipeline.rb:9:in `each'
/usr/lib64/ruby/gems/2.7.0/gems/representable-3.0.4/lib/representable/pipeline.rb:10:in `block in call'
/usr/lib64/ruby/gems/2.7.0/gems/representable-3.0.4/lib/representable/pipeline.rb:18:in `evaluate'
/usr/lib64/ruby/gems/2.7.0/gems/representable-3.0.4/lib/representable/serializer.rb:3:in `block in <module:Representable>'
/usr/lib64/ruby/gems/2.7.0/gems/representable-3.0.4/lib/representable/binding.rb:46:in `evaluate_option'
/usr/lib/openproject/lib/open_project/patches/declarative_option.rb:37:in `block in lambda_for_proc'
/usr/lib/openproject/lib/open_project/patches/declarative_option.rb:37:in `instance_exec'
/usr/lib/openproject/lib/api/v3/principals/group_or_user_elements.rb:40:in `block (2 levels) in <module:GroupOrUserElements>'
/usr/lib/openproject/lib/api/v3/principals/group_or_user_elements.rb:40:in `map'
/usr/lib64/ruby/gems/2.7.0/gems/activerecord-6.1.1/lib/active_record/relation/delegation.rb:88:in `each'
/usr/lib64/ruby/gems/2.7.0/gems/activerecord-6.1.1/lib/active_record/relation.rb:249:in `records'
/usr/lib64/ruby/gems/2.7.0/gems/activerecord-6.1.1/lib/active_record/relation.rb:638:in `load'
/usr/lib64/ruby/gems/2.7.0/gems/activerecord-6.1.1/lib/active_record/association_relation.rb:44:in `exec_queries'
/usr/lib64/ruby/gems/2.7.0/gems/activerecord-6.1.1/lib/active_record/relation.rb:835:in `exec_queries'
/usr/lib64/ruby/gems/2.7.0/gems/activerecord-6.1.1/lib/active_record/relation.rb:868:in `skip_query_cache_if_necessary'
/usr/lib64/ruby/gems/2.7.0/gems/activerecord-6.1.1/lib/active_record/relation.rb:840:in `block in exec_queries'
/usr/lib64/ruby/gems/2.7.0/gems/activerecord-6.1.1/lib/active_record/relation/finder_methods.rb:421:in `apply_join_dependency'
/usr/lib64/ruby/gems/2.7.0/gems/activerecord-6.1.1/lib/active_record/relation.rb:845:in `block (2 levels) in exec_queries'
/usr/lib64/ruby/gems/2.7.0/gems/activerecord-6.1.1/lib/active_record/connection_adapters/abstract/query_cache.rb:101:in `select_all'
/usr/lib64/ruby/gems/2.7.0/gems/activerecord-6.1.1/lib/active_record/connection_adapters/abstract/query_cache.rb:109:in `cache_sql'
/usr/lib64/ruby/gems/2.7.0/gems/activesupport-6.1.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
/usr/lib64/ruby/gems/2.7.0/gems/activesupport-6.1.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
/usr/lib64/ruby/gems/2.7.0/gems/activesupport-6.1.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
/usr/lib64/ruby/gems/2.7.0/gems/activesupport-6.1.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
/usr/lib64/ruby/gems/2.7.0/gems/activesupport-6.1.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'
/usr/lib64/ruby/gems/2.7.0/gems/activerecord-6.1.1/lib/active_record/connection_adapters/abstract/query_cache.rb:118:in `block in cache_sql'
/usr/lib64/ruby/gems/2.7.0/gems/activerecord-6.1.1/lib/active_record/connection_adapters/abstract/query_cache.rb:101:in `block in select_all'
/usr/lib64/ruby/gems/2.7.0/gems/activerecord-6.1.1/lib/active_record/connection_adapters/abstract/database_statements.rb:69:in `select_all'
/usr/lib64/ruby/gems/2.7.0/gems/activerecord-6.1.1/lib/active_record/connection_adapters/abstract/database_statements.rb:532:in `select'
```
### **Steps to reproduce:**
1. Create a work package
2. Click on the drop-down menu to assign a user
### **Actual Behavior**
The has gray text that states "No items found"
### **Expected Behavior**
A list of project members is shown
Your OpenProject Version: 11.1.2—Self-hosted with Rails 6.1.3; superfluous `postgres_type_cache` patch removed (see [https://github.com/opf/openproject/commit/d497575c491ea5a88e1b37ba9d8f715536878aab](https://github.com/opf/openproject/commit/d497575c491ea5a88e1b37ba9d8f715536878aab))
Server: openSUSE Leap 15.2 with devel:languages:ruby:extensions repository.
Client: openSUSE Tumbleweed, with Firefox
### **Logs**
When attempting to open the list of assignees, the following error is appended to the Puma error log:
```text
/usr/lib64/ruby/gems/2.7.0/gems/grape-1.5.1/lib/grape/middleware/base.rb:41:in `rescue in call!': caught error of type ActiveRecord::StatementInvalid in after callback inside Grape::Middleware::Formatter : PG::AmbiguousColumn: ERROR: column reference "firstname" is ambiguous
```
I enabled debug-level loement that ActiveRecord is sending to PostgreSQL:
```sql
SELECT "users"."id" AS t0_r0,
"users"."login" AS t0_r1,
"users"."firstname" AS t0_r2,
"users"."lastname" AS t0_r3,
"users"."mail" AS t0_r4,
"users"."admin" AS t0_r5,
"users"."status" AS t0_r6,
"users"."last_login_on" AS t0_r7,
"users"."language" AS t0_r8,
"users"."auth_source_id" AS t0_r9,
"users"."created_at" AS t0_r10,
"users"."updated_at" AS t0_r11,
"users"."type" AS t0_r12,
"users"."identity_url" AS t0_r13,
"users"."mail_notification" AS t0_r14,
"users"."first_login" AS t0_r15,
"users"."force_password_change" AS t0_r16,
"users"."failed_login_count" AS t0_r17,
"users"."last_failed_login_on" AS t0_r18,
"users"."consented_at" AS t0_r19,
"members_users"."id" AS t1_r0,
"members_users"."user_id" AS t1_r1,
"members_users"."project_id" AS t1_r2,
"members_users"."created_at" AS t1_r3,
"members_users"."mail_notification" AS t1_r4,
"members_users"."updated_at" AS t1_r5,
"roles_members"."id" AS t2_r0,
"roles_members"."name" AS t2_r1,
"roles_members"."position" AS t2_r2,
"roles_members"."assignable" AS t2_r3,
"roles_members"."builtin" AS t2_r4,
"roles_members"."type" AS t2_r5,
"roles_members"."created_at" AS t2_r6,
"roles_members"."updated_at" AS t2_r7,
"user_preferences"."id" AS t3_r0,
"user_preferences"."user_id" AS t3_r1,
"user_preferences"."others" AS t3_r2,
"user_preferences"."hide_mail" AS t3_r3,
"user_preferences"."time_zone" AS t3_r4
FROM "users"
INNER JOIN "members"
ON "users"."id" = "members"."user_id"
LEFT OUTER JOIN "users" "principals_members"
ON "principals_members"."id" = "members"."user_id"
LEFT OUTER JOIN "member_roles"
ON "member_roles"."member_id" = "members"."id"
LEFT OUTER JOIN "roles"
ON "roles"."id" = "member_roles"."role_id"
LEFT OUTER JOIN "members" "members_users"
ON "members_users"."user_id" = "users"."id"
LEFT OUTER JOIN "roles" "roles_members"
ON "roles_members"."id" = "member_roles"."role_id"
LEFT OUTER JOIN "user_preferences"
ON "user_preferences"."user_id" = "users"."id"
WHERE "members"."project_id" = $1
AND ((
users.type='User'
OR users.type='Group')
AND (
users.status=1
OR users.status=4)
AND roles.assignable = true)
AND "members_users"."project_id" = $2
ORDER BY firstname,
lastname [["project_id", 5],
["project_id", 5]]
```
There is an unnecessary extra left join: the `users` table is joined with itself under the alias `principals_members`. This causes the `ORDER BY firstname, lastname` statement to be ambiguous.
Here's a backtrace (most recent call last) starting at a somewhat-relevant point:
```text
/usr/lib64/ruby/gems/2.7.0/gems/grape-1.5.1/lib/grape/middleware/formatter.rb:30:in `after'
/usr/lib64/ruby/gems/2.7.0/gems/grape-1.5.1/lib/grape/middleware/formatter.rb:46:in `build_formatted_response'
/usr/lib64/ruby/gems/2.7.0/gems/activesupport-6.1.1/lib/active_support/notifications.rb:205:in `instrument'
/usr/lib64/ruby/gems/2.7.0/gems/grape-1.5.1/lib/grape/middleware/formatter.rb:47:in `block in build_formatted_response'
/usr/lib64/ruby/gems/2.7.0/gems/grape-1.5.1/lib/grape/middleware/formatter.rb:47:in `collect'
/usr/lib64/ruby/gems/2.7.0/gems/grape-1.5.1/lib/grape/middleware/formatter.rb:47:in `block (2 levels) in build_formatted_response'
/usr/lib/openproject/lib/api/formatter.rb:37:in `call'
/usr/lib64/ruby/gems/2.7.0/gems/representable-3.0.4/lib/representable/json.rb:44:in `to_json'
/usr/lib64/ruby/gems/2.7.0/gems/roar-1.1.0/lib/roar/json/hal.rb:58:in `to_hash'
/usr/lib64/ruby/gems/2.7.0/gems/representable-3.0.4/lib/representable/hash.rb:34:in `to_hash'
/usr/lib64/ruby/gems/2.7.0/gems/representable-3.0.4/lib/representable.rb:45:in `create_representation_with'
/usr/lib64/ruby/gems/2.7.0/gems/representable-3.0.4/lib/representable.rb:70:in `representable_map!'
/usr/lib64/ruby/gems/2.7.0/gems/representable-3.0.4/lib/representable.rb:51:in `call'
/usr/lib64/ruby/gems/2.7.0/gems/representable-3.0.4/lib/representable.rb:51:in `each'
/usr/lib64/ruby/gems/2.7.0/gems/representable-3.0.4/lib/representable.rb:53:in `block in call'
/usr/lib64/ruby/gems/2.7.0/gems/representable-3.0.4/lib/representable/binding.rb:32:in `compile_fragment'
/usr/lib64/ruby/gems/2.7.0/gems/representable-3.0.4/lib/representable/pipeline.rb:9:in `call'
/usr/lib64/ruby/gems/2.7.0/gems/representable-3.0.4/lib/representable/pipeline.rb:9:in `inject'
/usr/lib64/ruby/gems/2.7.0/gems/representable-3.0.4/lib/representable/pipeline.rb:9:in `each'
/usr/lib64/ruby/gems/2.7.0/gems/representable-3.0.4/lib/representable/pipeline.rb:10:in `block in call'
/usr/lib64/ruby/gems/2.7.0/gems/representable-3.0.4/lib/representable/pipeline.rb:18:in `evaluate'
/usr/lib64/ruby/gems/2.7.0/gems/representable-3.0.4/lib/representable/serializer.rb:3:in `block in <module:Representable>'
/usr/lib64/ruby/gems/2.7.0/gems/representable-3.0.4/lib/representable/binding.rb:46:in `evaluate_option'
/usr/lib/openproject/lib/open_project/patches/declarative_option.rb:37:in `block in lambda_for_proc'
/usr/lib/openproject/lib/open_project/patches/declarative_option.rb:37:in `instance_exec'
/usr/lib/openproject/lib/api/v3/principals/group_or_user_elements.rb:40:in `block (2 levels) in <module:GroupOrUserElements>'
/usr/lib/openproject/lib/api/v3/principals/group_or_user_elements.rb:40:in `map'
/usr/lib64/ruby/gems/2.7.0/gems/activerecord-6.1.1/lib/active_record/relation/delegation.rb:88:in `each'
/usr/lib64/ruby/gems/2.7.0/gems/activerecord-6.1.1/lib/active_record/relation.rb:249:in `records'
/usr/lib64/ruby/gems/2.7.0/gems/activerecord-6.1.1/lib/active_record/relation.rb:638:in `load'
/usr/lib64/ruby/gems/2.7.0/gems/activerecord-6.1.1/lib/active_record/association_relation.rb:44:in `exec_queries'
/usr/lib64/ruby/gems/2.7.0/gems/activerecord-6.1.1/lib/active_record/relation.rb:835:in `exec_queries'
/usr/lib64/ruby/gems/2.7.0/gems/activerecord-6.1.1/lib/active_record/relation.rb:868:in `skip_query_cache_if_necessary'
/usr/lib64/ruby/gems/2.7.0/gems/activerecord-6.1.1/lib/active_record/relation.rb:840:in `block in exec_queries'
/usr/lib64/ruby/gems/2.7.0/gems/activerecord-6.1.1/lib/active_record/relation/finder_methods.rb:421:in `apply_join_dependency'
/usr/lib64/ruby/gems/2.7.0/gems/activerecord-6.1.1/lib/active_record/relation.rb:845:in `block (2 levels) in exec_queries'
/usr/lib64/ruby/gems/2.7.0/gems/activerecord-6.1.1/lib/active_record/connection_adapters/abstract/query_cache.rb:101:in `select_all'
/usr/lib64/ruby/gems/2.7.0/gems/activerecord-6.1.1/lib/active_record/connection_adapters/abstract/query_cache.rb:109:in `cache_sql'
/usr/lib64/ruby/gems/2.7.0/gems/activesupport-6.1.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
/usr/lib64/ruby/gems/2.7.0/gems/activesupport-6.1.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
/usr/lib64/ruby/gems/2.7.0/gems/activesupport-6.1.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
/usr/lib64/ruby/gems/2.7.0/gems/activesupport-6.1.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
/usr/lib64/ruby/gems/2.7.0/gems/activesupport-6.1.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'
/usr/lib64/ruby/gems/2.7.0/gems/activerecord-6.1.1/lib/active_record/connection_adapters/abstract/query_cache.rb:118:in `block in cache_sql'
/usr/lib64/ruby/gems/2.7.0/gems/activerecord-6.1.1/lib/active_record/connection_adapters/abstract/query_cache.rb:101:in `block in select_all'
/usr/lib64/ruby/gems/2.7.0/gems/activerecord-6.1.1/lib/active_record/connection_adapters/abstract/database_statements.rb:69:in `select_all'
/usr/lib64/ruby/gems/2.7.0/gems/activerecord-6.1.1/lib/active_record/connection_adapters/abstract/database_statements.rb:532:in `select'
/usr/lib64/ruby/gems/2.7.0/gems/activerecord-6.1.1/lib/active_record/relation.rb:840:in `block in exec_queries'
/usr/lib64/ruby/gems/2.7.0/gems/representable-3.0.4/lib/representable.rb:70:in `representable_map!'
/usr/lib64/ruby/gems/2.7.0/gems/representable-3.0.4/lib/representable.rb:51:in `call'
/usr/lib64/ruby/gems/2.7.0/gems/representable-3.0.4/lib/representable.rb:51:in `each'
/usr/lib64/ruby/gems/2.7.0/gems/representable-3.0.4/lib/representable.rb:53:in `block in call'
/usr/lib64/ruby/gems/2.7.0/gems/representable-3.0.4/lib/representable/binding.rb:32:in `compile_fragment'
/usr/lib64/ruby/gems/2.7.0/gems/representable-3.0.4/lib/representable/pipeline.rb:9:in `call'
/usr/lib64/ruby/gems/2.7.0/gems/representable-3.0.4/lib/representable/pipeline.rb:9:in `inject'
/usr/lib64/ruby/gems/2.7.0/gems/representable-3.0.4/lib/representable/pipeline.rb:9:in `each'
/usr/lib64/ruby/gems/2.7.0/gems/representable-3.0.4/lib/representable/pipeline.rb:10:in `block in call'
/usr/lib64/ruby/gems/2.7.0/gems/representable-3.0.4/lib/representable/pipeline.rb:18:in `evaluate'
/usr/lib64/ruby/gems/2.7.0/gems/representable-3.0.4/lib/representable/serializer.rb:3:in `block in <module:Representable>'
/usr/lib64/ruby/gems/2.7.0/gems/representable-3.0.4/lib/representable/binding.rb:46:in `evaluate_option'
/usr/lib/openproject/lib/open_project/patches/declarative_option.rb:37:in `block in lambda_for_proc'
/usr/lib/openproject/lib/open_project/patches/declarative_option.rb:37:in `instance_exec'
/usr/lib/openproject/lib/api/v3/principals/group_or_user_elements.rb:40:in `block (2 levels) in <module:GroupOrUserElements>'
/usr/lib/openproject/lib/api/v3/principals/group_or_user_elements.rb:40:in `map'
/usr/lib64/ruby/gems/2.7.0/gems/activerecord-6.1.1/lib/active_record/relation/delegation.rb:88:in `each'
/usr/lib64/ruby/gems/2.7.0/gems/activerecord-6.1.1/lib/active_record/relation.rb:249:in `records'
/usr/lib64/ruby/gems/2.7.0/gems/activerecord-6.1.1/lib/active_record/relation.rb:638:in `load'
/usr/lib64/ruby/gems/2.7.0/gems/activerecord-6.1.1/lib/active_record/association_relation.rb:44:in `exec_queries'
/usr/lib64/ruby/gems/2.7.0/gems/activerecord-6.1.1/lib/active_record/relation.rb:835:in `exec_queries'
/usr/lib64/ruby/gems/2.7.0/gems/activerecord-6.1.1/lib/active_record/relation.rb:868:in `skip_query_cache_if_necessary'
/usr/lib64/ruby/gems/2.7.0/gems/activerecord-6.1.1/lib/active_record/relation.rb:840:in `block in exec_queries'
/usr/lib64/ruby/gems/2.7.0/gems/activerecord-6.1.1/lib/active_record/relation/finder_methods.rb:421:in `apply_join_dependency'
/usr/lib64/ruby/gems/2.7.0/gems/activerecord-6.1.1/lib/active_record/relation.rb:845:in `block (2 levels) in exec_queries'
/usr/lib64/ruby/gems/2.7.0/gems/activerecord-6.1.1/lib/active_record/connection_adapters/abstract/query_cache.rb:101:in `select_all'
/usr/lib64/ruby/gems/2.7.0/gems/activerecord-6.1.1/lib/active_record/connection_adapters/abstract/query_cache.rb:109:in `cache_sql'
/usr/lib64/ruby/gems/2.7.0/gems/activesupport-6.1.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
/usr/lib64/ruby/gems/2.7.0/gems/activesupport-6.1.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
/usr/lib64/ruby/gems/2.7.0/gems/activesupport-6.1.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
/usr/lib64/ruby/gems/2.7.0/gems/activesupport-6.1.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
/usr/lib64/ruby/gems/2.7.0/gems/activesupport-6.1.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'
/usr/lib64/ruby/gems/2.7.0/gems/activerecord-6.1.1/lib/active_record/connection_adapters/abstract/query_cache.rb:118:in `block in cache_sql'
/usr/lib64/ruby/gems/2.7.0/gems/activerecord-6.1.1/lib/active_record/connection_adapters/abstract/query_cache.rb:101:in `block in select_all'
/usr/lib64/ruby/gems/2.7.0/gems/activerecord-6.1.1/lib/active_record/connection_adapters/abstract/database_statements.rb:69:in `select_all'
/usr/lib64/ruby/gems/2.7.0/gems/activerecord-6.1.1/lib/active_record/connection_adapters/abstract/database_statements.rb:532:in `select'
```
### **Steps to reproduce:**
1. Create a work package
2. Click on the drop-down menu to assign a user
### **Actual Behavior**
The has gray text that states "No items found"
### **Expected Behavior**
A list of project members is shown