Error_log levels

I’m getting a lot of entries in my error_log from memcache throwing a
404 and sending the request to the back end.

2010/04/08 21:07:50 29914#0: *3207 pcre_exec() failed: -8 on
example.com” using “” while sending to client, client: 66.249.71.23,
server: _, request: “GET example.com HTTP/1.1”, upstream:
“memcached://127.0.0.1:11211”, host: “example.com

I’m assuming this is correct behavior since it cannot find the requested
url in memory; however, I have not been able to find any error level
descriptions in the docs - could you either fill me in on what level I
need to include on my conf file or point me in the direction of where
this info can be found?

I’m looking to remove the “alert” log events to try and clean up my
error_log a bit.

Thank you

Flash

Posted at Nginx Forum:

Hello!

On Thu, Apr 08, 2010 at 10:18:03PM -0400, flash wrote:

I’m getting a lot of entries in my error_log from memcache
throwing a 404 and sending the request to the back end.

2010/04/08 21:07:50 29914#0: *3207 pcre_exec() failed: -8 on “example.com” using “” while sending to client, client: 66.249.71.23, server: _, request: “GET example.com HTTP/1.1”, upstream: “memcached://127.0.0.1:11211”, host: “example.com

I’m assuming this is correct behavior since it cannot find the
requested url in memory;

No, it isn’t. It’s unexpected error returned by pcre_exec()
function, and according to pcreapi manpage it means the following:

     PCRE_ERROR_MATCHLIMIT     (-8)

   The  backtracking  limit,  as  specified  by the match_limit 

field in a
pcre_extra structure (or defaulted) was reached. See the
description
above.

You may want to investigate further why it happens. Default limit
according to pcre docs is 10 million, so either you have
completely wrong regex, or something wrong with your pcre library,
or it’s nginx bug.

however, I have not been able to find
any error level descriptions in the docs - could you either fill
me in on what level I need to include on my conf file or point
me in the direction of where this info can be found?

Logging levels from harmless to most critical are:

debug, info, notice, warn, error, crit, alert, emerg

It is not recommended to ignore any messages at crit level and above.

First part of this list can be found here:

http://wiki.nginx.org/NginxCoreModule#error_log

Maxim D.

So I guess I need to start with my rewrites…here they are

rewrite ^/([0-9]+)/([_0-9a-zA-Z-]+)/?$ $theme/listing.php?mls=$1 last;
rewrite ^/([0-9]+)/([_0-9a-zA-Z-]+)+.html?$ $theme/listing.php?mls=$1
last;
rewrite ^/([0-9]+)/?$ $theme/listing.php?mls=$1 last;
rewrite ^/new-listings/new-listings-for-(+)-([0-9]+)-([_0-9a-zA-Z-]+)/?$
$theme/newListings.php?month=$1&day=$2 last;

here’s what I’m trying to capture

example.com/(mls number)
example.com/(mls number)/(mls address).html
example.com/(mls number)/(mls address)/

the mls number is either a 6 digit or a 7 digit number
mls address is really irrelevant from a technical standpoint but needed
for SEO

These rewrites are working like I want them too but are they causing my
prce errors?

Flash

Posted at Nginx Forum:

Hello!

On Fri, Apr 09, 2010 at 11:28:29PM -0400, flash wrote:

So I guess I need to start with my rewrites…here they are

rewrite ^/([0-9]+)/([_0-9a-zA-Z-]+)/?$ $theme/listing.php?mls=$1 last;
rewrite ^/([0-9]+)/([_0-9a-zA-Z-]+)+.html?$ $theme/listing.php?mls=$1 last;

This one will backtrack in an exponential way due to “(…+)+”
construct. On long enough URL it will cause problems.

Here is pcretest session which demonstrates the problem:

$ pcretest
PCRE version 7.9 2009-04-11

re> !^/([0-9]+)/([_0-9a-zA-Z-]+)+.html?$!
data> /1/1.html
0: /1/1.html
1: 1
2: 1
data> /1/1.htmlx
No match
data> /1/111111111111111111111111111111111111111111111111111111111.htmlx
Error -8

[…]

These rewrites are working like I want them too but are they
causing my prce errors?

Yes they are.

Maxim D.

Maxim,

Thank you for your help, removing the second + in the highlighted line
has removed that error from my logs.

Flash

Posted at Nginx Forum: