Resolved An error occurred while updating Could not create directory (wordpress)

Status
Not open for further replies.

jerome1g

Member
Messages
113
Reaction score
1
Points
18
When doing a Wordpress update of my plugins I get the following errors:

upload_2020-8-9_23-59-5.png
 

spacresx

Community Advocate
Community Support
Messages
2,183
Reaction score
195
Points
63
Normally x10 hosting does not provide script support,
but its possible someone else that uses wordpress can help you.

just as a suggestion have you tried creating the folders that dont exist ?
 

garrettroyce

Community Support
Community Support
Messages
5,611
Reaction score
249
Points
63
This happens if you don't have a good temp directory set. Make sure that your Wordpress and/or PHP config have a proper temp directory. The entire path to the temp directory must exist, eg ~/path/to/temp/folder must have a folder "folder" inside of a folder "temp" inside of a folder "to" inside of a folder "path". If any of these are missing, it will fail. Your temp directory must be owner read/write/enter and every folder in the tree must be the same. This is permission 0755 in octal notation.
 

jerome1g

Member
Messages
113
Reaction score
1
Points
18
I have a tmp folder in my root folder tmp 700

/public_html/wp/wp-config.php this configs the database nothing to do with the file system


/public_html/wp/wp-config.php Does not set a path or creates path for a tmp directory

No access to php.ini

No tmp in the following directory trees


public_html/wp
public_html/wp/wp-content
public_html/wp/wp-content/plugins

Does the tmp directory go into one of these directories and if so which one?
If not where should it go?
 

jerome1g

Member
Messages
113
Reaction score
1
Points
18
Strange thing
When I tried to do and update on one of the plugins it got stuck in maintenance mode
I rename the plugin directory to get it out of maintenance mode When I rename the plugin directory back, It looks like all the plugins that needed
to be updated have been updated with no problems and are not asking to be updated

In addition I am now getting the following message:
An automated WordPress update has failed to complete -
please attempt the update again now.
 
Last edited:

zaweex10

Member
Messages
33
Reaction score
1
Points
8
The 'tmp' folder is in the correct place (root folder) with the correct directory permission (700). IOW, don't move it or mess with it.

It looks like all the plugins that needed to be updated have been updated with no problems


Is this an assumption or did you verify that each plugin that was updated indicates the latest version?

As for the "An automated WordPress update has failed to complete" that seems odd because the last update was a security update back on June 10, 2020. Wordpress uses the upgrade folder located within the wp-content folder (in your case: public_html/wp/wp-content/upgrade) to unpack any Wordpress updates/upgrades. I'm not sure if the same applies to plugins or themes. Nevertheless, check if the upgrade folder has a directory permission of 755 and the "UID/GID" indicates your account name. Also check if the upgrade folder is empty.
 

jerome1g

Member
Messages
113
Reaction score
1
Points
18
public_html/wp /wp-content

Filename Size
Perm. Date UID/GID
upgrade 4 KB 755 2020-8-11 jerome57/jerome57

upload_2020-8-11_16-16-21.png
 

jerome1g

Member
Messages
113
Reaction score
1
Points
18
Found out the cause of this "An automated WordPress update has failed to complete"
Wordpress can't update to WordPress 5.5

Just did the update to WP 5.5
Here is the screen information
I did this using the update button. The automated update process failed
Update WordPress
Downloading update from https://downloads.wordpress.org/release/wordpress-5.5-no-content.zip…

The authenticity of wordpress-5.5-no-content.zip could not be verified as no signature was found.

Unpacking the update…

Verifying the unpacked files…

Preparing to install the latest version…

Enabling Maintenance mode…

Copying the required files…

Disabling Maintenance mode…

Upgrading database…

WordPress updated successfully

Welcome to WordPress 5.5. You will be redirected to the About WordPress screen. If not, click here.
 

zaweex10

Member
Messages
33
Reaction score
1
Points
8
Interesting, 5.5 was just released at some point during the day (August 11, 2020). So, does mean that your problem with the updating of plugins has gone away also?
 

jerome1g

Member
Messages
113
Reaction score
1
Points
18
Don't know I guess I will have to wait until a plugin needs to be update and see if I get the same error
 

garrettroyce

Community Support
Community Support
Messages
5,611
Reaction score
249
Points
63
The 'tmp' folder is in the correct place (root folder) with the correct directory permission (700). IOW, don't move it or mess with it.

The PHP.INI file shared by every user doesn't have a temp dir set (the value is not set). You have to make sure that anything that depends on that global variable is prepared to handle it.

Check this link here for changing the temp path: https://www.wpbeginner.com/wp-tutorials/how-to-fix-missing-a-temporary-folder-error-in-wordpress/

Folder permissions at 700 should work because users of your website create a process on the server running under your user account. You should create the folder out of the public_html folder (as you did) or blocking users from viewing it via .htaccess
 

zaweex10

Member
Messages
33
Reaction score
1
Points
8

Have you actually tried this recommended fix? And, on another note, if X10 sets up the "tmp" folder as previously indicated, why would it be missing (other than an accidental deletion or some other act of nature)?

