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 saw this on a new installation:
[...]
Created symlink /var/aegir/clients/admin/aegir.example.com [success]
to /var/aegir/hostmaster-7.x-3.9/sites/aegir.example.com
sudo: no tty present and no askpass program specified [warning]
sudo: no tty present and no askpass program specified [warning]
Changed permissions of [success]
/var/aegir/hostmaster-7.x-3.9/sites/aegir.example.com/drushrc.php
to 640
[...]
Comments
Comment #2
Dustin@PI CreditAttribution: Dustin@PI commentedWe're also getting this on platform "verify". For us this is happening when importing a platform on the local machine.
We're using ubuntu '16.04.2 LTS' with PHP 7.1
Comment #3
helmo CreditAttribution: helmo at Initfour websolutions commentedThe test on Gitlab is also showing this warning ...
Any function problems that could be caused by this?
There is a hint about using 'ssh -t' on http://stackoverflow.com/questions/21659637/how-to-fix-sudo-no-tty-prese...
Comment #4
pmunch CreditAttribution: pmunch commentedSame pb here on a fresh Aegir3.10 install using deb packages.
Pb showed immediately after install on verify hostmaster task:
Disable "Fix Permissions" and "Fix Ownership" features in Hosting/Experimental to discard messages.
This pb is discussed here: https://www.drupal.org/node/2616426#comment-11867530
Comment #5
colanComment #6
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedWhat is the correct sudoers line to add to the sudoer file?
i have this and it doesn't seem to work:
aegir ALL=NOPASSWD: /usr/local/bin/fix-drupal-site-permissions.sh
aegir ALL=NOPASSWD: /usr/local/bin/fix-drupal-site-ownership.sh
Comment #7
doka CreditAttribution: doka commentedYou'll need to grant permissions for the two platform scripts, as well:
Comment #8
solanas CreditAttribution: solanas as a volunteer commentedThis problem happen us after upgrading from 3.186 -> 3.190
While we were in 3.186 all our platforms verify task finished OK, but just after upgrade in Ubuntu 18.04 with debian packages, a server verification task with all its platforms were automatically run and all the platforms finished with this warning.
Comment #9
helmo CreditAttribution: helmo at Initfour websolutions commentedI found that commit f85b6e5214607235f190bccc05a3d372164f0f90 from #3149961: BOA backport calls this fix-drupal-platform-ownership.sh script without checking if the module is enabled.
Who can make a patch that adds such a check?
Note that the module has an extra install.sh script which is mentioned when the module is installed.
PS: this is diverting a bit from the original issue here, the mentioned commit just adds extra calls to sudo.
Comment #10
doka CreditAttribution: doka commentedMy understanding is that some verification task calls certain drush hooks from "Fix Permissions" and "Fix Ownership" modules when these modules are enabled. However, in order to properly install the "Fix Permissions" and "Fix Ownership" modules, an extra install script on the backend has to be called. This step is often overlooked and skipped at manual installs, and this step is not part of the debian package, since these are optional golden modules.
If overlooked for any reason, but the modules are enabled, the aegir user won't have proper sudo permissions to run some related backend scripts, and throwing these warnings. For a quick fix after every platform install see https://www.drupal.org/project/provision/issues/2842473#comment-13804339
Comment #11
solanas CreditAttribution: solanas as a volunteer commented"Fix Permissions" and "Fix Ownership" modules are disabled in my environment. Aegir is installed with Debian package 3.192 and I'm getting this warnings when verifying platforms.
The scripts referenced in comment 7 are not present in my environment. Should I download them from anywhere?
Comment #12
llamechWhile testing Aegir 3 on Ubuntu 20, I am seeing this warning from sudo during Verify tasks; it doesn't stop anything from working but might be relevant here:
Comment #13
HeneryH CreditAttribution: HeneryH commentedI don't have those scripts in my /usr/local/bin on my install.
They are all in /var/aegir/hostmaster-7.x-3.192/profiles/hostmaster/modules/aegir/hosting_tasks_extra/fix_{permissions/ownership}/scripts
The install seemed fine from the command line feedback but I am getting the host verification warning in the UI saying that
sudo: no tty present and no askpass program specified.
edit - oh, I do see those warnings in the install output
Comment #14
drakythe CreditAttribution: drakythe commentedCopying the scripts into /usr/local/bin and updating my aegir sudoers file as pointed out in #7 worked for me.
Comment #15
kienan CreditAttribution: kienan commentedIt's also necessary to add similar checks for the fix-drupal-site-ownership.sh and fix-drupal-site-permissions.sh. Following an install from the Debian package, there were also notifications for these two scripts:
Comment #16
kienan CreditAttribution: kienan commentedHere's a potential patch that addresses one of the instances, as it's called directly from verify.provision.inc.
It doesn't address the two other instances highlighted in #15, so is only a partial fix.
I believe those instances are called when the hostmaster site is verified. The only way I think those can be called are from hosting_tasks_extra/fix_ownership/drush/zz_fix_ownership.drush.inc and hosting_tasks_extra/fix_permissions/drush/zz_fix_permissions.drush.inc. I don't presently understand why those would be loaded in the context of installing the hostmaster though.
From the install.log, in verbose it's definitely being invoked:
This doesn't happen in subsequent runs of
though. I think this is because once the hostmaster is verified the first time,
is created, and it contains a list of modules to exclude since the feature is disabled.
Eg.
So, it might be possible to explicitly create drushrc.php before running hostmaster-install in the debian package, or as part of hostmaster-install; however, this feels a little weird since we're working around a hook in a contrib module.
It's probably best to wrap the drush hooks in fix_permissions and fix_ownership so that it does verify that the feature is enabled before running.
Comment #17
kienan CreditAttribution: kienan commentedHere's a patch (against hosting_tasks_extra) which verifies that the feature is enabled before running any of the commands from the drush hook. It appears to stop the sudo warnings during initial installation. I tested it in combination with the patch from #16.
Comment #18
Steven Jones CreditAttribution: Steven Jones at ComputerMinds commentedThanks @kienan your patch in #16 almost worked for me. I needed to tweak it to use the fix_permissions feature that the scripts are in though, as the attached patch does.
Comment #19
sseidel CreditAttribution: sseidel as a volunteer commented@steven-jones but the path should really check for fix_ownership, right? Since this is the module that will provide /usr/local/bin/fix-drupal-platform-ownership.sh.
Comment #20
gilles9999 CreditAttribution: gilles9999 commentedHello, may I ask you a question as very beginner?
What is the best practice to apply these three patches?
I did some research and I found many techniques.
Two options that I found are:
curl https://www.drupal.org/files/[patch-name].patch | git apply -
wget -q -O - https://www.drupal.org/files/[patch-name].patch | git apply -
If I try to call it as aegir user the result is:
curl https://www.drupal.org/files/issues/2021-08-03/hosting_tasks_extra-28424... | git apply -
fatal: cannot come back to cwd: Permission denied
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--100 2226 100 2226 0 0 18864 0 --:--:-- --:--:-- --:--:-- 19025
(23) Failed writing body
Thank you
Comment #21
Steven Jones CreditAttribution: Steven Jones at ComputerMinds commented@sseidel spot on.
Comment #23
Steven Jones CreditAttribution: Steven Jones at ComputerMinds commentedThanks everyone!