New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make !clean!time! Errors into warnings (or infos) and make them more descriptive #183

Closed
GoogleCodeExporter opened this Issue Apr 6, 2015 · 17 comments

Comments

Projects
None yet
3 participants
@GoogleCodeExporter

GoogleCodeExporter commented Apr 6, 2015

Some people are getting a lot of warnings like:

[Thu Dec 30 19:41:22 2010] [error] [mod_pagespeed 0.9.11.5-293] /var/
mod_pagespeed/cache/!clean!time!:0: open input file (code=2 No such
file or directory)

These are not actually errors and are only a problem if they are happening more 
than about 2/hour. We should make the message more descriptive so that is clear.

Original issue reported on code.google.com by sligocki@google.com on 10 Jan 2011 at 7:00

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

Issue 185 has been merged into this issue.

Original comment by sligocki@google.com on 11 Jan 2011 at 4:37

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

Original comment by abl...@google.com on 26 Jan 2011 at 3:53

  • Changed state: Started
@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

Original comment by abl...@google.com on 26 Jan 2011 at 11:21

  • Changed state: Fixed
  • Added labels: release-note
@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

[deleted comment]
@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

I also get this error

[Tue May 10 22:5[Tue May 10 23:04:11 2011] [error] [mod_pagespeed 0.9.16.9-576 
@15579] /var/www/mod_pagespeed/files/HYmZAiNmog.lock:0: failed to stat (code=2 
No such file or directory)
[Tue May 10 23:04:11 2011] [error] [mod_pagespeed 0.9.16.9-576 @15579] 
/var/www/mod_pagespeed/files/HYmZAiNmog.lock:0: removing dir (code=2 No such 
file or directory)

Original comment by kinhk0...@gmail.com on 10 May 2011 at 3:28

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

Thanks for the report, #5.  How often do you see the error?  Can you tell us 
the output of `ls -l /var/www/mod_pagespeed/files/ | head` and `ls -l 
/var/www/mod_pagespeed/` ?

Original comment by abl...@google.com on 10 May 2011 at 7:58

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

i also get this error...im seeing the error more than 10 times at the same time 
in the logs

[Sun Oct 30 08:22:04 2011] [error] [mod_pagespeed 0.9.18.7-900 @5653] 
/var/mod_pagespeed/cache/_0RHCnMsNnYTKw98B0yW.lock:0: removing dir (code=2 No 
such file or directory)

this errors are generating a lot of overload in the servers can anyone help me?!

btw sorry for my english xD

Original comment by willyjer@gmail.com on 7 Nov 2011 at 5:45

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

Please do as suggested by abliss for the previous poster.

Also please check the permissions of /var/mod_pagespeed/cache.
The apache process (httpd) needs permission to create and delete directories in 
there.

Original comment by matterb...@google.com on 7 Nov 2011 at 5:59

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

here is the output for the first command

***************************
server:/var/mod_pagespeed# ls -l /var/mod_pagespeed/files/ | head
total 4
drwxr-xr-x 2 root root 4096 2011-11-07 10:26 statistics

***************************

here the output for the second

***************************
server:/var/mod_pagespeed# ls -l /var/mod_pagespeed/
total 16
drwxr-xr-x 8 www-data www-data 12288 2011-11-07 09:54 cache
drwxr-xr-x 3 www-data www-data  4096 2011-05-24 17:33 files
server:/var/mod_pagespeed# 
***************************

how often i see the errors...like 10 times at the same moment :S

thnx for the help!

Original comment by willyjer@gmail.com on 7 Nov 2011 at 6:21

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

What userid does your httpd process run as? Is it 'www-data'?
If not, then the process doesn't have permission to read/write to the cache 
directory and you will need to fix the permissions.

Assuming, for the sake of example, that your httpd is running as 'nobody', then 
you would have to do this command:
sudo chown -R nobody /var/mod_pagespeed

If the permissions are correct I will need to look further but I would 
surprised if the server load was that significant even if it happens 10 times 
within a very short time (say within 1 second), unless it is happening 
-continuously-. How often does it happen in an hour, or a day, for example?

Original comment by matterb...@google.com on 7 Nov 2011 at 6:33

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

An additional note, with respect to permissions: are you perhaps running a 
SELinux-using system, like a flavor of RedHat, Fedora, or CentOS?

Original comment by morlov...@google.com on 7 Nov 2011 at 6:44

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

I too get these errors - running CentOS - the errors do not happen too often.

The output of the commands on my server is:
> ls -l /var/www/mod_pagespeed/files/ | head
total 0
> ls -l /var/www/mod_pagespeed/
total 24
drwxrwxrwx 25 root root 20480 Nov  7 20:16 cache
drwxrwxrwx  2 root root  4096 Nov 16  2010 files

The /var/www/mod_pagespeed/ and /var/www/mod_pagespeed/cache are owned by root 
(as is /var/www/mod_pagespeed/cache/!clean!time!

That file is actually updated every now and then (last update date is 19:19) - 
however, my server logs show:

[Mon Nov 07 19:19:28 2011] [error] [mod_pagespeed 0.9.18.7-900 @11622] 
/var/www/mod_pagespeed/cache/!clean!time!:0: set permission (code=1 Operation 
not permitted)



Original comment by sexy.ric...@googlemail.com on 7 Nov 2011 at 8:22

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

If httpd isn't running as root then it won't have permission to change 
permissions on root-owned files, which would explain that error message.

If https IS running as root, it's possible that it has set its effective user 
id to a non-root uid (like 'nobody') after listen'ing on port 80, since running 
as root is generally a security risk. I'm afraid I don't know if or how that's 
configured or how to tell if it has happened.

Finally, even if httpd is running as root it's possible for SELinux and/or ACLs 
to prevent httpd from changing the permission on files/directories. If you're 
running SELinux there should be warning messages about this in its log file (I 
don't know where these are).

Sorry for being vague but initially it depends on the UID of your httpd and 
after that it depends on your system's setup.

Original comment by matterb...@google.com on 7 Nov 2011 at 8:31

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

httpd normally starts up as root, and then drop permissions, but we have code 
in place to chown directories to the eventual UID/GID; however, it only touches 
the leaf directory, and does not touch any directory it didn't create itself; 
so if you had an older version that didn't quite have as many countermeasures 
it may be stuck as inaccessible. In that case, you may need to chown -R to 
proper user/group yourself.

For SELinux, you may also need to do something like 'chcon -R -t 
httpd_sys_content_t /var/www/mod_pagespeed' or similar (use ls -lZ on other 
directories the server access to see what's needed).


Original comment by morlov...@google.com on 7 Nov 2011 at 8:41

@ryanhomer

This comment has been minimized.

ryanhomer commented May 4, 2015

Can someone please explain what the !clean!time! file is and why it keeps reappearing after I've completely removed ALL files and subfolders from my mod_pagespeed cache directory? I've been searching for some kind of explanation of this and I can't find anything anywhere. Thanks in advance.

@jlporter

This comment has been minimized.

Contributor

jlporter commented May 4, 2015

mod_pagespeed has a periodic cache cleaning process to keep the cache from growing too large. By default it runs every 1 hour. That !clean!time! file is used to track when the last time cache cleaning was run, and will be regenerated each time cache cleaning runs. It's essentially an implementation detail, so we don't have that file explicitly documented, but you can read more about the cache cleaning process here.

@ryanhomer

This comment has been minimized.

ryanhomer commented May 4, 2015

Thanks for the explanation Jud. Now I know my mod_pagespeed is working as it should w.r.t. that file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment