Zammad: reports throws exception on generating ticketlist when deleting tickets via API

Created on 16 Apr 2019  ·  3Comments  ·  Source: zammad/zammad

This post has been edited by @MrGeneration do meet our needed format and also, to fill it up with more information

Infos:

  • Used Zammad version: 3.0
  • Installation method (source, package, ..): any
  • Operating system: any
  • Database + version: any
  • Elasticsearch version: 5.6 (proberbly any)
  • Browser + version: any
  • Ticket-ID: #1047094 , #1048216

Expected behavior:

When using the scheduler to delete tickets (or doing that by hand via API or console), this will not affect the reporting module. This means, your reporting will function like it should and return all the valid data available.

Actual behavior:

When using the scheduler, console or API to delete a ticket, this will throw errors, if elasticsearch returns tickets that are no longer existing in our database.

The console will throw the following:
image

The graph will be created without trouble, but the ticket list below will either not be updated or created.

This is partly a regression of #2246 (just partly because it supresses an error that takes an error in the knee on another part of reporting).

Steps to reproduce the behavior:

  • create some tickets
  • open your browser console
  • open reporting and check the stats, everything should be working (browser console is "clean")
  • delete one or two tickets
  • reload and open reporting again (browser console will throw above error)

Reson for this behavior:

This issue is caused by an outdated elasticsearch index (this will be covered by another issue, soonish) and a not too robust error escaping.

Yes I'm sure this is a bug and no feature request or a general question.

Original post

Infos:

  • Used Zammad version: docker latest 2.9.x
  • Installation method (source, package, ..): docker

Expected behavior:

  • list of tickets shows like this
    image

Actual behavior:

  • no ticket table is shown, js console shows error:
application-a35ba2c058c01543bd0e17e5377c39817d3a79131917e530a74dfaea7a7fe689.js:22 > Uncaught TypeError: Cannot read property 'customer_id' of null
    at Function.n._fillUp (application-a35ba2c058c01543bd0e17e5377c39817d3a79131917e530a74dfaea7a7fe689.js:22)
    at Function.n.fullLocal (application-a35ba2c058c01543bd0e17e5377c39817d3a79131917e530a74dfaea7a7fe689.js:21)
    at Object.success (application-a35ba2c058c01543bd0e17e5377c39817d3a79131917e530a74dfaea7a7fe689.js:42)
    at c (application-a35ba2c058c01543bd0e17e5377c39817d3a79131917e530a74dfaea7a7fe689.js:2)
    at Object.fireWith [as resolveWith] (application->a35ba2c058c01543bd0e17e5377c39817d3a79131917e530a74dfaea7a7fe689.js:2)
    at i (application-a35ba2c058c01543bd0e17e5377c39817d3a79131917e530a74dfaea7a7fe689.js:3)
    at XMLHttpRequest.<anonymous> (application-a35ba2c058c01543bd0e17e5377c39817d3a79131917e530a74dfaea7a7fe689.js:3)

Steps to reproduce the behavior:

  • delete some tickets via API like this:
export TOKEN=`cat TOKEN`
TICKETS=``curl -H "Authorization: Token token=$TOKEN" https://YOURDOMAINHERE/api/v1/tickets/search?query=group:_delete_these_tickets_|jq ".tickets[]"`
for i in $TICKETS ; do
        echo $I
        curl -H "Authorization: Token token=$TOKEN" -s https://YOURDOMAINHERE/api/v1/tickets/$i -X > DELETE
done

Now tickets still show up in 'https://YOURDOMAINHERE/api/v1/reports/sets' AJAX Call

duplicate

Most helpful comment

works as your said @thorsteneckel
thank you for fixing

All 3 comments

Hey @SummerStorm - I was debugging this together with @MrGeneration on a customer machine and we found the root cause and a viable solution. Fix is on the way. I'm taking over from here 👍

We found out that this issue is a symptom of #2611 which was already fixed with Zammad 3.1. Could you please update your Zammad installation to latest stable, rebuild your search index (by running zammad run rake searchindex:rebuild) and then retry. This should resolve it. If not, please let me know. I'll close this for now.

works as your said @thorsteneckel
thank you for fixing

Was this page helpful?
0 / 5 - 0 ratings