On update of Drupal Core to 7.25 "DrupalTemporaryStreamWrapper::stream_open" call failed error appears on almost every page now. First time for this working site that has performed without error for some time now.

Now shows this additional in error:

Warning: file_put_contents(temporary://fileHpCdVf) [function.file-put-contents]: failed to open stream: "DrupalTemporaryStreamWrapper::stream_open" call failed in file_unmanaged_save_data() (line 1935 of [site home]/public_html/drupal/includes/file.inc).

And now front page header images and slogan not showing. Attempts to update appearance contains the above error and site is not updated.

I also notice that when attempting to update modules I get the message:
Updating modules and themes requires FTP access to your server. This has never before happened.

Comments

AD5XJ’s picture

Issue summary: View changes
AD5XJ’s picture

Issue summary: View changes
jacov’s picture

I am experiencing this as well, using the amazons3 and awssdk modules.

in admin/config/media/file-system

I have:

Public file system path
s3://public/path

Temporary directory
s3://tmp

also tried different combinations of /tmp with chmod 777 and still not working...
I see files in the s3 bucket though, but Drupal is throwing errors like this:

Warning: file_put_contents(temporary://filehowZ1H): failed to open stream: "DrupalTemporaryStreamWrapper::stream_open" call failed in file_unmanaged_save_data() (line 1935 of /var/www/drupal7/includes/file.inc).
jacov’s picture

RESOLVED

Figured it out!

DISABLE the cache in admin/config/development/performance

jeff.a’s picture

If you're disabling the cache to fix this problem, there's another issue with your install. Typically this error is caused by an incorrect 'File system' setting under /admin/config/media/file-system

Not sure about amazons3, but in cPanel the temp directory should usually be set to /tmp

This fixes the error. If not, call your hosting company and ask for the correct path to the tmp directory.

I really don't think this is a bug with core, so I'm going to close this issue.

Hope this helps!

jeff.a’s picture

Status: Active » Closed (works as designed)
jeff.a’s picture

Also, to the OP, make sure you're running at least php 5.3. If not, add this to your .htaccess file. Maybe you wrote over your php version when you updated core.

# Use PHP 5.3
AddHandler application/x-httpd-php53 .php
filnug’s picture

Answer #4 saved my life. Thanks.

toby53’s picture

Try updating of the permissions tmp directory configured here:
http://yoursite/admin/config/media/file-system
I had pulled site from host to localhost and allow read-write-execute permissions on the
site/default/files/tmp directory configured on http://yoursite/admin/config/media/file-system
works for me !

ugintl’s picture

Solution number 4 helped alot, but I am still getting this error.

Warning: file_put_contents(temporary://fil5C18.tmp): failed to open stream: "DrupalTemporaryStreamWrapper::stream_open" call failed in file_unmanaged_save_data() (line 1936 of C:\Users\taimoor\Sites\devdesktop\openatrium\includes\file.inc).
The file could not be created.
Warning: file_put_contents(temporary://fil84A3.tmp): failed to open stream: "DrupalTemporaryStreamWrapper::stream_open" call failed in file_unmanaged_save_data() (line 1936 of C:\Users\taimoor\Sites\devdesktop\openatrium\includes\file.inc).
The file could not be created.
https://cdnjs.cloudflare.com/ajax/libs/bootstrap-tour/0.6.1/css/bootstra... could not be saved to public://bootstrap-tour.min.css.
Warning: file_put_contents(temporary://fil8909.tmp): failed to open stream: "DrupalTemporaryStreamWrapper::stream_open" call failed in file_unmanaged_save_data() (line 1936 of C:\Users\taimoor\Sites\devdesktop\openatrium\includes\file.inc).
The file could not be created.
https://cdnjs.cloudflare.com/ajax/libs/bootstrap-tour/0.6.1/js/bootstrap... could not be saved to public://bootstrap-tour.js.

ugintl’s picture

OK solved. I created tmp file at site/default/files/tmp using sol #9

cprofessionals’s picture

I just had this error when I was importing a site into Acquia Desktop. I just went into the page addressed above (admin/config/media/file-system) and hit "save configuration". It must have reset permissions and such as part of the save function.

Rasheed Ridwan’s picture

Solution #4 and #5 worked fine for me

sirsmac’s picture

Answer #4 worked for me. Thanks

kirand’s picture

#3 worked for me

owenmck’s picture

Version: 7.25 » 10.0.x-dev

#9 worked for me (in localhost, development work situation).

If you're using a localhost built via docker (such as for a GovCMS installation) then

  1. Via your browser discover where your tmp file is (hint: it's declared in your web site's config page ~/admin/config/media/file-system, under the heading, "Public file system path"). You'll see a string such as sites/default/files
  2. At the command line get inside the "command-line" container, where you can use basic linux commands to ensure the above stated directory which holds this tmp file has W permissions e.g. chmod 777 ./sites/default/files
  3. That's it!
jghyde’s picture

Look at a phpInfo() and see what php believes is the /tmp dir. In my case, it was /var/lib/php74/tmp