Upgraded osTicket from 1.10.4 to 1.11, and PHP from 5.6 to 7.2. After upgrade, each time a user creates a ticket , PHP event is logged:

[06-Mar-2019 11:26:10 UTC] PHP Warning: session_regenerate_id(): Cannot regenerate session id - session is not active in C:\inetpub\osTicket\open.php on line 49
[06-Mar-2019 11:26:10 UTC] PHP Fatal error: Uncaught Error: Call to a member function getId() on null in C:\inetpub\osTicket\include\client\view.inc.php:140
Stack trace:
#0 C:\inetpub\osTicket\tickets.php(147): include()
#1 {main}

There are no "visible" issues for the user. Everything seems to work fine, but error is logged each time a ticket is created.
I also had errors as described in https://forum.osticket.com/d/90697-signing-out-fails-and-errors but after applying suggested solution, they were resolved.
System information:

It seems I managed to resolve part of the issue.

Follwing a suggestion at https://stackoverflow.com/questions/35184950/fatal-error-call-to-a-member-function-getid-on-null-in-doctrine I modified \include\client\view.inc.php line 140
from
$clientId = TicketUser::lookupByEmail($email)->getId();
to
$clientId = TicketUser::lookupByEmail($email) ? TicketUser::lookupByEmail($email)->getId() : null;

Now, I don't get any more "Call to a member function getId() on null" errors. Only "Cannot regenerate session id" are logged now.

I've asked the devs to take a peek at this thread.

4 days later

@kbmerkur

I just tested this with latest v1.11 and PHP 7.2 and cannot replicate the issue.

You shouldn't be getting the getId() on null error as TicketUser::lookupByEmail($email) should always find a user. Upon ticket creation, the system creates a record in ost_user and ost_user_email tables for every person that creates a ticket. It appears as though your system is not creating a record in ost_user/ost_user_email for the person creating the ticket OR your system lags and returns the view template before the ost_user/ost_user_email records are created all the way.

A few questions:

  • When and where did you download v1.11 from?
  • Can you confirm there is a record for the email in question in ost_user_email?
  • What are the exact steps to replicate the issue?

Cheers.

    KevinTheJedi
    I downloaded osTicket from https://osticket.com/download/ on 22. Feb 2019.
    A good portion of our users have empty email record. I assume this is because we're using LDAP authentication (AD).
    Does this mean that we'll have to fill in email fields of all our AD users?

    Furthermore, is "session_regenerate_id()" also related to this problem, or is it something else entirely?

    13 days later

    @kbmerkur

    No, LDAP should create the Agent/User in osTicket and should provide the email, name, phone, etc. Make sure you did not change your LDAP variables, for example, don't change email to something else otherwise the system will not add the email to the account in osTicket.

    Furthermore, is "session_regenerate_id()" also related to this problem, or is it something else entirely?

    Honestly, I have no idea what the context of this is so I'm not sure what you're talking about.

    Cheers.

      KevinTheJedi "session_regenerate_id()" refers to an error:

      PHP Warning: session_regenerate_id(): Cannot regenerate session id - session is not active in C:\inetpub\osTicket\open.php on line 49

      I mentioned this error in my opening post. This error still pops up in PHP log each time a user creates a ticket.

      @kbmerkur

      Oh I see now. You pasted the wrong error.

      session_regenerate_id(): Cannot regenerate session id - session is not active in C:\inetpub\osTicket\open.php on line 49

      This shouldn't have anything to do with the other error (Call to a member function getId() on null in C:\inetpub\osTicket\include\client\view.inc.php:140) as TicketUser::lookupByEmail($email) uses an email string to lookup the user, not a session_id or anything.

      Cheers.

        KevinTheJedi I see. Thank you.
        I looked left and right trying to figure out why this warning occurs, but couldn't find any meaningful connection. Since everything seems to be working OK with osTicket, would it be safe to simply ignore this warning then?

        @kbmerkur

        You can ignore them but it'd be nice to solve it. I'd suggest updating your codebase to the latest pull of the develop-next branch as this contains the latest bug fixes we've been working on. Once you update your codebase you can restart Apache and see if this resolved the issue.

        Cheers.

          10 months later

          KevinTheJedi
          One of the ways I was able to resolve it was by adding my name as the administrator on the server.

          KevinTheJedi
          I just started another thread about this, but when I submit a new ticket I get a 500 error, but if the user is a administrator of the server the ticket is created with no errors

          • mxmx replied to this.
            5 months later

            dustinakane I am having the same issues with the 500 error. so you made all users admins?

            Write a Reply...