# Bug OP-13691 - [Error 500] occurs when switching to "ALL" result when searching for "meeting" word in Chinese/Korean/Japanese language in all projects

Project: OpenProject
Status: closed
URL: https://community.openproject.org/work_packages/OP-13691

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Module |  |
| Target versions | 13.1.0 |
| Observed in versions | 13.0.0 |
| Sprint | 13.1.0 |
| Backlog bucket |  |
| Bug found in version (deprecated) | 13.0.x |
| Found in mobile app version |  |
| Follow-up feedback e-mail |  |
| Requires doc change | No |
| Accessibility | No |
| Pull preview |  |
| List |  |
| Labels |  |

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable |  |
| Product manager |  |
| Developers |  |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Planning

| Attribute | Value |
| --- | --- |
| Relevance |  |

## Costs

| Attribute | Value |
| --- | --- |
| Votes |  |
| Work |  |
| Labor costs |  |

## Description

### Steps to reproduce

1.  Search "会议" (a meeting word in Chinese) in search box;
2.  It will display a search result page;
3.  Switching to "ALL" result sub page in \[WORK PACKAGES NEWS CHANGESETS WIKI FORUM PROJECTS DOCUMENTS MEETINGS ALL\];

### What is the buggy behavior?

  - \[Error 500\] occurs as the picture below in Screenshots and other files section.
  - It will occurs in Japanese (such as "ミーティング") or Korean (such as "회의")  search words too.

### What is the expected behavior?

1.  It will has no \[Error 500\] and display correct result web page.

### **Logs**

