Bug - preg_match(): Compilation failed: regular expression is too large at offset 32785

@laptop, This appears to be a bug in codeignitor. However,it also appears as if you alone are seeing this error, We are not seeing other reports of the problem.

Given that, the only way to debug this might be to catch it as it happens. I would be happy to assist but this will mean providing access to your server (for example FTP or SSH access).

Please feel free to PM me here or on slack if you wish to proceed with this course of action.

2 Likes

I am able to see where a possible issue might be occurring, but I am unable to reproduce the problem locally. I suppose it is just the way my local data is set up. Let me work with it some more until I can force a crash on my local system.

1 Like

Maybe filling the system with several thousand records will help, because no other changes have been made before the bug occurred. Thanks for your help!

You are spot on here. The issue relates back to a query that searches the allocation of clients to a guest user. Because you have over 5000 records, it builds a mammoth query - something like

.. WHERE client_id = 2 OR client_id = 6 OR client_id = 11 OR client_id = 12 OR ...

(If you can imagine that query extending out over 5000 clients you will get the picture.)

This is not handled well in the Codeignitor framework.

I will log a fix request during this weekend and seek an alternate way of writing the query and provide a fix soon,

2 Likes

https://development.invoiceplane.com/browse/IP-757

1 Like

Any chance to solve this issue soon?

Sorry for hurrying but is every major bug fixed so slow?

This is no major Fix,
Noone beside you encountered this issue.

If it is important for you feel free to help to develop a fix and implement it to IP.
As IP is a free service noone gets paid here and noone have to right of a quick fix.
Wait for the next version which will include a lot of fixed already and hope a fix for your problem is included.

On the other side:

if you have about 5.000 customer you probably earn a lot of money. If you cant wait hire a dev who will fork IP, then develop a fix, make a Pull-Request and implement this Fix to IP to make it updateable.

1 Like

@laptop if you change this:

WHERE client_id = 2 OR client_id = 6 OR client_id = 11 OR client_id = 12 OR

to this:

WHERE client_id IN(2, 6, 11, 12)

The problem will be fixed :blush:

Thanks, but In which file - this one maybe? vendor/codeigniter/framework/system/database/DB_query_builder.php

  • I suppose WHERE client_id IN(2, 6, 11, 12) array should be filled with digits from 1 to 100000 for example or? Will that not make the query big again?

/home/ideatrad/public_html/invoice/application/modules/clients/controllers/Clients.php
Probably in that file, but those numbers of those client_id’s are really important.
When we use IN() the query will not be that big, so it will be ok.
All those OR is making the query big :slight_smile:

Please take the time to read the bug report I provided. It has the details of where the problem is happening.

1 Like

i faced that issue too
how i resolve it?
is that any solution?