Local file transfer impossible due to weird conditions in update manager; "Module installation requires FTP access"

Created on 21 August 2014, almost 11 years ago
Updated 14 May 2025, 19 days ago

Local file transfer impossible due to weird conditions in update manager; "Module installation requires FTP access"

Error (or status) message is Module installation requires FTP access.

There is error in Update manager - for unknown reason to determine if local file transfer is possible there are no writability checks but file ownership matching checks. Affected by this weird concept file is update.menager.inc and here is example:

    // If the owner of the last directory we extracted is the same as the
    // owner of our configuration directory (e.g. sites/default) where we're
    // trying to install the code, there's no need to prompt for FTP/SSH
    // credentials. Instead, we instantiate a FileTransferLocal and invoke
    // update_authorize_run_update() directly.
    if (fileowner($project_real_location) == fileowner(conf_path())) {
      module_load_include('inc', 'update', 'update.authorize');
      $filetransfer = new FileTransferLocal(DRUPAL_ROOT);
      update_authorize_run_update($filetransfer, $updates);
    }
    // Otherwise, go through the regular workflow to prompt for FTP/SSH
    // credentials and invoke update_authorize_run_update() indirectly with
    // whatever FileTransfer object authorize.php creates for us.
    else {
      system_authorized_init('update_authorize_run_update', drupal_get_path('module', 'update') . '/update.authorize.inc', array($updates), t('Update manager'));
      $form_state['redirect'] = system_authorized_get_url();
    }

Basically this works only on standard webserver configurations. If you have sophisticated permissions made up purposely or just messed up it won't allow you and force to use FTP. Even always working sheet-anchor known as "chmod -R 777" will NOT solve problem. 99% of users stricken by that will end up with few hours of pointless research, system checkups and debugging wasted concluded by some very wise advice "you can always use FTP or simply upload file manually" by some random guy or even on Drupal issue tracker.

Please, no I beg you developers - fix that becouse it is VERY OLD issue and it is ANNOYING. Only thing to do is to change way of checking if local file transfer is not possible eg. is_writable().

πŸ“Œ Task
Status

Closed: won't fix

Version

11.0 πŸ”₯

Component

update.module

Created by

Live updates comments and jobs are added and updated live.
  • Needs backport to D7

    After being applied to the 8.x branch, it should be considered for backport to the 7.x branch. Note: This tag should generally remain even after the backport has been written, approved, and committed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024