I have an error in db just after installation.
I can't register as a user.

DB Error #3692
[DELETE ost_session. FROM ost_session WHERE ost_session.user_id = 0 AND ost_session.session_data REGEXP '_auth\|.\"user\";[a-z]+:[0-9]+:{[a-z]+:[0-9]+:\"id\";[a-z]+:11'] Incorrect description of a {min, max} interval.

---- Трассировка ----
#0 C:\Server\data\htdocs\include\mysqli.php(199): osTicket->logDBError('DB Error #3692', '[DELETE ost_se...')
#1 C:\Server\data\htdocs\include\class.orm.php(3454): db_query('DELETE
ost_ses...', true, true)
#2 C:\Server\data\htdocs\include\class.orm.php(1526): MySqlExecutor->execute()
#3 C:\Server\data\htdocs\include\class.auth.php(1343): QuerySet->delete()
#4 C:\Server\data\htdocs\include\class.signal.php(98): PasswordPolicy::cleanSessions(Object(User), NULL)
#5 C:\Server\data\htdocs\include\class.client.php(478): Signal::send('auth.clean', Object(User), NULL)
#6 C:\Server\data\htdocs\account.php(96): ClientAccount->update(Array, Array)
#7 {main}

Please help us to help you by reading and following the posting guidelines located in this thread: Please read before requesting assistance. The more information you give us the better we will be able to assist you. Thank you.

Environment details?
Version of osTicket?

osTicket Version v1.11 (d4e240b) — Up to date
Web Server Software Apache/2.4.38 (Win64) PHP/7.0.33
MySQL Version 8.0.15
PHP Version 7.0.33

@Bystrovvv

