Just spent a log time trying to work out why my site that I deployed to a remote Aegir slave was not producing any output at all. Turns out I needed to add the following to /var/aegir/config/includes/fastcgi_params.conf

fastcgi_param PATH_TRANSLATED $document_root$fastcgi_script_name;

Should this be in the template files by default? Is there any reason why it isn't?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mrfelton’s picture

Should have mentioned:

Ubuntu 10.04
Nginx 0.7.65
PHP 5.3.2-1ubuntu4.7ppa5~lucid1 (fpm-fcgi)

mrfelton’s picture

Title: WSOD with NginX and PHP-FPM due to missing PATH_TRANSLATED fastcgi_param » No output from PHP-FPM due to missing PATH_TRANSLATED fastcgi_param
mrfelton’s picture

Looks like 1.5 actually sets SCRIPT_FILENAME which does the same thing. I'm not sure why the new configs were not copied from provision into my includes directory when upgrading aegir.

omega8cc’s picture

Title: No output from PHP-FPM due to missing PATH_TRANSLATED fastcgi_param » fastcgi_params.conf file is not copied to the remote head and breaks PHP-FPM there
Assigned: Unassigned » omega8cc

This is probably because we never really tested remote heads support in the Aegir with Nginx enough. There were even patches accepted to fix some issues with extra Nginx modules/paths which have made it even worse, because they are using extra file(s) to test Nginx version etc, and it works properly when running on master server, but will not work as expected with remote heads, because there is no Provision on the remote head, and the extra files (including fastcgi_params.conf) are bundled with Provision and probably not copied to the remote head. I think (not sure) I fixed this in my Provision 2.x cloned repo, but it appears it was never included in the official release, based on 1.x. Anyway, this needs to be fixed to avoid further cascades of confusion.

omega8cc’s picture

I'm was wrong (partially) because fastcgi_params.conf file is (and always was) included in the copy-to-remote logic. This means that it was probably some temporary error between your servers. This needs more testing anyway, to make sure if anyone is able to reproduce the problem.

mrfelton’s picture

@omega8cc

I had a file in ~/config/includes/fastcgi_params.conf - which did not contain SCRIPT_FILENAME. The one that comes with Provision in ~/.drush/provision/http/nginx/fastcgi_params.conf is ok (it contains SCRIPT_FILENAME). The one I have in ~/config/includes/fastcgi_params.conf was copied over to the remote host without issue. The problem is that that file was borked (probably left over from an early beta of Aegir). Shouldn't Aegir replace those files with the ones from Provision when you upgrade Aegir, or verify hostmaster?

mrfelton’s picture

I had a similar problem where ~/config/includes/nginx_simple_include.conf didn't exist either, yet the file is in provision. So why after upgrading Aegir (multiple times - this install in from 0.2 or something) were these files not copied out from provision into ~/config/includes

omega8cc’s picture

This line:

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

was *always* in this file, from the day one. Otherwise it would never work on any server, not just remote.

If your fastcgi_params.conf file didn't have this line of critical importance, this simply means that you edited it or uploaded there different file, not coming from Provision. I don't think that standard rsync would have the power to remove random line from transferred file :)

omega8cc’s picture

Title: fastcgi_params.conf file is not copied to the remote head and breaks PHP-FPM there » Unconfirmed problems with remote Nginx heads
Category: bug » support

I'm changing this to support request, as it is not a bug until it will be reproduced, also because there are signs of non-standard install, broken for unknown (yet) reasons.

mrfelton’s picture

Ok, fair enough - I have no idea how that line got removed or didn't get added. So my question at this point is - does/should Aegir/Provision ever replace the files in ~/config/includes with the stock ones from Provision (for example, when upgrading Aegir, or running verify on hostmaster)?

omega8cc’s picture

Category: support » bug

