Unable to start session. error message on a fresh 1.6 install

Hi all,
Wanted to play a bit with piwik but i get an “Unable to start session.” error message on a fresh 1.6 install. I saw there might be an issue with tmp/sessions write permissions but this is apparently not enough. Could anyone help me fix this please ?
Thanks

When i set $GLOBALS[‘PIWIK_TRACKER_DEBUG’] to true, I get the following


General_ExceptionConfigurationFileNotFound
And this exception raised another exception "No entry is registered for key 'logger_exception'"

It appears that I have to create the config file by hand but this would be wrong according to the doc in config.ini.php.sample that says:

; the config.ini.php is normally created during the installation process

your config and tmp folders need to be writeable by the web server

Unfortunately, both are already writeable:


ls -al
total 88
drwxr-xr-x 12 www-data www-data  4096 Jan 20 11:37 .
drwxr-x--- 14 www-data www-data  4096 Jan 20 10:39 ..
-rw-r--r--  1 www-data www-data  6003 Oct 13 09:50 LEGALNOTICE
-rw-r--r--  1 www-data www-data  1724 Feb 11  2011 README
drwxrwxrwx  2 www-data www-data  4096 Jan 20 12:13 config
drwxr-xr-x 21 www-data www-data  4096 Oct 18 08:27 core
-rw-r--r--  1 www-data www-data  1596 May 22  2011 index.php
drwxr-xr-x  2 www-data www-data  4096 Oct 18 08:27 js
drwxr-xr-x  2 www-data www-data  4096 Oct 18 08:27 lang
drwxr-xr-x 20 www-data www-data  4096 Oct 18 08:27 libs
drwxr-xr-x  4 www-data www-data  4096 Oct 18 08:27 misc
-rw-r--r--  1 www-data www-data 18936 Oct 18 08:12 piwik.js
-rw-r--r--  1 www-data www-data  2916 Jan 20 11:56 piwik.php
drwxr-xr-x 43 www-data www-data  4096 Oct 18 08:27 plugins
drwxr-xr-x  2 www-data www-data  4096 Oct 18 08:27 tests
drwxr-xr-x  3 www-data www-data  4096 Oct 18 08:27 themes
drwxrwxrwx  6 www-data www-data  4096 Jan 20 11:26 tmp

your tmp/assets, tmp/cache, tmp/sessions, tmp/latest, tmp/tcpdf, and tmp/templates_c folders also needs to be writeable by the server

Thanks for your help, here is the content of the tmp dir: do I need to create the ones you mentioned that are not present ?


ls -al tmp/
total 24
drwxrwxrwx  6 www-data www-data 4096 Jan 20 11:26 .
drwxr-xr-x 12 www-data www-data 4096 Jan 20 11:37 ..
drwxrwxrwx  2 www-data www-data 4096 Jan 20 11:26 assets
drwxrwxrwx  2 www-data www-data 4096 Jan 20 11:26 cache
drwxrwxrwx  2 www-data www-data 4096 Jan 20 11:26 sessions
drwxrwxrwx  2 www-data www-data 4096 Jan 20 11:26 templates_c

it’s up to you:

tmp/latest - for automated updates

tmp/tcpdf - for pdf reports

if you manually created config/config.ini.php, you should remove it

then navigate to the index.php file in your browser to restart the install

I still have:

/index.php


Unable to start session.

/piwik.php


General_ExceptionConfigurationFileNotFound
And this exception raised another exception "No entry is registered for key 'logger_exception'"

Please update to Piwik 1.7 RC which has bug fixes related to this issue: 301 Moved Permanently

Hello matt, thanks for your answer,
I now get the following error message:


Error: Unable to start session. Please check that the web server has enough permission to write to these files/directories:
For example, on a Linux server if your Apache httpd user is www-data, you can try to execute:
chown -R www-data:www-data /xxx/tmp/sessions/
chmod -R 0755 /xxx/tmp/sessions/

Debug: the original error was 
session has already been started by session.auto-start or session_start()

The tmp directory is all writable by the web server user:


ls -al tmp/
total 28
drwxrwxrwx  7 www-data www-data 4096 Jan 25 11:35 .
drwxr-xr-x 12 www-data www-data 4096 Jan 25 11:35 ..
drwxrwxrwx  2 www-data www-data 4096 Jan 25 11:35 assets
drwxrwxrwx  2 www-data www-data 4096 Jan 25 11:35 cache
drwxrwxrwx  2 www-data www-data 4096 Jan 25 11:35 sessions
drwxrwxrwx  2 www-data www-data 4096 Jan 25 11:35 tcpdf
drwxrwxrwx  2 www-data www-data 4096 Jan 25 11:35 templates_c

Any clue on where the error can come from ?
Thanks a lot, really looking forward to using piwik …

Set session.auto_start = Off in php.ini

vipsoft, thanks a lot ! that helped.
Glad I can now discover piwik.

Hello!

I have a very similar problem. But the error message goes like this:


Debug: the original error was 
Zend_Session::start() - /mnt/web6/51/40/5298840/htdocs/stats/libs/Zend/Session.php(Line:469): Error #2 session_start() [function.session-start]: open(/mnt/web6/51/40/5298840/htdocs/stats/tmp/sessions/sess_9ta4crj723o9m5sfrni91tgn54, O_RDWR) failed: Permission denied (13) Array
/mnt/web6/51/40/5298840/htdocs/stats/libs/Zend/Session.php(Line:479): Error #2 session_write_close() [function.session-write-close]: open(/mnt/web6/51/40/5298840/htdocs/stats/tmp/sessions/sess_9ta4crj723o9m5sfrni91tgn54, O_RDWR) failed: Permission denied (13) Array
/mnt/web6/51/40/5298840/htdocs/stats/libs/Zend/Session.php(Line:479): Error #2 session_write_close() [function.session-write-close]: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/mnt/web6/51/40/5298840/htdocs/stats/tmp/sessions) Arra

Does somebody has a clue?

failed: Permission denied

give permission CHMOD 777 on piwik/tmp/sessions folder

^THIS!!! - I have been pulling my hair trying to figure out why the login failed once switched to database-backed sessions (which was needed for a multi-machine setup). For future reference/search, I had this error (PHP 5.5, Piwik 2.3.0):

WARN Piwik\Session[2014-06-11 14:23:42] [00edc] Unable to start session: Zend_Session::start() - /var/www/sites/piwik/libs/Zend/Session.php(Line:469): Error #2 session_start(): Cannot find save handler ‘dbtable’ - session startup failed Array

Thanks for the report! I’ve added a new system check entry to alert you in case the setting session.auto_start is set to 1: New system check to alert user when session.auto_start = 1 · Issue #5344 · matomo-org/matomo · GitHub