The { is not escaped in the REGEX clause.

EDIT:
I just tested this and my installation ran the following query:

DELETE 
  `ost_session`.* 
FROM
  `ost_session` 
WHERE
  `ost_session`.`user_id` = 0 
AND
  `ost_session`.`session_data` REGEXP '_auth\\|.*\"user\";[a-z]+:[0-9]+:{[a-z]+:[0-9]+:\"id\";[a-z]+:XX';

As you can see, it's the same exact query as yours and mine went through just fine with no errors. Maybe this is some new MySQL 8.x thing where it's really strict about { in REGEX now.

Cheers.

I've just installed MySQL 5.75 and it works!
Thank you!

5 days later

I had this same issue but just cleared the session table in the database and it works fine. I didn't want to downgrade MYSQL.

5 months later

@ouelletz

The issue will pop up again for you in the future when sessions are not cleared properly and the cron runs to delete expired sessions.

@simon_d_m That's exactly the issue, thanks for finding/posting this man. I will discuss this with the other devs and we will come up with a solution.

Cheers.

Hey...
You can change this Code in

OSTicket\include\class.auth.php row 1331

From
$regexp = '_auth\|.*"user";[a-z]+:[0-9]+:{[a-z]+:[0-9]+:"id";[a-z]+:'.$model->getId();

to
$regexp = '_auth\|.*"user";[a-z]+:[0-9]+:\{[a-z]+:[0-9]+:"id";[a-z]+:'.$model->getId();

It works fine for me :-)

At this point, I would also like to mention again that the editing of the source code of OSTicket absolutely NO WARRANTY and at your own risk.
This is NOT an OFFICIAL SOLUTION by the manufacturer!

@simon_d_m @marcel112 @Bystrovvv

Okay so upon further testing I have MySQL 8.0.17, osTicket v1.12.2, PHP 7.3 and the issue does not occur for me...

Your MySQL connection id is 44
Server version: 8.0.17 MySQL Community Server - GPL

Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> DELETE `ost_session`.* FROM `ost_session` WHERE `ost_session`.`user_id` = 0 AND `ost_session`.`session_data` REGEXP '_auth\\|.*\"user\";[a-z]+:[0-9]+:{[a-z]+:[0-9]+:\"id\";[a-z]+:XX';
Query OK, 0 rows affected (0.00 sec)

mysql> 

What are you guys' subversion number on MySQL? (eg. mine is 8.0.17) Anything else I need to do to replicate your issue?

Cheers.

Marcel's fix in class.auth.php worked for me 😀

Welcome  to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1808
Server version: 8.0.17 MySQL Community Server - GPL

Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> DELETE `ost_session`.* FROM `ost_session` WHERE `ost_session`.`user_id` = 0 AND `ost_session`.`session_data` REGEXP '_auth\\|.*\"user\";[a-z]+:[0-9]+:{[a-z]+:[0-9]+:\"id\";[a-z]+:XX';
ERROR 3692 (HY000): Incorrect description of a {min,max} interval.
mysql> DELETE `ost_session`.* FROM `ost_session` WHERE `ost_session`.`user_id` = 0 AND `ost_session`.`session_data` REGEXP '_auth\\|.*\"user\";[a-z]+:[0-9]+:\{[a-z]+:[0-9]+:\"id\";[a-z]+:XX';
ERROR 3692 (HY000): Incorrect description of a {min,max} interval.
mysql> DELETE `ost_session`.* FROM `ost_session` WHERE `ost_session`.`user_id` = 0 AND `ost_session`.`session_data` REGEXP '_auth\\|.*\"user\";[a-z]+:[0-9]+:\\{[a-z]+:[0-9]+:\"id\";[a-z]+:XX';
Query OK, 0 rows affected (0.00 sec)

mysql>
[Note that the 3 commands above have incremental addition of backslashes before the curly brace: 0, 1, 2]
Windows Server 2016 Standard
About this osTicket Installation
Server Information
osTicket Version : v1.12.2 (a5d898b) —  Up to date 
Web Server Software : Microsoft-IIS/10.0
MySQL Version : 8.0.17
PHP Version : 7.3.7
PHP Settings
cgi.fix_pathinfo :  "1" is recommended if AJAX is not working 
date.timezone :  Europe/Minsk 
Database Information and Usage
Schema : osticket (localhost) 
Space Used : 4.12 MiB
Space for Attachments : 1.52 MiB
Timezone : GMT Daylight Time (Interpreted as Europe/London) 

Installed Language Packs
English (United States) 
en_US — include/i18n/en_US 
19 days later

Marcel's fix also worked for me. Thank you.

Server Information
osTicket Version v1.12 (a076918) — Up to date
Web Server Software Microsoft-IIS/10.0
MySQL Version 8.0.17
PHP Version 7.3.1

4 months later

Been getting the same problem too... marcel's fix worked for me also.
Server Information
osTicket Version v1.14.1 (f1e9e88) — Up to date
Web Server Software Apache 2.4
MySQL Version 8.0.19
PHP Version 7.2.24-1

Again Thank you.

25 days later

Getting same issue too, marcel's fix worked for me also.
Server info:
osTicket Version v1.14.1 (f1e9e88) — Up to date
Web Server Software Apache/2.4.6 (CentOS) PHP/7.1.33
MySQL Version 8.0.19
PHP Version 7.1.33

a month later

work also for me
osticket v1.14.1
Apache versione 2.4.37
MySQL versione 8.0.17
PHP 7.3.16

a month later

Problem has re-occurred in the new version. Same fix worked 🙂

osTicket Version v1.14.2 (cba6035)
Web Server Software Apache/2.4.41
MySQL Version 8.0.19
PHP Version 7.4.5

@simon_d_m @Robbo870 @cmdradama @psfiras @lcosenza

I still cannot replicate this issue with MySQL 8.0.17 and PHP 7.4. I can install just fine and login/logout just fine. Any steps to replicate this issue would be greatly appreciated.

Update:
Was able to replicate it after moving things around. Will look into this.

Cheers.

Hey Kevin, sorry yeah it would have been a good idea to go onto detail on when/where it happens. It's always happens when a user goes to sign up. As soon as they hit register it comes back with a HTTP 500 and the aforementioned error.

@marcel112

Your fix is indeed correct. After reviewing MySQL's documentation, the a{m,n} syntax is considered longhand or a more detailed way of writing a* or a+ or a? (repetition). We have to match against the { character but MySQL's REGEXP() method interprets this as the start of a{m,n}. In order to avoid this we can escape the squiggly bracket so { is seen as a literal squiggly bracket and not as the start of a{m,n} (repetition) notation. I have made a pull request with the fix below:

Cheers.