error updating plugin (any) not exist or writable
-
OK:
Here’s my question:
I tried to update my jetpack (as well as the akismet plug in below)one response said error was in wp-admin/wp-config.php file, and to ensure it’s right and add the directory pointers as suggested.
HOWEVER, the error message (again after the ===_
says the error is in line 1092 (here)
I quote… No such file or directory in /home/customer/www/azadminsolutions.com/public_html/wp-admin/includes/file.php on line 1092But real problem is when I get there in that file, at that line I see a subroutine
I get the same messages for any plug ins I try to update.
the message(s) I received are after line with “===”I searched google for
various things like “Fix WordPress ‘Destination directory for file streaming does not exist or is not writable”
** this site (https://www.dessol.com/blog/fix-wordpress-destination-directory-for-file-streaming-does-not-exist-or-is-not-writable/) said it’s likely a permissions problem, or missing a tmp directory.
but looking closer, it seems============================
Update PluginDownloading update from https://downloads.wordpress.org/plugin/akismet.4.1.9.zip…
Warning: unlink(/home/customer/www/azadminsolutions.com/public_htmlwp-content/uploads/akismet.4.1.9-dAXXIP.tmp): No such file or directory in /home/customer/www/azadminsolutions.com/public_html/wp-admin/includes/file.php on line 1092
Download failed. Destination directory for file streaming does not exist or is not writable.
=================
End error msgOK: so how do I determine why I’m having these update issues.
it does turn out that there were other issues related to the sites’s hosting and move of the site, mostly because there were permission problems with certain directories.
Is there a suggested list of directories and permissions anywhere easily accessible?code snippet from my wp-admin/includes/file.php around error location
**************code snipet from file.php on my site:
starts at line 1053
line 1053: `/**
* Downloads a URL to a local temporary file using the WordPress HTTP API.
*
* Please note that the calling function must unlink() the file.
*
* @since 2.5.0
* @since 5.2.0 Signature Verification with SoftFail was added.
*
* @param string $url The URL of the file to download.
* @param int $timeout The timeout for the request to download the file.
* Default 300 seconds.
* @param bool $signature_verification Whether to perform Signature Verification.
* Default false.
* @return string|WP_Error Filename on success, WP_Error on failure.
*/
function download_url( $url, $timeout = 300, $signature_verification = false ) {
// WARNING: The file is not automatically deleted, the script must unlink() the file.
if ( ! $url ) {
return new WP_Error( ‘http_no_url’, __( ‘Invalid URL Provided.’ ) );
}$url_filename = basename( parse_url( $url, PHP_URL_PATH ) );
$tmpfname = wp_tempnam( $url_filename );
if ( ! $tmpfname ) {
return new WP_Error( ‘http_no_file’, __( ‘Could not create Temporary file.’ ) );
}$response = wp_safe_remote_get(
$url,
array(
‘timeout’ => $timeout,
‘stream’ => true,
‘filename’ => $tmpfname,
)
);if ( is_wp_error( $response ) ) {
unlink( $tmpfname );
return $response;
}$response_code = wp_remote_retrieve_response_code( $response );
if ( 200 != $response_code ) {
$data = array(
‘code’ => $response_code,
);// Retrieve a sample of the response body for debugging purposes.
$tmpf = fopen( $tmpfname, ‘rb’ );
if ( $tmpf ) {
/**
* Filters the maximum error response body size indownload_url().
*
* @since 5.1.0
*
* @see download_url()
*
* @param int $size The maximum error response body size. Default 1 KB.
*/
$response_size = apply_filters( ‘download_url_error_max_body_size’, KB_IN_BYTES );
$data[‘body’] = fread( $tmpf, $response_size );
fclose( $tmpf );
}unlink( $tmpfname );
return new WP_Error( ‘http_404’, trim( wp_remote_retrieve_response_message( $response ) ), $data );
}$content_md5 = wp_remote_retrieve_header( $response, ‘content-md5’ );
if ( $content_md5 ) {
$md5_check = verify_file_md5( $tmpfname, $content_md5 );
if ( is_wp_error( $md5_check ) ) {
unlink( $tmpfname );
return $md5_check;
}
}// If the caller expects signature verification to occur, check to see if this URL supports it.
if ( $signature_verification ) {
/**
* Filters the list of hosts which should have Signature Verification attempted on.
*
* @since 5.2.0
*
* @param string[] $hostnames List of hostnames.
*/
$signed_hostnames = apply_filters( ‘wp_signature_hosts’, array( ‘wordpress.org’, ‘downloads.wordpress.org’, ‘s.w.org’ ) );
$signature_verification = in_array( parse_url( $url, PHP_URL_HOST ), $signed_hostnames, true );
}// Perform signature valiation if supported.
if ( $signature_verification ) {
$signature = wp_remote_retrieve_header( $response, ‘x-content-signature’ );
if ( ! $signature ) {
// Retrieve signatures from a file if the header wasn’t included.
// WordPress.org stores signatures at $package_url.sig.$signature_url = false;
$url_path = parse_url( $url, PHP_URL_PATH );if ( ‘.zip’ === substr( $url_path, -4 ) || ‘.tar.gz’ === substr( $url_path, -7 ) ) {
$signature_url = str_replace( $url_path, $url_path . ‘.sig’, $url );
}/**
* Filters the URL where the signature for a file is located.
*
* @since 5.2.0
*
* @param false|string $signature_url The URL where signatures can be found for a file, or false if none are known.
* @param string $url The URL being verified.
*/
$signature_url = apply_filters( ‘wp_signature_url’, $signature_url, $url );if ( $signature_url ) {
$signature_request = wp_safe_remote_get(
$signature_url,
array(
‘limit_response_size’ => 10 * KB_IN_BYTES, // 10KB should be large enough for quite a few signatures.
)
);if ( ! is_wp_error( $signature_request ) && 200 === wp_remote_retrieve_response_code( $signature_request ) ) {
$signature = explode( “\n”, wp_remote_retrieve_body( $signature_request ) );
}
}
}// Perform the checks.
$signature_verification = verify_file_signature( $tmpfname, $signature, basename( parse_url( $url, PHP_URL_PATH ) ) );
}if ( is_wp_error( $signature_verification ) ) {
if (
/**
* Filters whether Signature Verification failures should be allowed to soft fail.
*
* WARNING: This may be removed from a future release.
*
* @since 5.2.0
*
* @param bool $signature_softfail If a softfail is allowed.
* @param string $url The url being accessed.
*/
apply_filters( ‘wp_signature_softfail’, true, $url )
) {
$signature_verification->add_data( $tmpfname, ‘softfail-filename’ );
} else {
// Hard-fail.
unlink( $tmpfname );
}return $signature_verification;
}return $tmpfname;
}`
ends line 1213
**************end of code snipet 1 from file.php on my site:From what I can see (you can search for this above: this is line where 1092 ends (included from line 1054 to line 1094)
**************Start of code snipet 2 from file.php on my site: (lines 1054 to 1094) error was at 1092)
line 1092 which is where msg says error is: ” unlink( $tmpfname );” (quotes mine)
— line 1054/** * Downloads a URL to a local temporary file using the WordPress HTTP API. * * Please note that the calling function must unlink() the file. * * @since 2.5.0 * @since 5.2.0 Signature Verification with SoftFail was added. * * @param string $url The URL of the file to download. * @param int $timeout The timeout for the request to download the file. * Default 300 seconds. * @param bool $signature_verification Whether to perform Signature Verification. * Default false. * @return string|WP_Error Filename on success, WP_Error on failure. */ function download_url( $url, $timeout = 300, $signature_verification = false ) { // WARNING: The file is not automatically deleted, the script must unlink() the file. if ( ! $url ) { return new WP_Error( 'http_no_url', __( 'Invalid URL Provided.' ) ); } $url_filename = basename( parse_url( $url, PHP_URL_PATH ) ); $tmpfname = wp_tempnam( $url_filename ); if ( ! $tmpfname ) { return new WP_Error( 'http_no_file', __( 'Could not create Temporary file.' ) ); } $response = wp_safe_remote_get( $url, array( 'timeout' => $timeout, 'stream' => true, 'filename' => $tmpfname, ) ); if ( is_wp_error( $response ) ) { unlink( $tmpfname ); return $response; }** line 1094
**************end of code snipet 2 from file.php on my site:I hope i’ve given enough info to try and resolve this issue.
from what appears in the file.php, I think this is a wordpress main issue. but we’re currently fully updaated.
oh yeah
last (obvious) clue.
I can see (I’m oblivious, but not totally!) that the error message has the following error that is parsed in it, but not sure where error is actully coming from…
the error message comes up saying. “Warning: unlink(/home/customer/www/azadminsolutions.com/public_htmlwp-content/uploads )
where /www/azadminsolutions.com/public_htmlwp-content/ is OBVIOUSLY missing a slash between public_html annd wp-content.Where the heck is the missing slash supposed to come from? simple, yet not so simple…
Anxiously awaiting some help figuring out where the error is.
Thanks again!
The topic ‘error updating plugin (any) not exist or writable’ is closed to new replies.