I'm using BOA (Barracuda Octopus Aegir) LEMP stack with Pressflow 6.22 and your module. I've enabled all Advagg modules, and configured a server-writable / public-readable directory in Advagg for aggregate file storage (Drupal is using private file system). However, it does not seem my css/js are being aggregated. In Chrome debugger, I still see all separate files.

I'm not sure if it's related, but Async mode is reporting an issue in my site status:

Adv CSS/JS Agg - Asynchronous Mode	Set to FALSE.
Check to see if you have fast 404s, if so create an exception for this module. The readme file explains what needs to be changed. You can try flushing the menu cache as well. If you are still having issues you can go to the AdvAgg information tab and select Asynchronous debug info. If creating an issue on d.o be sure to include this information .

Here is the async debug info:

stdClass Object (
    [request] => GET /sites/portal.praece.com/files/portal.praece.com/advagg_css/css_missing8852429961313558365_0.css HTTP/1.0
Host: portal.praece.com
User-Agent: Drupal (+http://drupal.org/)
Connection: close

    [data] => <html>
<head><title>404 Not Found</title></head>
<body bgcolor="white">
<center><h1>404 Not Found</h1></center>
<hr><center>Barracuda/1.0.5</center>
</body>
</html>
    [protocol] => HTTP/1.1
    [status_message] => Not Found
    [headers] => Array (
            [Server] => Barracuda/1.0.5
            [Date] => Wed, 17 Aug 2011 05:19:25 GMT
            [Content-Type] => text/html
            [Content-Length] => 172
            [Connection] => close
            [Vary] => Accept-Encoding
        )
    [error] => Not Found
    [code] => 404
    [timer] => Array (
            [count] => 1
            [time] => 0.47
        )
)
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mikeytown2’s picture

Looks like Barracuda is not letting the request hit drupal if the page is missing. #1116618-11: Need a nginx setup doc might be helpful.

obrienmd’s picture

Project: Advanced CSS/JS Aggregation » Barracuda
Version: 6.x-1.x-dev »
Component: Miscellaneous » Code

Moving this over to Barracuda. Any thoughts from the omega8cc team?

omega8cc’s picture

FileSize
64.55 KB

Have you set this config option? - see the screenshot attached.

We probably have to force it in the global.inc file.

omega8cc’s picture

obrienmd’s picture

omega8cc: will test as per #3 and report back. If it works, I agree it should be set in global.inc :)

obrienmd’s picture

Tried #3, still getting:

stdClass Object (
    [request] => GET /sites/portal.praece.com/files/portal.praece.com/advagg_css/css_missing16976817271314853036_0.css HTTP/1.0
Host: portal.praece.com
User-Agent: Drupal (+http://drupal.org/)
Connection: close

    [data] => <html>
<head><title>404 Not Found</title></head>
<body bgcolor="white">
<center><h1>404 Not Found</h1></center>
<hr><center>Barracuda/1.0.5</center>
</body>
</html>
    [protocol] => HTTP/1.1
    [status_message] => Not Found
    [headers] => Array (
            [Server] => Barracuda/1.0.5
            [Date] => Thu, 01 Sep 2011 04:57:16 GMT
            [Content-Type] => text/html
            [Content-Length] => 172
            [Connection] => close
            [Vary] => Accept-Encoding
        )
    [error] => Not Found
    [code] => 404
    [timer] => Array (
            [count] => 1
            [time] => 3.34
        )
)
obrienmd’s picture

FileSize
68.97 KB

See attachment for settings. Won't let me set async due to error above. I'm using sites/site/files instead of the private drupal file system to store files so anonymous users can access them.

obrienmd’s picture

Updated to latest Barracuda (8.10) and Advagg (6.x-1.x-dev). Still getting the following async debug info:

Default file system is private, but have set advagg to a directory that should be web-user readable (/sites/sitename/files).

stdClass Object (
    [request] => GET /sites/portal.praece.com/files/portal.praece.com/advagg_css/css_missing20525872421315500084_0.css HTTP/1.0
Host: portal.praece.com
User-Agent: Drupal (+http://drupal.org/)
Connection: close

    [data] => <html>
<head><title>404 Not Found</title></head>
<body bgcolor="white">
<center><h1>404 Not Found</h1></center>
<hr><center>Barracuda/1.0.6</center>
</body>
</html>
    [protocol] => HTTP/1.1
    [status_message] => Not Found
    [headers] => Array (
            [Server] => Barracuda/1.0.6
            [Date] => Thu, 08 Sep 2011 16:41:24 GMT
            [Content-Type] => text/html
            [Content-Length] => 172
            [Connection] => close
            [Vary] => Accept-Encoding
        )
    [error] => Not Found
    [code] => 404
    [timer] => Array (
            [count] => 1
            [time] => 3.04
        )
)
omega8cc’s picture

We didn't debug it yet, but I don't understand why there is:

[request] => GET /sites/portal.praece.com/files/portal.praece.com/advagg_css/css_missing20525872421315500084_0.css

instead of:

[request] => GET /sites/portal.praece.com/files/advagg_css/css_missing20525872421315500084_0.css

There is nothing in the Nginx config which could cause this.

Any idea?

omega8cc’s picture

Also, could you post details about your private files/downloads setup/settings?

obrienmd’s picture

FileSize
29.99 KB
59.31 KB

Re: #9, no clue, will poke around advagg's debug code :)

Re: #10:
-See attachments for Drupal File System and AdvAgg settings-
The idea is that while this site requires a private file system, AdvAgg 'should' allow me to set its path to a directory which is directly served by the web server, thus allowing anonymous users to download aggregated css and js.

obrienmd’s picture

OK, I did some debugging regarding the odd extra hostname in the files dir:

It occurs in advagg_get_root_files_dir, a function in advagg:

Before this snippet is run in that function, $custom_path is sites/portal.praece.com/files.

  file_check_directory($custom_path, FILE_CREATE_DIRECTORY);

  // Get path name
  $conf_path = conf_path();
  if (is_link($conf_path)) {
    $path = readlink($conf_path);
  }
  $conf_path = str_replace("\\", '/', $conf_path);
  $conf_path = explode('/', $conf_path);
  $conf_path = array_pop($conf_path);
  $custom_path = $custom_path . '/' . $conf_path;
  file_check_directory($custom_path, FILE_CREATE_DIRECTORY);

After this snippet is run $custom_path is sites/portal.praece.com/files/portal.praece.com.

The funky directory is writable by www-data. However, I'm not sure how Barracuda's nginx / global.inc are affecting it.

omega8cc’s picture

So it is either bug in the AdvAgg module or you should use just "files" as a 'custom' path - or maybe just "/" ?

Anyway, it doesn't work with this funky path because it doesn't match the location we have for AdvAgg support: http://drupalcode.org/project/barracuda.git/blob/HEAD:/aegir/conf/nginx_...

location ~* files/advagg_(?:css|js)/ {

And since it doesn't match defined location, it is not send to Drupal for processing if the file doesn't exist yet.

obrienmd’s picture

Project: Barracuda » Advanced CSS/JS Aggregation
Version: » 6.x-1.x-dev
Category: support » bug

advagg setup rejects files or / as custom path, saying they are not writable. I'm inclined to this this should be fixed in advagg. If it's not a slam-dunk for the maintainer or someone smarter than me, perhaps I'll go in and hack around to see if I can make a patch.

Moving this back over to advagg - any ideas on this from anyone?

obrienmd’s picture

Project: Advanced CSS/JS Aggregation » Barracuda
Version: 6.x-1.x-dev »

OK, here's the issue - When advagg takes a custom path, it appends the conf_path() to that custom path. Not sure why it does this, but I can think of a few possible good reasons.

So, two possible solutions:
1) Add to current location ~* files/advagg_(?:css|js)/ the option for location ~* files/.*/advagg_(?:css|js)/ (excuse if my regex is poor, I don't really know how to create them) so Drupal handles that URL.
2) Push advagg to ask why conf_path() result is added to custom path.

Any thoughts?

mikeytown2’s picture

conf_path is added for multisites. The file names are unique but are not globally unique. Next major version of advagg I plan on making them globally unique so all aggregates can safely live in the same directory.

obrienmd’s picture

I see - I guess that makes sense... I assumed (incorrectly) that the user would cover that in the custom path as I did :)

obrienmd’s picture

Project: Barracuda » Advanced Aggregator

Moving this back over to advagg, as mikeytown2's addition of globally unique file names (or rather, the associated removal of appended conf_path in the path) will fix this.

obrienmd’s picture

Project: Advanced Aggregator » Advanced CSS/JS Aggregation
Version: » 6.x-1.x-dev

Oops, wrong advagg :)

mikeytown2’s picture

Status: Active » Needs review
FileSize
624 bytes

I'll create a hidden setting to control if conf_path is added to the path. Hidden as in one that can not be set in the GUI but can be set in settings.php by the $conf global. This patch work for you after adding this to your settings.php file?

$conf['advagg_no_conf_path'] = TRUE;
obrienmd’s picture

Status: Needs review » Needs work

That definitely removed the conf path, however page loads really slowed down and a good number of pages are showing up unstyled. Seems like Drupal is handling the URL, though, and and AdvAgg header item is grabbed.

stdClass Object (
    [request] => GET /sites/portal.praece.com/files/advagg_css/css_missing1692620841318466804_0.css HTTP/1.0
Host: portal.praece.com
User-Agent: Drupal (+http://drupal.org/)
Connection: close

    [data] => <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html><head><title>404 Not Found</title></head><body><h1>Not Found</h1><p>The requested URL was not found on this server.</p><p><a href="/">Home</a></p><!-- advagg_missing_fast404 --></body></html>
    [protocol] => HTTP/1.1
    [status_message] => Not Found
    [headers] => Array (
            [Server] => Barracuda/1.0.6
            [Date] => Thu, 13 Oct 2011 00:46:44 GMT
            [Content-Type] => text/html; charset=utf-8
            [Connection] => close
            [Vary] => Accept-Encoding
            [X-Powered-By] => PHP/5.2.17
            [X-Accel-Expires] => 0
            [X-Drupal-Cache] => MISS
            [Last-Modified] => Thu, 13 Oct 2011 00:46:44 +0000
            [Cache-Control] => no-cache, must-revalidate, post-check=0, pre-check=0
            [ETag] => "1318466804"
            [X-AdvAgg] => Failed Validation. Wrong Pattern.
        )
    [error] => Not Found
    [code] => 404
    [timer] => Array (
            [count] => 1
            [time] => 58.47
        )
)
mikeytown2’s picture

Status: Needs work » Postponed (maintainer needs more info)

Is this still and issue with the latest dev version?

obrienmd’s picture

I will update to latest dev right now and let you know. Our users are definitely still having many issues, mostly clearing the browser caches helps (which is curious)... But turning off advagg also fixes the issues.

mikeytown2’s picture

Status: Postponed (maintainer needs more info) » Active
obrienmd’s picture

OK, latest dev:

stdClass Object (
[request] => GET /sites/portal.praece.com/files/advagg_css/css_missing11227634041323929898_0.css HTTP/1.0
Host: portal.praece.com
User-Agent: Drupal (+http://drupal.org/)
Connection: close

[data] =>
404 Not Found
Not Found

The requested URL was not found on this server.

Home


[protocol] => HTTP/1.1
[status_message] => Not Found
[headers] => Array (
[Server] => Barracuda/1.0.6
[Date] => Thu, 15 Dec 2011 06:18:18 GMT
[Content-Type] => text/html; charset=utf-8
[Connection] => close
[Vary] => Accept-Encoding
[X-Powered-By] => PHP/5.2.17
[X-Accel-Expires] => 0
[X-Drupal-Cache] => MISS
[Last-Modified] => Thu, 15 Dec 2011 06:18:18 +0000
[Cache-Control] => no-cache, must-revalidate, post-check=0, pre-check=0
[ETag] => "1323929898"
[X-AdvAgg] => Failed Validation. Wrong Pattern.
)
[error] => Not Found
[code] => 404
[timer] => Array (
[count] => 1
[time] => 84.77
)
)

udvranto’s picture

I am having the same issue. No files generated. files/advagg_js and files/advagg_css are writable. I am using a private file system.

udvranto’s picture

As soon as I changed to public file system mode, it started working!

mikeytown2’s picture

Status: Active » Postponed (maintainer needs more info)

Is this issue resolved?

obrienmd’s picture

I have been on a different project for a while now, but intend to get back into this early next month. If it is still acting up, I'll let you know. Perhaps we can meet up to hack on it if so, ksenzee said you're Seattle local I think, is that right?

mikeytown2’s picture

I am a Seattle local; live/work on the east side.

obrienmd’s picture

Cool, I will send ping you when I've tested further early next month.

obrienmd’s picture

Status: Postponed (maintainer needs more info) » Active

After a bit of testing, it looks like this is working, with your patch and settings.php declaration in #20. Is it sane for that patch to be committed (i.e. will it not screw things up for folks with more generic setups)?

mikeytown2’s picture

Status: Active » Needs review
FileSize
1022 bytes

@obrienmd
I have a slightly different patch in comparison to #20. Could you test this one?

obrienmd’s picture

Status: Needs review » Reviewed & tested by the community

Worked for me! Thanks!

mikeytown2’s picture

Status: Reviewed & tested by the community » Fixed

#33 has been committed.

obrienmd’s picture

Thanks again, this is great.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.