Jump to content

"Cannot open source device" error


verdeandrea
 Share

Recommended Posts

Hello girls and guys,

i moved a PW project to a new server and now i get this error: 
Uncaught Exception: Cannot open source device in .../wire/core/Session.php:267 

I updated PW to the last stable version 3.0.98 but i still get the same error. The site is working on localhost and on another server, so i suspect can be something related to the server settings or php.

Here is the full error 

Error: Uncaught Exception: Cannot open source device in .../wire/core/Session.php:267
Stack trace:
#0 .../wire/core/Session.php(267): session_start()
#1 .../wire/core/Wire.php(380): ProcessWire\Session->___init()
#2 .../wire/core/WireHooks.php(723): ProcessWire\Wire->_callMethod('___init', Array)
#3 .../wire/core/Wire.php(442): ProcessWire\WireHooks->runHooks(Object(ProcessWire\Session), 'init', Array)
#4 .../wire/core/Session.php(166): ProcessWire\Wire->__call('init', Array)
#5 .../wire/core/ProcessWire.php(432): ProcessWire\Session->__construct(Object(ProcessWire\ProcessWire))
#6 .../wire/core/ProcessWire.php(209): ProcessWire\ProcessWire->load(Object(ProcessWire\Config))
#7 .../index.php(52): Pr (line 267 of .../wire/core/Session.php) 

This error message was shown because: site is in debug mode. ($config->debug = true; => /site/config.php). Error has been logged.

I'm printing phpinfo hoping that can help.

Any idea on how to solve this?

Thanks

Link to comment
Share on other sites

6 hours ago, verdeandrea said:

i moved a PW project to a new server and now i get this error: 
Uncaught Exception: Cannot open source device in .../wire/core/Session.php:267 

This error is caused by PHP being unable to reach a source of randomness to generate random numbers (like, in this case, session IDs). The exact cause can vary, ranging from missing read access to /dev/urandom (check if it is included in php.ini's open_basedir if that restriction is configured) over too old PHP versions to improperly set up chroot jails (e.g. missing to include /dev/urandom) and probably some scenarios I can't think of off the top of my head.

  • Like 3
Link to comment
Share on other sites

6 hours ago, PWaddict said:

When you moved the files on the server did you also moved the folders cache, logs & sessions from site/assets/ ? If yes then I suggest you to DELETE those folders. This could be the problem.

Thanks @PWaddict, yes i already did that, but it didn't help

Thanks @BitPoet. The PHP version is 7.1.10, so a very recent one. And from phpinfo, for open_basedir i can read 

open_basedir no value no value

Should i ask my server admins to change something? Thank you.

Link to comment
Share on other sites

8 hours ago, verdeandrea said:

Should i ask my server admins to change something?

Contacting them about the problem is never a bad idea. Even if it's something you can change yourself, they'll likely be able to give you pointers where to look.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...