As in the title, when updating to the latest version Drupal gives this error and aborts: Unable to create directory 'temporary://update-extraction/google_analytics/'

Comments

hass’s picture

Category: bug » support
Status: Active » Fixed

What version have you upgraded from? Verify if your temp folder is correctly configured, permissions and writable, etc.

hass’s picture

Project: Google Analytics » Drupal core
Version: 7.x-1.x-dev » 7.x-dev
Component: Code » update.module

Have read the title again. Sounds like a core issue if this is not a bug in your config what I expect.

dbeall’s picture

I was having a similar error at module upgrade and solved it

My install is in a sub directory..
I had to change the tmp path in drupal to the FULL path as follows
/home/account-name/public_html/drupal7/tmp

edit:
thinkin back, my error did not occur in d7rc2 when i first ran the auto-update module
-and-
I did try many different ways as far as directory permissions before messing with path.. no change

wickedskaman’s picture

Cool... thanks for weighing in. I will give it a try after we go live and report back yay or nay after we are no longer in the sub directory. Seems like this should be handled... small bug in core.

hass’s picture

Category: support » bug
Status: Fixed » Active

My dev is also in a subdir and i have never seen this myself, but update module have many bugs... It's possible...

dww’s picture

srbobc’s picture

My Drupal 7 installation is in a subdirectory so I fixed this logging in and navigating to: Configuration:File System and changing the Temporary Directory to read:

/home/my_account_name/public_html/sub_directory_name/tmp

Voila!

ecommercium’s picture

Version: 7.x-dev » 7.0
Component: update.module » base system

Had this error on the 7.0 release and fixed this by setting File System Temporary directory to username/tmp (a dir tmp in my hostings root dir where i user have permissions writing) Cheers

mindful’s picture

Thanks to all above for the posts. I too was having the issue with installing themes into a subdirectory D7 site.

Based on your posts and some additional investigation, here is what I found and the SOLUTION that worked for me.

SOLUTION

The default install for D7 assumes:

  1. /tmp directory at the web server root (not your site root) will be used for temporary files. This directory is not publicly accessible since it is not in web service area of your domain (i.e. /home/yor-domain/public_html/... on lnux)
  2. There are 2 directories created when you initiate an install from URL for a theme. The directories are: /tmp/update-cache/ and /tmp/update-extraction/.
  3. I confirmed that the directory /home/my_domain/tmp existed.
  4. The path to your temporary directory is defined in your D7 Admin interface > Configuration > Media > File System > Temporary Directory which defaults to /tmp as indicated in 1 above. I changed that value to /home/my_domain/tmp so that it would reside within the domain account but outside the web accessible directories (public_html). Beneath the field for setting the temporary directory it states "A local file system path where temporary files will be stored. This directory should not be accessible over the web." which is why I pointed it to the directory above the public_html.
  5. I then was able to install a theme using a URL under Admin > Appearance > Install New Theme > Install From URL without issue.

WHAT I LEARNED

  1. It appears that D7 in using the /tmp directory assumes that there is a single instance of D7 running on a server.
  2. It creates the directories /tmp/update-cache/ and /tmp/update-extraction/ for the first instance of D7 installed.
  3. In a shared hosting environment where multiple domains install independant D7 instances this means that the first instance of these directories created is assigned the Ownername and GroupOwnerName permissions of the requesting domain. Each subsequent domain instance cannot create the directories because they already exist. They also cannot access the directories because they are owned by the intial domain that installed them. And that is what caused the "Unable to create directory 'temporary://update-..." messages for both theme and module installs.

SUGGESTION

There appear to be 2 files involved under yor site root

  • modules/update/update.manager.inc: $cache_directory = 'temporary://update-cache';
  • modules/update/update.module: 'temporary://update-cache',
  • modules/update/update.manager.inc: $directory = 'temporary://update-extraction';
  • modules/update/update.module: 'temporary://update-extraction',

If the update-... was optionally appended with the HTTP_HOST/ as:

  • modules/update/update.manager.inc: $cache_directory = 'temporary://update-cache/$_SERVER["HTTP_HOST"]';
  • modules/update/update.module: 'temporary://update-cache/$_SERVER["HTTP_HOST"]',
  • modules/update/update.manager.inc: $directory = 'temporary://update-extraction/$_SERVER["HTTP_HOST"]';
  • modules/update/update.module: 'temporary://update-extraction/$_SERVER["HTTP_HOST"]',

(syntax and location may need to be adjusted) but this would force a unique Temporary path for each domain using a D7 instance.

Spent a few days researching this and found many posts that seemed to state solutions but did not provide the specifics so I hope this summary helps others with the same issue.

wickedskaman’s picture

This is what worked for me.

Went into admin/config/media/file-system
and changed the temporary directory from /tmp to tmp

Removing the first slash seemed to fix it.

This has been the case on GoDaddy, Blue Host, and various flavors of CPanel hosts.

tomcatuk’s picture

@wickedskaman confirmed this is the fix for GD hosting - thanks!

wickedskaman’s picture

@tomcatuk: no sweat! Glad to be somewhat useful! :)

Dries Arnolds’s picture

The web root autodetection was the problem on my installs. Drupal detected:
/home/vhosts/site.com/tmp

but the root was actually:
/usr/home/vhosts/site.com/tmp

Works like a charm now.

dtoulkidis’s picture

(Installation info: Greece. webhost:www.papaki.gr. It offered a "one click installation" of drupal.)

1. Go in D7 Admin interface > Configuration > Media > File System > Temporary Directory
it defaults to "/tmp" ( at least mine did).

2. As I saw on the top of the page the public file system path defaults to "sites/default/files" with no "/" at the beginning, which made me realize that "/tmp" should just be "tmp" ... :) changed it. And it works!

3. But since the instructions underneath clearly says “This directory should not be accessible over the web.” what we are searching for is the tmp folder outside the domain's “public_html” or “httpdocs” folder.
So I changed it again to “../../tmp” (my_domain/tmp in reality)

Works like a clock!

Hope I helped.

dibyadel’s picture

it worked for me. I changed the tmp path from /tmp to tmp

raxxraxx’s picture

Issue summary: View changes

I think there might be a bug in here.

I had created the temporary path within my Drupal install folder and referred to it with an absolute path as /directory/to/drupal/install/newtmpfolder/ . I made sure newtmpfolder was chown'd properly (by su'ing to the apache user and making files and folders in the temp folder) and that I had typed the absolute path properly (by cutting and pasting the path into a cd command) and both were set correctly.

Then I changed to using the relative path 'newtmpfolder/' and it worked.