AFAIK (on the x15 server), when I run the php function "sys_get_temp_dir()", it returns "/tmp" and when I run the Wordpress function "get_temp_dir()", it returns "/tmp/" (Wordpress adds the trailing slash within the function and it also checks whether the directory is writable). This kind of leads me to believe that the "tmp" folder is probably doing what it's suppose to do. But then, what do I know? I'll just say this, I'm not an expert.
 

garrettroyce

Community Support
Community Support
Messages
5,611
Reaction score
249
Points
63
Have you actually tried this recommended fix?

No, I did search the forum and found another user with a similar issue where this exact same troubleshooting was done https://x10hosting.com/community/threads/missing-a-temporary-folder-error.208222/#post-980729

And, on another note, if X10 sets up the "tmp" folder as previously indicated, why would it be missing (other than an accidental deletion or some other act of nature)?

/tmp has to exist. It's part of the POSIX standard. I didn't say it's missing, I said

The PHP.INI file shared by every user doesn't have a temp dir set (the value is not set).

It's not in the configuration. From phpinfo()

Screenshot_20200812_173131.png

AFAIK (on the x15 server), when I run the php function "sys_get_temp_dir()", it returns "/tmp" and when I run the Wordpress function "get_temp_dir()", it returns "/tmp/" (Wordpress adds the trailing slash within the function and it also checks whether the directory is writable)

The directory is there and writeable, but is in in open_basedir? https://www.php.net/manual/en/ini.core.php#ini.open-basedir

But then, what do I know? I'll just say this, I'm not an expert.

No one here is an expert. This guy probably isn't either, but he's got some upvotes https://www.php.net/manual/en/function.sys-get-temp-dir.php#97044

This function does not account for virtualhost-specific modifications to the temp path and/or open_basedir:

<Virtualhost>
php_admin_value open_basedir /home/user
php_admin_value upload_tmp_dir /home/user/tmp
php_admin_value session.save_path /home/user/tmp
</Virtualhost>

Within this config it still returns /tmp

I'm actually wondering if open_basedir is not set correctly for this user's account. I'm not an admin and don't have access to the VirtualHost configuration, but moving the temp folder to a different folder gives us insight on whether or not /tmp is the problem. Since the user's home folder is serving files correctly, it must be in open_basedir and a subfolder in the user home folder would also be in open_basedir.

@jerome1g Is your account close to the storage or inode limit?
 

garrettroyce

Community Support
Community Support
Messages
5,611
Reaction score
249
Points
63
If you log in to direct admin, it's on the first page. Disk Space (XXX/512 MB) and Inode (XXX)

An inode is a file, a folder, or a link to a file or folder. There's other technicalities, but for your account it's pretty much just files and folders.

Spelling doesn't matter if you make the folder yourself, just make sure it matches. The POSIX standard is "/tmp" but anything inside your home folder is not subject to any real standard other than what you like. POSIX is case sensitive, unlike Windows. ~/tmp/ is different than ~/TMP/ which is different than ~/.tmp/, but really any of them is "valid". (~ is something like /home/jerome1g/ AKA your home folder). Finally, Windows uses backslashes ("\") and sometimes understands forward slashes ("/") but POSIX only understands forward slashes ("/"). So it has to be something like ~/tmp and not C:\tmp. Spaces are annoying. Don't use spaces.

Now, the kicker is when you use dirname(__FILE__), you're saying the temp folder is in a subfolder of your wordpress configuration file. If your temp folder is in the folder above that, then you need to use the "folder above this one" syntax, which is ".."

So if your site is installed here:

/home/jerome1g/domains/something.x10.mx/public_html/wp-config.php

And your temp path is here:

/home/jerome1g/tmp

We have to go up 3 folders (from public_html into something.x10.mx and then up into domains and then up into jerome1g) and then into tmp so:

define('WP_TEMP_DIR', dirname(__FILE__) . '/../../../tmp/');

or, create your temp folder here:

/home/jerome1g/domains/something.x10.mx/public_html/wp_content/temp

And use the example in my link:

define('WP_TEMP_DIR', dirname(__FILE__) . '/wp-content/temp/');

Finally, make sure your permissions 0755. 0700 is fine too, if you want to tighten security, but I'm not 100% sure that won't cause issues in some niche circumstance.

Sorry this post is so long. It ended up being a lot of explanation for "create a temp directory and tell Wordpress about it"
 

jerome1g

Member
Messages
113
Reaction score
1
Points
18
Disk Space 374.9 MB / 512 MB
Inode 8188 / 50000

public_html/wp/wp-config.php
define('WP_TEMP_DIR', dirname(__FILE__) . '/wp-content/temp/'); <--- code added from wpbeginner article on
How to Fix “Missing a Temporary Folder” Error in WordPress
 

zaweex10

Member
Messages
33
Reaction score
1
Points
8
@garrettroyce

I had prepared a reply, but it's best for me to post it as a sidebar (same conversation but different venue) as opposed to interfering and causing a further distraction within this thread. I could post it as a conversation, with your permission, untouched, the gist is a relative short description of the "Wordpress plugin upgrade" process.
 
Status
Not open for further replies.
Top