0
Welcome Guest! Login
0 items Join Now

BUG: Excessive creation of /tmp/gantry_less*

    • benow's Avatar
    • benow
    • Newbie
    • Posts: 11
    • Thanks: 0

    BUG: Excessive creation of /tmp/gantry_less*

    Posted 10 years 11 months ago
    • (This is a reopening of www.rockettheme.com/forum/index.php?f=15...49250&rb_v=viewtopic which was incorrectly marked as solved)

      I am having an issue with excessive creation of /tmp/gantry_less* files. It has eaten up all the remaining disk space and has crashed mysql and apache. It doesn't seem to be a permission error, as /tmp looks ok (Apache is being run as www-data).

      /tmp$ find . -name gantry_less\* | wc -l
      133426

      /tmp$ ls -lah gantry_lessKPNMAv
      -rw
      1 www-data www-data 19K Dec 11 06:42 gantry_lessKPNMAv

      /tmp$ ls -lah /tmp
      total 8.9G
      drwxrwxrwt 38 root root 5.6M Dec 19 22:52 .
      :

      A quick search of the code find gantry_less files being created at
      libraries/gantry/core/gantry.class.php:1145
      I can see a create, but no delete. Are the files being cleaned up? Why are the css files being created? Are they not stored with the template? By the looks of the code, it should only ever create the css once, as the css path should remain constant. For some reason, it's not remembering the fact that it has already generated the css, and the generated css is never deleted, causing the disk to fill.

      I have not thrown it in a debugger, as this is running on a live deployment. I am only running gantry/rt on one vhost and I am using the rt_metropolis template.

      The regular rm gantry_less* fails with too many arguments, and I have had to delete with:
      find /tmp -name gantry_less\* -print0 | xargs --null --replace=+ rm +
      It will take about 20m to delete all these files, and this is a small disk. This bug could effectively kill a system with an inexperience sysadmin.

      Is there any way to avoid CSS compilation? For now, I will add a regular crontab trim:
      $ cat /etc/cron.d/gantry-fix
      */5 * * * * root rm /tmp/gantry_less*

      Thanks,

      Andy
    • MrT's Avatar
    • MrT
    • Preeminent Rocketeer
    • Posts: 101084
    • Thanks: 13482
    • Web Designer/Developer

    Re: BUG: Excessive creation of /tmp/gantry_less*

    Posted 10 years 11 months ago
    • That thread ws not incorrectly marked solved as I have already explained - www.rockettheme.com/forum/index.php?f=15...v=viewtopic#p1049273

      Our templates are written in LESS - LESS gets compiled into CSS by the inbuilt LESS compiler;

      No you can't turn the LESS compiler off - and even if you could the template wouldn't work then.

      The LESS compiler will check for changes and if necessary produce new compiled CSS files in the css-compiled folder.

      If for any reason your permission are not set corrrectly - the LESS compiler will keep producing compiled CSS files. Most likely this is because you are using apache2handler rather than cgi/fastCGI - this means that compiled files are being given an owner/group of "apache" when they are saved - when the compiler tries to read these (joomla) then it does not have permissions so it says "oh well the files aren't there so I better create some" - and so on and so on.

      Regards, Mark.
    • Please search forums before posting. Please make sure your post includes the version of the CMS you are using and a link to the problem. Annotations on screenshots can also be helpful to explain problems/goals. Please use the "secure" tab for confidential information.
    • benow's Avatar
    • benow
    • Newbie
    • Posts: 11
    • Thanks: 0

    Re: BUG: Excessive creation of /tmp/gantry_less*

    Posted 10 years 11 months ago
    • As you can see from the above post, everything is read/write to the apache process. The temp dir is accessible as are all the files which are written.

      Do you have any suggestions for actually fixing this issue?
    • MrT's Avatar
    • MrT
    • Preeminent Rocketeer
    • Posts: 101084
    • Thanks: 13482
    • Web Designer/Developer

    Re: BUG: Excessive creation of /tmp/gantry_less*

    Posted 10 years 11 months ago
    • Well despite you calling me an idiot in the other thread...benow wrote:
      Hence the reply that a new thread was created, you idiot. Things are searched for, and replied to out of context.. deal with it.
      http://www.rockettheme.com/forum/index.php?f=15&t=207679&p=1049375&rb_v=viewtopic#p1049375

      ..yes, I am prepared to help you further if you are civil and polite.

      It is not sufficient to have the correct permissions - you need to have the correct owner/group too. If you would like me to look for you then please would you PM URL, superuser id and pswd. Also, Please PM FTP logon, password and FTP URL.


      Regards, Mark.
    • Please search forums before posting. Please make sure your post includes the version of the CMS you are using and a link to the problem. Annotations on screenshots can also be helpful to explain problems/goals. Please use the "secure" tab for confidential information.
    • benow's Avatar
    • benow
    • Newbie
    • Posts: 11
    • Thanks: 0

    Re: BUG: Excessive creation of /tmp/gantry_less*

    Posted 10 years 11 months ago
    • It seems the tmp directory is used when it can't write within the site directory. I've reset the perms for the site to be apache read/write. I've disabled the cron trimmer and will keep an eye out for gantry less files.

      However, it should not be creating thousands of files when the template cache directory (within the site directory) is unwritable. It should be using the tmp directory instead, and only compiling as needed and reusing when possible. This is still an open bug, albeit with a workaround.
    • benow's Avatar
    • benow
    • Newbie
    • Posts: 11
    • Thanks: 0

    Re: BUG: Excessive creation of /tmp/gantry_less*

    Posted 10 years 11 months ago
    • Sorry about the idiot comment, I should have tempered that response. I realize the complexities of crafting useful software, and certainly patience is a virtue, from all perspectives. I did however create a new thread, and linked to that new thread, which I thought to be sufficient.
    • benow's Avatar
    • benow
    • Newbie
    • Posts: 11
    • Thanks: 0

    Re: BUG: Excessive creation of /tmp/gantry_less*

    Posted 10 years 11 months ago
    • My guess at a solution would be that the tmp directory is not considered as a source for previously compiled css... only the internal compiled templates directory. If this were the case, the previously created compiled css in the tmp directory would not be reused and would be regenerated with each request, which seems to be the behaviour.
    • MrT's Avatar
    • MrT
    • Preeminent Rocketeer
    • Posts: 101084
    • Thanks: 13482
    • Web Designer/Developer

    Re: BUG: Excessive creation of /tmp/gantry_less*

    Posted 10 years 11 months ago
    • No the tmp directory is used (by php) to build the compiled CSS before it's copied to the css-compiled folder which failed because you had wrong permissions. As I also said, the wrong permissions will have come about because you are no doubt using apache2handler instead of cgi/fastCGI.

      So the process is
      ... are the css file in the compiled folder... no they aren't... build one (using TMP as used by php)... copy it to css-compiled... that failed... so in this case you end up with more and more compiled CSS being built because the permission are wrong to put them in the right place...

      If you are using apache2handler I urge you to change to cgi/fastcgi and change the permissions to match whatever FTP account you are using (this is how they would have been if you had started the joomla install with cgi/fastCGI instead of apache2handler).

      Regards, Mark.
    • Please search forums before posting. Please make sure your post includes the version of the CMS you are using and a link to the problem. Annotations on screenshots can also be helpful to explain problems/goals. Please use the "secure" tab for confidential information.
    • MrT's Avatar
    • MrT
    • Preeminent Rocketeer
    • Posts: 101084
    • Thanks: 13482
    • Web Designer/Developer

    Re: BUG: Excessive creation of /tmp/gantry_less*

    Posted 10 years 11 months ago
    • Apology accepted - we try to keep everything polite and friendly in the forums - that way everyone is keen to listen,learn, and enjoy what we do (MODS and members alike).

      Regards, Mark.
    • Please search forums before posting. Please make sure your post includes the version of the CMS you are using and a link to the problem. Annotations on screenshots can also be helpful to explain problems/goals. Please use the "secure" tab for confidential information.
    • benow's Avatar
    • benow
    • Newbie
    • Posts: 11
    • Thanks: 0

    Re: BUG: Excessive creation of /tmp/gantry_less*

    Posted 10 years 11 months ago
    • It seems to be fine if perms are correct. Apache2 vs. Fast/CGI is also not an issue with correct perms, and may be out of reach for a typical user. There should be a check in the generator code to tell if the file was correctly moved out of tmp, and if not the tmp file should be deleted and a warning should be logged. That would atleast prevent the situation of crippling the box.

Time to create page: 0.056 seconds