Search for Users / E-Mail Add returns Empty json on existing Tickets

Searching for Existing E-Mail / Users when adding Cc or To E-Mail Fields with existing Tickets

  • Used Zammad version: 3.2.x
  • Installation method (source, package, …): package
  • Operating system: Ubuntu 16.04
  • Database + version: postgresql 9.5.19
  • Elasticsearch version: 5.6.16
  • Browser + version: 73.0.1

Actual behavior:

Search over URL Triggers Network Traffic / API Call

https://zammad/api/v1/users/search?term=flor

with an Empty Response. -> []

The User I did search for does Exists.

Expected behavior:

Searching within a new Ticket creates a different API Call eg.

https://zammad/api/v1/search/user-organization?query=flor&_=

which returns a json with resprective users / organizations

Steps to reproduce the behavior:

Change the To or Cc E-Mail Address on an existing Ticket.

Welcome to the Community,

Zammad expects you to provide the parameter query - you used term which should be your issue here. :slight_smile:
At least that’s what our docs say: GET /api/v1/users/search?query=what&limit=10

I hope this helps.

Best regards

Hi,

sorry i should have been clearer, the problem occurs when using the UI. Eg Using the Interface open an existing Ticket -> Reply to the Ticket and trying to change either to or cc address

BTW: Thanks for the greate Product!

Regards

Georg

Can you find the affected user within the quick search on the upper left?
If so, click into the e.g. CC field, type at least 3 letters and wait a moment.

Zammad should find exactly the same user(s).

If you can’t find the user in the search bar already, please rebuild your searchindex, because it’s proberbly broken then.

If that still doesn’t work, please ensure your Zammad is running without any modifications and provide log files.

@MrGeneration You’re seeing the same API endpoints used by the frontend as reported in the initial message and both are returning a result?

Using the quick search field I’m able to find something.
While searching for a contact on a new issue zammad frontend is using the (as far as I can see - undocumented) api endpoint /search/user-organization while it’s using /users/search for an existing issue.

Why is the frontend using different endpoints for doing the same thing?
What’s the difference between those two endpoints? Is one using e.g. elasticsearch and the other isn’t?

Thanks!

The quick search field is using the /search api endpoint. That’s another endpoint. 2 out of 3 giving a result :slight_smile:

From the logs:

2020-03-05T10:44:03.273516+01:00 zammad1 zammad[3928]: Unable to process GET request to elasticsearch URL ‘http://zammad-es1:9200/zammad_production/User/_search’. Check the response and payload for detailed information: #012#012Response:#012#<UserAgent::Result:0x00007f5c48f1ae68 @success=false, @body=“{"error":{"root_cause":[{"type":"query_shard_exception","reason":"No mapping found for [active.keyword] in order to sort on","index_uuid":"ag5xi7SwTtK7tJkPYrh4aw","index":"zammad_production"}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"zammad_production","node":"6bKIjGnLQgSq_hcNHrL0aQ","reason":{"type":"query_shard_exception","reason":"No mapping found for [active.keyword] in order to sort on","index_uuid":"ag5xi7SwTtK7tJkPYrh4aw","index":"zammad_production"}}]},"status":400}”, @data=nil, @code=“400”, @content_type=nil, @error=“Client Error: #<Net::HTTPBadRequest 400 Bad Request readbody=true>!”>#012#012Payload:#012{:from=>0, :size=>100, :sort=>[{“active.keyword”=>{:order=>“desc”}}, {“updated_at”=>{:order=>“desc”}}, “_score”], :query=>{:bool=>{:must=>[{“query_string”=>{“query”=>“steffen*”, “default_operator”=>“AND”, “analyze_wildcard”=>true}}]}}}#012#012Payload size: 0M

Hi,

.) I was able to find the User on searchbar
.) Still did rebuild the searchindex
but that did not fix the issue still.
I did also Update to 3.3 and another reindex after which the Problem was solved.

Thanks for the fast help1

Georg

This error appears if your searchindex is broken.
zammad run rake searchindex:rebuild solves this issue.

Note that Updating to either Zammad 3.2 and 3.3 is requiring a reindex of your system.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.