Make WordPress Core

Opened 15 years ago

Closed 15 years ago

#10541 closed defect (bug) (fixed)

WP 2.8.2 and 2.8.3 auto-upgrade failing due to fs_connect() returning false 'directory doesn't exist'

Reported by: jimsky7's profile jimsky7 Owned by: dd32's profile dd32
Milestone: 2.9 Priority: normal
Severity: normal Version: 2.9
Component: Filesystem API Keywords: has-patch needs-testing commit
Focuses: Cc:


Under some conditions (may be because web server docroot differs from the FTP base directory) WP 2.8.2 and now WP 2.8.3 auto-upgrades fail. See discussion here with more details ->

When I try an auto-upgrade I get a message "Installation failed" before any attempt is even made to download the zip file.

Here's the detail I reported in that forum posting:

I have traced through the code that performs the auto-upgrade and for reasons not yet known to me it checks to see if the directory "/" exists (it's checking for ABSPATH and WP_CONTENT_DIR before it begins upgrading) and the check fails ... so my upgrade stops. No error message is being returned from fs_connect() [in file wp-upgrader.php] which is the routine that is called to check for existence of various directories before an upgrade can begin. I don't see why there's no error message generated (yet) in fs_connect(). I modified the code so it would skip checking if the directory name is "/" and my upgrade to 2.8.3 was performed just fine - took about 60 seconds.

wp_update_core() instantiates a Core_Upgrader and the ->upgrade method is invoked, and the Core_Upgrader does this

$res = $this->fs_connect( array(ABSPATH, WP_CONTENT_DIR) );

and fs_connect() performs a check on "/" (which is the FTP root directory rather than the docroot which in my case is /var/www/sky/) instead of what we expected ABSPATH to be and fails. For reasons unknown to me, no error is reported back to be shown in the window, so this is kind of tough to debug.

Sorry that I had to report this as WP 2.9 in Trac because 2.8.2 and 2.8.3 are not available as Version numbers in the popup.

Attachments (2)

10541.diff (2.1 KB) - added by dd32 15 years ago.
class-wp-upgrader.php (37.6 KB) - added by dd32 15 years ago.

Download all attachments as: .zip

Change History (7)

#1 @jimsky7
15 years ago

  • Summary changed from WP 2.8.2 and 2.8.3 failing due to fs_connect() returning false 'directory doesn't exist' to WP 2.8.2 and 2.8.3 auto-upgrade failing due to fs_connect() returning false 'directory doesn't exist'

#2 @dd32
15 years ago

  • Component changed from General to Filesystem
  • Milestone changed from Unassigned to 2.9
  • Owner set to dd32

Ok, So in short:

If WordPress is installed in /(as visible by FTP) then the automatic upgrade is not working by FTP any more?

15 years ago

#3 @dd32
15 years ago

  • Keywords has-patch needs-testing commit added

attachment 10541.diff added

  • ::abspath() contains code for checking if ABSPATH == /
  • Previously it was looping over all the if else branches, not something it was originally intended to do
  • ::find_folder() doesnt have the code for ABSPATH == /, therefor, it was failing.

Patch fixes it for me, trunk's the best location for testing.

#4 @dd32
15 years ago

attachment class-wp-upgrader.php added

  • Only uploaded so testers can download it without needing to diff/patch anything.

#5 @ryan
15 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [11862]) fs_connect() fixes. Props dd32. fixes #10541

Note: See TracTickets for help on using tickets.