The config files are copied, but not during upgrade itself. They are copied in function verify_server_cmd() {.

However, this looks like a major problem to me - it may fail because server is not re-verified on upgrade, it is the platform and the site, which is verified on upgrade. This needs further investigation for sure, so I'm changing this back to bug for now.

omega8cc’s picture

I should add that it is a remote-head-specific issue in this logic, as it works just fine on the local/master head and the config (includes) files are replaced on upgrade of course, but probably only because there is Provision available locally.

mrfelton’s picture

In my case, I have upgraded this Aegir instance multiple times, yet I still had this strange broken fastcgi_param file, and no nginx_simple_include.conf file. Maybe because, as you say - because the server is never reverified.

Note though, this isn't really related to a remote head - the problem is that on the Aegir master server, the config files don't get replaced on upgrade. I'm talking about the ~/config/includes directory on the Aegir master server. Whatever is in that directory copies over to the remote head without issue.

mrfelton’s picture

Also, I did just try reverifying the Aegir master server, and no files were copied out from Provision. I also tried to re-verify the remote nginx_ssl server, and there are warnings in the log, dispite the fact that the verify reports completing successfully.

copy(/var/aegir/.drush/provision/http/nginx_ssl/nginx_advanced_include.conf): failed to open stream: No such file or directory provision.file.inc:38
/var/aegir/config/includes/nginx_advanced_include.conf has been removed from remote server nflfansfrontend.
copy(/var/aegir/.drush/provision/http/nginx_ssl/nginx_simple_include.conf): failed to open stream: No such file or directory provision.file.inc:38
/var/aegir/config/includes/nginx_simple_include.conf has been synced to remote server nflfansfrontend.
copy(/var/aegir/.drush/provision/http/nginx_ssl/fastcgi_params.conf): failed to open stream: No such file or directory provision.file.inc:38
/var/aegir/config/includes/fastcgi_params.conf has been synced to remote server nflfansfrontend.
copy(/var/aegir/.drush/provision/http/nginx_ssl/fastcgi_ssl_params.conf): failed to open stream: No such file or directory provision.file.inc:38
/var/aegir/config/includes/fastcgi_ssl_params.conf has been synced to remote server nflfansfrontend.

So it looks like its trying to copy these files of of Provision's http/nginx_ssl directory - where they don't exist (they only exist in http/nginx).

mrfelton’s picture

Status: Active » Needs review
FileSize
1.85 KB

Here is a patch that resolves the issue for me. I suspect there may be a better way to get the correct directory, but I'm not too familiar with drush/provision.

omega8cc’s picture

Title: Unconfirmed problems with remote Nginx heads » Nginx config files required as includes in vhosts are not copied when Nginx SSL feature is enabled

So it seems we need also separate patch for Provision head/2.x as the files structure has changed and your patch will apply only to stable 1.x.

Note that there is also another line missing for SSL here: http://gitorious.org/aegir/provision/commit/0fb85b24b3239a8f9600f274c689...

mrfelton’s picture

My patch should apply cleanly to 6.x-1.x. I'm not sure about the 2.x version, and I have no way to test it since my Aegir setup is simply running 1.5 stable. But, from a quick glance of the code I'm sure any changes would be needed there, since both the http and https stuff is all kept in the same directory.

mrfelton’s picture

Whats with the repository on gitorious? Is the code hosted here or over there? I don't see that extra line in the 6.x-1.x branch that I just checked out from drupal.org.

omega8cc’s picture

Status: Needs review » Needs work

I have already a working, tested patch for 2.x in the gitorious repo: http://gitorious.org/aegir/provision/blobs/master/http/Provision/Service...

It is basically Provision 2.x with some not yet submitted extra patches.

As for 1.x, I would suggest a more elegant solution like:

provision_file()->copy(dirname(dirname(__FILE__)) . '/nginx/nginx_advanced_include.conf', $this->server->include_path . '/nginx_advanced_include.conf');

Also, remember to add there two lines:

provision_file()->copy(dirname(dirname(__FILE__)) . '/nginx/upload_progress_test.conf', $this->server->include_path . '/upload_progress_test.conf');
$this->sync($this->server->include_path . '/upload_progress_test.conf');

Without it it will fail to support upload progress module, if compiled in your Nginx server.

omega8cc’s picture

Version: 6.x-1.5 » 6.x-1.x-dev

It is for 1.x (so 1.6), not 1.5.

mrfelton’s picture

Status: Needs work » Needs review
FileSize
3.77 KB

Revised patch attached. The upload_progress_test.conf file didn't exist, so I created that too. Kinda feels like we're merging two issues into one doing that here though.

omega8cc’s picture

Status: Needs review » Reviewed & tested by the community

Thanks.

There is some overlap, but it is expected as both issues are connected anyway.

I have found it a bit hard to follow since the Aegir "head" has been split into 6.x-2.x and 7.x-2.x, while stable releases are still based on 6.x-1.x and BOA is based on 6.x-2.x, and we no longer use 6.x-1.x branch, so I decided to submit our outstanding patches first to 6.x-2.x and then they could be ported to 6.x-1.x.

omega8cc’s picture

Status: Reviewed & tested by the community » Needs work

This needs some work to keep it in sync with current approach, as we no longer rely on the extra upload_progress_test.conf file, so this part needs to be removed from the patch, while dirname(dirname(__FILE__)) fix is correct and we need it.

I will submit a revised patch shortly.

omega8cc’s picture

Status: Needs work » Needs review
Anonymous’s picture

Status: Needs review » Fixed

Thanks! I've committed the patch in #24 to 6.x-1.x

I also manually ported the fix to 6.x-2.x, based on that patch and the current status of omega8cc's gitorious copy here: http://gitorious.org/aegir/provision/blobs/master/http/Provision/Service...

The reason I didn't make it exactly like that file in the gitorious copy is that it appears to contain *other* fixes - as you said in #19, 'It is basically Provision 2.x with some not yet submitted extra patches.'

I think it would be good to separate those other 'extra' things into individual patches so we have some sane history in our git commits so we know exactly what changes came in.

Can I get confirmation on what else is in that file that we need committed, if anything? So basically a general comparison of our 6.x-2.x branch and yours.

omega8cc’s picture

Ah, please don't use that gitorious repo, it is a fork, way out of sync now and the reason why I created a clean repo at http://drupal.org/sandbox/omega8cc/1443220.

I will add 6.x-2.x-boa branch there and all incremental commits will be submitted for review from this new repo only, both for 6.x-1.x and 6.x-2.x

In this issue only the part related to dirname(dirname(__FILE__)) should be committed.

Thanks!

Anonymous’s picture

Roger that. Thanks! :)

Status: Fixed » Closed (fixed)

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

  • Commit 6644df8 on 6.x-2.x, dev-ssl-ip-allocation-refactor, dev-1205458-move_sites_out_of_platforms, 7.x-3.x, dev-subdir-multiserver, 6.x-2.x-backports, dev-helmo-3.x by mig5:
    Issue #1346712 by mrfelton - Nginx config files required as includes in...
  • Commit a635d15 on 6.x-1.x, dev-drupal-8, dev-ssl-ip-allocation-refactor, dev-1205458-move_sites_out_of_platforms, 7.x-3.x, dev-subdir-multiserver, 6.x-2.x-backports, dev-helmo-3.x authored by omega8cc, committed by mig5:
    Issue #1346712 by mrfelton - Nginx config files required as includes in...