Drupal 10, the latest version of the open-source digital experience platform with even more features, is here.If I set http basic authentication for a site in a pack server I get 500 Internal server error when I open the site.
Apache error.log
[Tue Jun 07 12:31:01.813192 2016] [authn_file:error] [pid 27258] (2)No such file or directory: [client REDACTED] AH01620: Could not open password file: /var/aegir/config/server_REDACTED/apache/passwords.d/example.com
I'm not really familiar with the aegir architecture, but I think this is because this module uses d()->service('http')->sync($path) to sync the password file and Provision_Service_http_pack::sync only syncs to master servers (that's the whole point of pack servers).
I can try to make a patch, but I need some orientation first. My first thought is to check if the server is a pack and explicitly sync to the slave servers in _http_basic_auth_create_file, but I don't think that's ideal.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | password_file_is_not-2744367-3.patch | 1.35 KB | sambonner |











Comments
Comment #2
helmo CreditAttribution: helmo as a volunteer and at Initfour websolutions commentedA patch for _http_basic_auth_create_file would probably be the quickest workaround like you suggest.
For a proper patch we'd have to split the sync() method into something for config and something for site content ...
... or the sync() method in the Provision_Service_http_pack class could do a check on $path to see if it needs to go to the slaves.
Comment #3
sambonner CreditAttribution: sambonner at Catalyst IT commentedHeh, this is the same issue from many years ago which I originally wrote a PR for on Github when it was just a standalone contrib module from computerminds - https://github.com/computerminds/aegir_http_basic/pull/7. Unfortunately I never got round to attempting to getting it merged into the new hosting tasks extra project. Will try to right this wrong 5 years on :P
Helmo, as you suggested I'm just syncing out the config within the _http_basic_auth_create_file() method. I'd be happy to do it elsewhere if there's a better approach but I don't have the context or understanding to make the changes further down the stack at this time. In addition we've been running the attached patch for the last 5 years on a large client's Aegir platform, so I'm pretty confident that it behaves as expected :) Attaching patch against 7.x-3.x-dev.
Comment #4
mpv CreditAttribution: mpv at gcoop Cooperativa de Software Libre commentedThank you both! The patch in #3 works great.
Comment #5
helmo CreditAttribution: helmo as a volunteer and at Initfour websolutions commentedThanks
Comment #6
helmo CreditAttribution: helmo as a volunteer and at Initfour websolutions commented