Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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?
Comment | File | Size | Author |
---|---|---|---|
#21 | 1346712.21-provision-nginx-ssl-conf.patch | 3.77 KB | mrfelton |
#15 | 1346712.15-provision-nginx-ssl-conf-copy.patch | 1.85 KB | mrfelton |
Comments
Comment #1
mrfelton CreditAttribution: mrfelton commentedShould have mentioned:
Ubuntu 10.04
Nginx 0.7.65
PHP 5.3.2-1ubuntu4.7ppa5~lucid1 (fpm-fcgi)
Comment #2
mrfelton CreditAttribution: mrfelton commentedComment #3
mrfelton CreditAttribution: mrfelton commentedLooks 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.
Comment #4
omega8cc CreditAttribution: omega8cc commentedThis 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.
Comment #5
omega8cc CreditAttribution: omega8cc commentedI'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.
Comment #6
mrfelton CreditAttribution: mrfelton commented@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?
Comment #7
mrfelton CreditAttribution: mrfelton commentedI 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
Comment #8
omega8cc CreditAttribution: omega8cc commentedThis 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 :)
Comment #9
omega8cc CreditAttribution: omega8cc commentedI'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.
Comment #10
mrfelton CreditAttribution: mrfelton commentedOk, 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)?
Comment #11
omega8cc CreditAttribution: omega8cc commentedThe 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.
Comment #12
omega8cc CreditAttribution: omega8cc commentedI 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.
Comment #13
mrfelton CreditAttribution: mrfelton commentedIn 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.
Comment #14
mrfelton CreditAttribution: mrfelton commentedAlso, 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).
Comment #15
mrfelton CreditAttribution: mrfelton commentedHere 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.
Comment #16
omega8cc CreditAttribution: omega8cc commentedSo 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...
Comment #17
mrfelton CreditAttribution: mrfelton commentedMy 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.
Comment #18
mrfelton CreditAttribution: mrfelton commentedWhats 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.
Comment #19
omega8cc CreditAttribution: omega8cc commentedI 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:
Also, remember to add there two lines:
Without it it will fail to support upload progress module, if compiled in your Nginx server.
Comment #20
omega8cc CreditAttribution: omega8cc commentedIt is for 1.x (so 1.6), not 1.5.
Comment #21
mrfelton CreditAttribution: mrfelton commentedRevised 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.
Comment #22
omega8cc CreditAttribution: omega8cc commentedThanks.
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.
Comment #23
omega8cc CreditAttribution: omega8cc commentedThis 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, whiledirname(dirname(__FILE__))
fix is correct and we need it.I will submit a revised patch shortly.
Comment #24
omega8cc CreditAttribution: omega8cc commentedRevised patch ready for review: http://drupalcode.org/sandbox/omega8cc/1443220.git/commit/296f10a
Comment #25
Anonymous (not verified) CreditAttribution: Anonymous commentedThanks! 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.
Comment #26
omega8cc CreditAttribution: omega8cc commentedAh, 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!
Comment #27
Anonymous (not verified) CreditAttribution: Anonymous commentedRoger that. Thanks! :)