Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reports throws exception on generating ticketlist when deleting tickets via API #2547

Closed
sstidl opened this issue Apr 16, 2019 · 3 comments
Closed
Assignees

Comments

@sstidl
Copy link

sstidl commented Apr 16, 2019

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:

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

@sstidl sstidl changed the title reports throws exception on generating ticketlist reports throws exception on generating ticketlist when deleting tickets via API Apr 16, 2019
@SummerStorm SummerStorm self-assigned this Apr 22, 2019
@SummerStorm SummerStorm added this to To do in OLD Workflow May 8, 2019
@thorsteneckel thorsteneckel added this to the 3.1.0 milestone Jun 24, 2019
@thorsteneckel
Copy link
Contributor

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 👍

@martini martini modified the milestones: 3.1.0, 3.2.0 Jul 12, 2019
@thorsteneckel
Copy link
Contributor

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.

@sstidl
Copy link
Author

sstidl commented Sep 25, 2019

works as your said @thorsteneckel
thank you for fixing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants