Comments (15)
Crash the entire server and it has to be restarted? Or just return an error?
You will need to look at your server and see what the error is. For example, is it running out of memory, is it timing out etc.
from search-regex.
Plugin crashing the whole server..
Then server seems to reboot on it own.
Plugin is making 91 calls..
I only have the plugin running as the only plugin
I am trying run this :
<p><span(\s\w+?[^=]*?="[^"]*?")*?\s+?class="(\S+?\s)*?connect-button(\s\S+?)*?".*?>(.*?)<\/span></p>
to remove html off each of the posts in post table
from search-regex.
Your screenshot is too small to really see anything. The arrow appears to be pointing at admin-ajax.php
, which the plugin does not use.
It should not be possible for anything to crash your server, and it would imply unrelated issues with your configuration.
It's entirely possible that your regular expression is exceeding the PHP memory limit, and that is something you will know by looking in your server logs.
from search-regex.
I boost up the PHP memory limit to 4GB and it still crashes
https://cdn.livechat-files.com/api/file/lc/att/4817491/1ae3c2c5f7677f93d0e884e76f23eb7e/2021-01-12_16-36-54.png
https://cdn.livechat-files.com/api/file/lc/att/4817491/ccdedba2ded079249b9af804cde0f8b7/2021-01-12_16-48-47.png
If i do it singularly (1 by 1)it works
from search-regex.
Ok, as I said, the plugin doesn't use admin-ajax.php
so that is not related.
The second screenshot seems to be an issue with your REST API. That isn't connected.
As I mentioned above, you should look at your server error logs and see what is happening.
If the regular expression is running out of memory then you will need to change the expression, or do fewer replacements at once. There's not much the plugin can do about this.
from search-regex.
Ok, as I said, the plugin doesn't use
admin-ajax.php
so that is not related.The second screenshot seems to be an issue with your REST API. That isn't connected.
As I mentioned above, you should look at your server error logs and see what is happening.
If the regular expression is running out of memory then you will need to change the expression, or do fewer replacements at once. There's not much the plugin can do about this.
Its not the ajax... the plugin is still running 91 calls. I've disabled everything
from search-regex.
Its not the ajax... the plugin is still running 91 calls. I've disabled everything
The plugin will make as many calls as is required to perform the replace. 91 calls will not crash your server.
from search-regex.
@johngodley
So I've had tried everything I can possibly think of....But it keeps cause my server to time out or crash.
I get a JSON syntax error. The crazy part is that I know that my RegEx works because when I click SEARCH, within the plugin it pulls out the correct results..... But when I click Replace ALL... that when it crashes.
Then you have this strange thing:
Process show 60% done but no items affected out of 37K posts..
from search-regex.
But it keeps cause my server to time out or crash.
Which one is it? You've said several different things, and shown several different problems, but they're not consistent and I really don't know what the situation is and what is or isn't working.
I will restate the above which is that if a plugin can cause your server to reboot then there is something wrong with your server - nothing should be able to cause it to reboot. The information you've given is a bit contradictory.
The crazy part is that I know that my RegEx works
I'm not saying that your regular expression doesn't work, just that it may be causing excessive memory usage.
Process show 60% done but no items affected out of 37K posts
Sure. Maybe the first 60% of posts don't match.
Why are there big green buttons on your search form? That is not part of the plugin.
from search-regex.
OK.. I finally got it working...
Not sure which fix it.. But it is definitely something worth looking into.
I change my regex to capture from starting point to endpoint. Simplifying the regex a bit might have worked... BUT I also remove Cloudflare (turning OFF the cloud icon in the DNS) and using a server SSL let encrypt... I've also changed "REMOVE" to "SINGLE" and in the single field I just add a space (in order to get the Repace All button to enable)
<p><span class="connect-button[\s\S]*?/a></p>
My Regexr.com example:
https://regexr.com/5k79h
BTW, you should consider adding the link to regexr.com in your plugin
from search-regex.
@johngodley you should consider connecting to replacing inside the DB as an option instead of entirely working through JSON REST.
from search-regex.
@johngodley
OK. here is my final verdict... There is a bug somewhere in the plugin when dealing with thousands of posts and certain Expressions.
Which causes a 502 Bad Gateway Error... This is the error that was meant by crashing my server OR timing out the server.
This error happens when something is not matched Over and Over within the search process...
As mentioned... I simplify my expression a bit to: <p><span class="connect-button[\s\S]*?/a></p>
which worked!
But then when I tried the same code changing just the class name to optin-button <p><span class="optin-button[\s\S]*?/a></p>
I know that the expression is simple and correct because when I run a search:
The problem happened again...
So again my verdict is that when you have 37k or more posts and the processor doesn't find a match readily, this causes the server to produce a 504 error, I think to do time-to-live which I've set to 3000 seconds on my server...
My server has plenty of RAM and Cores I've given 4GB to PHP and Mysql alone. plenty of time for execution... so there should be no issues.
from search-regex.
regexr.com in your plugin
There is a link to regex101.com in the documentation.
you should consider connecting to replacing inside the DB as an option instead of entirely working through JSON REST
That is not possible.
The plugin uses PHP to perform regular expressions and has no control over how that works. As I've mentioned several times, it is possible to construct a regular expression that causes issues.
from search-regex.
This issue is still unresolved.
Why the close?
from search-regex.
If you have solved the problem by simplifying your regular expression then that is the solution - you are in control of the expression.
from search-regex.
Related Issues (20)
- Search Regex Error HOT 1
- Error when changing from PHP 7.4.5 to PHP 8.1.2 HOT 1
- Search Regex Error HOT 1
- Errors with Search Regex when upgrading to PHP 8.0 HOT 1
- Search Regex Error HOT 1
- Issue: Extra backslashes when using global text replace HOT 1
- Search Regex Error HOT 2
- Search Regex Error HOT 1
- Issue: Replace All button not working for 3.0 Beta 3 HOT 3
- Issue: Regex doesn't appear to be working as expected in Beta 4 HOT 3
- how to run a present every x amount of hours per day HOT 1
- Search Regex Error HOT 2
- Error when trying to replace in Redirection plugin (Search Regex Error) HOT 1
- Search Regex Error HOT 1
- pagination appears to not be working in regex returned results HOT 1
- CSV exports lack header row
- Count of search results unexpectedly changes when regex flag set HOT 3
- Exporting regex searches to CSV fails HOT 3
- Search Regex Error HOT 1
- Search Regex Error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from search-regex.