``` bash
Nov 11 08:47:40 Debian12 openproject-web-1.service[360653]: I, [2023-11-11T08:47:40.443615 #360653]  INFO -- : Started GET "/api/v3/days/week" for 192.168.2.4 at 2023-11-11 08:47:40 +0800
Nov 11 08:47:40 Debian12 openproject-web-1.service[360653]: I, [2023-11-11T08:47:40.494021 #360653]  INFO -- : duration=47.53 db=0.71 view=46.82 status=200 method=GET path=/api/v3/days/week params={} host=192.168.2.79 user=4
Nov 11 08:47:41 Debian12 openproject-web-1.service[360652]: I, [2023-11-11T08:47:41.147988 #360652]  INFO -- : duration=703.25 db=4.00 view=699.25 status=200 method=POST path=/api/v3/queries/form params={"name"=>"!!!__O__o__O__!!!"} host=192.168.2.79 user=4
Nov 11 08:47:46 Debian12 openproject-web-1.service[360653]: I, [2023-11-11T08:47:46.330203 #360653]  INFO -- : Started GET "/api/v3/work_packages?eprops=eJwdiksKhDAQRO9S6wwYHBADnsKlLUPEjgSESD6zGMndzfSmHvWqbjh%2FZo4JBstN8DvBNIaLo80htkaYCIrwtWfh1MRC6AdRveRbUneCkbDWukL9%2F37%2FpLIlzjA5Fla47MGz%2FzHMSysE52TT9QExBSn8" for 192.168.2.4 at 2023-11-11 08:47:46 +0800
Nov 11 08:47:46 Debian12 openproject-web-1.service[360652]: I, [2023-11-11T08:47:46.394859 #360652]  INFO -- : Started GET "/search?q=%E4%BC%9A%E8%AE%AE&scope=all" for 192.168.2.4 at 2023-11-11 08:47:46 +0800
Nov 11 08:47:46 Debian12 openproject-web-1.service[360652]: I, [2023-11-11T08:47:46.397622 #360652]  INFO -- : Processing by SearchController#index as HTML
Nov 11 08:47:46 Debian12 openproject-web-1.service[360652]: I, [2023-11-11T08:47:46.397655 #360652]  INFO -- :   Parameters: {"q"=>"会议", "scope"=>"all"}
Nov 11 08:47:46 Debian12 openproject-web-1.service[360652]: I, [2023-11-11T08:47:46.403973 #360652]  INFO -- : OpenProject User: Admin OpenProject (admin ID: 4 <admin@example.net>)
Nov 11 08:47:46 Debian12 openproject-web-1.service[360652]: E, [2023-11-11T08:47:46.492588 #360652] ERROR -- : user=4 wrong number of bind variables (3 for 7) in: ((subject ILIKE ?) OR (work_packages.description ILIKE ?) OR EXISTS ( SELECT 1 FROM "journals" WHERE "journals"."journable_type" = 'WorkPackage' AND (journable_id = work_packages.id) AND ((journals.notes ILIKE ?)) )) OR EXISTS ( SELECT 1 FROM "attachments" WHERE "attachments"."container_type" = 'WorkPackage' AND (container_id = work_packages.id) AND ("attachments"."fulltext_tsv" @@ to_tsquery('english', '??')) ) OR EXISTS ( SELECT 1 FROM "attachments" WHERE "attachments"."container_type" = 'WorkPackage' AND (container_id = work_packages.id) AND ("attachments"."file_tsv" @@ to_tsquery('english', '??')) ): wrong number of bind variables (3 for 7) in: ((subject ILIKE ?) OR (work_packages.description ILIKE ?) OR EXISTS ( SELECT 1 FROM "journals" WHERE "journals"."journable_type" = 'WorkPackage' AND (journable_id = work_packages.id) AND ((journals.notes ILIKE ?)) )) OR EXISTS ( SELECT 1 FROM "attachments" WHERE "attachments"."container_type" = 'WorkPackage' AND (container_id = work_packages.id) AND ("attachments"."fulltext_tsv" @@ to_tsquery('english', '??')) ) OR EXISTS ( SELECT 1 FROM "attachments" WHERE "attachments"."container_type" = 'WorkPackage' AND (container_id = work_packages.id) AND ("attachments"."file_tsv" @@ to_tsquery('english', '??')) )
Nov 11 08:47:46 Debian12 openproject-web-1.service[360652]: I, [2023-11-11T08:47:46.503081 #360652]  INFO -- :   Rendered common/error.html.erb within layouts/no_menu (Duration: 4.7ms | Allocations: 88)
Nov 11 08:47:46 Debian12 openproject-web-1.service[360652]: I, [2023-11-11T08:47:46.597679 #360652]  INFO -- :   Rendered layouts/base.html.erb (Duration: 94.2ms | Allocations: 28595)
Nov 11 08:47:46 Debian12 openproject-web-1.service[360652]: I, [2023-11-11T08:47:46.599337 #360652]  INFO -- :   Rendered layout layouts/no_menu.html.erb (Duration: 101.3ms | Allocations: 28764)
Nov 11 08:47:46 Debian12 openproject-web-1.service[360652]: I, [2023-11-11T08:47:46.599904 #360652]  INFO -- : Completed 500 Internal Server Error in 202ms (Views: 100.8ms | ActiveRecord: 5.2ms | Allocations: 48043)
Nov 11 08:47:46 Debian12 openproject-web-1.service[360652]: I, [2023-11-11T08:47:46.876502 #360652]  INFO -- : Started GET "/api/v3/configuration" for 192.168.2.4 at 2023-11-11 08:47:46 +0800
Nov 11 08:47:46 Debian12 openproject-web-1.service[360653]: I, [2023-11-11T08:47:46.905345 #360653]  INFO -- : duration=551.96 db=18.57 view=533.39 status=200 method=GET path=/api/v3/work_packages params={"eprops"=>"eJwdiksKhDAQRO9S6wwYHBADnsKlLUPEjgSESD6zGMndzfSmHvWqbjh/Zo4JBstN8DvBNIaLo80htkaYCIrwtWfh1MRC6AdRveRbUneCkbDWukL9/37/pLIlzjA5Fla47MGz/zHMSysE52TT9QExBSn8"} host=192.168.2.79 user=4
Nov 11 08:47:46 Debian12 openproject-web-1.service[360652]: I, [2023-11-11T08:47:46.945463 #360652]  INFO -- : duration=65.63 db=6.04 view=59.59 status=200 method=GET path=/api/v3/configuration params={} host=192.168.2.79 user=4
Nov 11 08:47:46 Debian12 openproject-web-1.service[360652]: I, [2023-11-11T08:47:46.986265 #360652]  INFO -- : Started GET "/api/v3/users/4/avatar" for 192.168.2.4 at 2023-11-11 08:47:46 +0800
Nov 11 08:47:47 Debian12 openproject-web-1.service[360653]: I, [2023-11-11T08:47:47.012691 #360653]  INFO -- : Started GET "/api/v3/notifications?pageSize=0&filters=%5B%7B%22readIAN%22%3A%7B%22operator%22%3A%22%3D%22%2C%22values%22%3A%5B%22f%22%5D%7D%7D%5D" for 192.168.2.4 at 2023-11-11 08:47:47 +0800
Nov 11 08:47:47 Debian12 openproject-web-1.service[360652]: I, [2023-11-11T08:47:47.019187 #360652]  INFO -- : duration=28.45 db=1.79 view=26.66 status=404 method=GET path=/api/v3/users/4/avatar params={} host=192.168.2.79 user=4
Nov 11 08:47:47 Debian12 openproject-web-1.service[360653]: I, [2023-11-11T08:47:47.053997 #360653]  INFO -- : duration=39.64 db=1.89 view=37.75 status=200 method=GET path=/api/v3/notifications params={"pageSize"=>"0", "filters"=>"[{\"readIAN\":{\"operator\":\"=\",\"values\":[\"f\"]}}]"} host=192.168.2.79 user=4
Nov 11 08:47:47 Debian12 openproject-web-1.service[360653]: I, [2023-11-11T08:47:47.086431 #360653]  INFO -- : Started GET "/api/v3/time_entries?filters=%5B%7B%22ongoing%22%3A%7B%22operator%22%3A%22%3D%22%2C%22values%22%3A%5B%22t%22%5D%7D%7D%5D" for 192.168.2.4 at 2023-11-11 08:47:47 +0800
Nov 11 08:47:47 Debian12 openproject-web-1.service[360652]: I, [2023-11-11T08:47:47.184687 #360652]  INFO -- : Started GET "/api/v3/capabilities?pageSize=-1&filters=%5B%7B%22principal%22%3A%7B%22operator%22%3A%22%3D%22%2C%22values%22%3A%5B%224%22%5D%7D%7D%2C%7B%22context%22%3A%7B%22operator%22%3A%22%3D%22%2C%22values%22%3A%5B%22g%22%5D%7D%7D%2C%7B%22action%22%3A%7B%22operator%22%3A%22%3D%22%2C%22values%22%3A%5B%22projects%2Fcreate%22%5D%7D%7D%5D" for 192.168.2.4 at 2023-11-11 08:47:47 +0800
Nov 11 08:47:47 Debian12 openproject-web-1.service[360653]: I, [2023-11-11T08:47:47.222905 #360653]  INFO -- : duration=99.44 db=2.51 view=96.93 status=200 method=GET path=/api/v3/time_entries params={"filters"=>"[{\"ongoing\":{\"operator\":\"=\",\"values\":[\"t\"]}}]"} host=192.168.2.79 user=4
Nov 11 08:47:47 Debian12 openproject-web-1.service[360652]: I, [2023-11-11T08:47:47.258417 #360652]  INFO -- : duration=72.44 db=11.95 view=60.49 status=200 method=GET path=/api/v3/capabilities params={"pageSize"=>"-1", "filters"=>"[{\"principal\":{\"operator\":\"=\",\"values\":[\"4\"]}},{\"context\":{\"operator\":\"=\",\"values\":[\"g\"]}},{\"action\":{\"operator\":\"=\",\"values\":[\"projects/create\"]}}]"} host=192.168.2.79 user=4
```

### Screenshots and other files

\[Image A: search for "任务" (meeting in Chinese)\]

<img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/79274/content">

\[Image B: \[Error 500\] occurs when switching to "ALL" result in English language\]

<img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/79275/content">

\[Image C: \[Error 500\] occurs when switching to "ALL" result in Chinese language\]

<img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/79276/content">

### Environment information

**OpenProject installation type**

- [ ] Hosted cloud edition
- [x] Packaged installation
    - Debian 12
- [ ] Docker All-in-one container
- [ ] Docker-compose installation
- [ ] Other (please specify)

**OpenProject version**

v12.0.7

**Browser**

- [x] Chrome
- [ ] Firefox
- [ ] Safari
- [ ] Mobile Safari
- [ ] Other (please specify)

**Language**

Chinese, English
