[wp-trac] [WordPress Trac] #39746: Suddenly getting error on all of my servers: Unable to locate WordPress content directory (wp-content).

WordPress Trac noreply at wordpress.org
Wed Feb 1 04:18:22 UTC 2017


#39746: Suddenly getting error on all of my servers: Unable to locate WordPress
content directory (wp-content).
-----------------------------+------------------------------
 Reporter:  jobst            |       Owner:
     Type:  defect (bug)     |      Status:  new
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  Upgrade/Install  |     Version:  4.7.2
 Severity:  normal           |  Resolution:
 Keywords:                   |     Focuses:
-----------------------------+------------------------------

Comment (by jobst):

 My error log has the following

 {{{
 [01-Feb-2017 03:53:41 UTC] PHP Warning:
 file_put_contents(ssh2.sftp://Resource id #834/.maintenance): failed to
 open stream: operation failed in {WP_INSTALL}/wp-admin/includes/class-wp-
 filesystem-ssh2.php on line 259
 }}}

 which refers to this line

 {{{
 $ret = file_put_contents( $this->sftp_path( $file ), $contents );
 }}}

 in function "put_contents()".

 This means, it actually gets a fair way into the code, it also gets pass
 the following line in "fs_connect()" in file "class_wp_upgrader.php"

 {{{
 if ( ! WP_Filesystem( $credentials, $directories[0],
 $allow_relaxed_file_ownership ) ) {
 }}}

 but fails here

 {{{
 case WP_CONTENT_DIR:
   if ( ! $wp_filesystem->wp_content_dir() )
     return new WP_Error('fs_no_content_dir',
 $this->strings['fs_no_content_dir']);
 }}}

 Now dumping the structure of "$wp_filesystem" does not show any path
 relating to "wp-content" ... here stops my skill a bit as I don't have a
 clue (yet) about the inheritance of the WP_Filesystem_Base class and where
 it could possibly find this.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/39746#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list