Hello,

we have issues with incoming tickets whereby new ticket email notifications arrive to our support staff for tickets that, when clicked, either point to nonexisting tickets or other, older tickets in the support system.

When looking for the particular ticket #s in the system, they are not found at all.

How can we debug this?

Thank you

(v1.18.1 here)

  • KevinTheJedi replied to this.
  • Thank you for all your assistance, Kevin.
    We figured it out - it was another cron instance that was also pulling tickets, causing this to crap out. It was VERY confusing and did not appear in the logs anywhere.

    lkalam

    Hmm, that sounds odd. Can you look them up in the database and see? Maybe the Agents don’t have direct access to them and are receiving alerts due to being on a mailing list or something?

    Cheers.

    Hello Kevin,
    thank you for your reply!

    Can you point me somewhere in the database to check?

    Some more information here:

    The email that arrived for the new tickets says:
    "New ticket #559862 created"

    The link to take me to it says:
    "To view or respond to the ticket, please login to the support ticket system" and the login URL has id 19407

    The database table ost_ticket has:

    (the number there being clearly wrong)

    and when I click on the link it takes me to that older number which of course corresponds to a previous ticket.

    Would this information help you suggest a solution ? Something is causing the new ticket creation logic to attach to previous tickets, probably. Any ideas?

    EDIT: the 398202 ticket was created about 24hrs ago, so it's not 'old'...

    Is there some sort of index that's corrupt somewhere?

      lkalam

      List all the records in the _ticket table and order by created date. Also, don’t have a field on any form with the variable name of “number”?

      Cheers.

      Kevin,

      could the problem be that our mail server is configured to be UTC+1 but the support ticket system server is configured to be UTC+0 ?

      There's no way we can change either of them, so I am curious as to why this might be causing issues...

        OK - thank you for that - it should help clear the confusion that way.

        The other thing I've noticed is that when auto-cron sweeps through incoming support emails, the tickets are generated with the wrong number (thus causing the issue), whereby if the incoming support emails are swept because of agent action on the web page, the tickets are generated correctly.

        Would that help you in getting an aha! moment?

          lkalam

          I'm confused...auto-cron is triggered by Agent activity so both instances would be the result of the Agents' activities. Do you mean you have a Cron Job/Scheduled Task configured and running?

          Cheers.

          yes - correct, I am sorry, that's what I meant - there is a cron job configured to sweep incoming support emails as follows:

          5 * * * * /usr/bin/php /home/www/support/api/cron.php

          The auto-cron triggered by Agent activity works correctly.
          The cron job in crontab causes the issue.

          (apologies for confusing you)

            lkalam

            When you run /usr/bin/php --version on the server does it match the version of PHP your system is running?

            Cheers.

            Hi Kevin,
            this is the output of /usr/bin/php --version:

            PHP 8.2.26 (cli) (built: Nov 25 2024 17:21:51) (NTS)
            Copyright (c) The PHP Group
            Zend Engine v4.2.26, Copyright (c) Zend Technologies
            with Zend OPcache v8.2.26, Copyright (c), by Zend Technologies

            and this is what osTicket is reporting. They seem identical.

              lkalam

              Can you show me screenshots of examples of what you are talking about?

              Cheers.

              Sure. Here you go:

              an example of a ticket generated by the cron job (the BAD one)

              The login location is: https://support.domain.tld/scp/tickets.php?id=19449 (NOTE THE ID HERE).

              An example of a ticket generated by an auto-cron action generated by an agent working on the support site (a GOOD one)

              The login URL: https://support.domain.tld/scp/tickets.php?id=19477 (note the ID here).

              And the mysql data entries for the two IDs above:
              Headers:

              19449:

              19477:

              What's very confusing to me is why, even though I've gone into Ticket Settings and Options and selected a SERIAL numbering of default ticket number sequence, it still picks random numbers when using the system cron-generated email sweep. You can see above, if it's a result of any of our agents' actions, the numbering is in order (000001, 000002, etc). where as if it's because of the cron, it goes at random.
              Here are the settings:

                lkalam

                It sounds like the Tickets fetched using cron are going to a specific Help Topic that has a separate Ticket Number Sequence. Check the New Ticket Options for the Help Topic of a Ticket that was created from fetch via cron.

                Cheers.

                Thank you Kevin,
                we'll give this a try.

                Do you suggest we keep the ticket number sequence identical for all help topics then?

                  lkalam

                  That’s up to you. I’m just explaining a potential reason for why the numbers are different.

                  With this being said it wouldn’t explain why the database shows a different number than the email. What does your email template look like? If you have multiple what do they all look like? Have you checked all of your forms to see if any field has a variable name of “number”? If so that will interfere with the real ticket number in the emails.

                  Cheers.

                  One of our forms is this:

                  Will that interfere?

                  EDIT: You said "variable name" - no, it doesn't and none do, that I checked.

                    lkalam

                    What does your email template look like? If you have multiple what do they all look like?