After the Update from Piwik 1.4 to Piwik 1.5 Piwik stopped working. When I try to login I get the message:
Fehler: Form security failed. Please reload the form and check that your cookies are enabled. If you use a proxy server, you must configure Piwik to accept the proxy header that forwards the Host header. Also, check that your Referer header is sent correctly.
and log fills up with:
Fatal error: Exception thrown without a stack frame in Unknown on line 0
Nothing changed at the setup which has been working before the update.
Attachment: "Unable to start session." Screenshot
Confirmed, getting the same error, see attached screen
We may need ftp access to your servers to insert debug code into Zend Framework. For 1.5, we actually simplified the Nonce and Session handling code in Piwik.
In core/Session.php, change:
if(in_array($currentSaveHandler, array('user', 'mm', 'files')))
if(in_array($currentSaveHandler, array('user', 'mm')))
(In ) fixes #2491
Note to self: there's a ZF1 memcache savehandler in ZF-10561
(In ) refs #2491 - partial revert - ini_set is checked in testMinimumPhpVersion.php
After applying #4942 the problem still occurs.
On the other hand your previous mentioned workaround is working.
I am getting the error "The requested website id = 1 couldn't be found" after applying the the patch (#2491) and #4941
Didn't realise this bug was already posted. I created a ticket on 2494 (could you please merge).
This is a bug and is recreatable (apparently by more than one person).
Attachment: "The requested website id = 1 couldn't be found" Error
Reported by many users in http://forum.piwik.org/read.php?2,78026
But until now nothing helped me to solve my issue
We have not been able to replicate so far. What versions of PHP are you using? can you upgrade to latest PHP and try again?
Applying all db updates manually finally did the trick and everything now seems to work fine
Ok, so I'll start with my setup.
First of all: I've no problem with the database upgrade nor with missing site-id 1. My only problem is the one described in the original post.
My setup is:
Anyone still having a problem must verify that there's a piwik_session table. If not, then the db update did not run, so you'll have to execute the SQL manually. (There's a race condition bug in the 1.4 update process.)
For my installation the piwik_session table already exists. So I assume the update went quite well (at least for me). But the problems seem to be independent from the existence of that table.
There is a proposal fix in: #2499
To anyone experiencing the issue, would you mind trying the fix proposed in #2499 ?
Experienced the problem after 1.4 > 1.5 upgrade, and it was fixed by changing :
if(in_array($currentSaveHandler, array('user', 'mm', 'files')))
here are parts of the phpinfo(), in case it can help :)
On another server (debian 5), the upgrade went fine.
PHP Version 5.2.10
Linux I############ 2.6.18-194.32.1.el5 #1 SMP Wed Jan 5 17:53:09 EST 2011 i686
PHP API 20041225
PHP Extension 20060613
Zend Extension 220060519
Configure Command './configure' '--build=i686-redhat-linux-gnu' '--host=i686-redhat-linux-gnu' '--target=i386-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../config.cache' '--with-libdir=lib' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--disable-debug' '--with-pic' '--disable-rpath' '--without-pear' '--with-bz2' '--with-curl' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-png' '--with-pspell' '--with-expat-dir=/usr' '--with-pcre-regex=/usr' '--with-zlib' '--with-layout=GNU' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--enable-wddx' '--with-kerberos' '--enable-ucd-snmp-hack' '--with-unixODBC=shared,/usr' '--enable-memory-limit' '--enable-shmop' '--enable-calendar' '--enable-dbx' '--enable-dio' '--without-mime-magic' '--without-sqlite' '--with-libxml-dir=/usr' '--with-xml' '--with-system-tzdata' '--with-apxs2=/usr/sbin/apxs' '--without-mysql' '--without-gd' '--without-odbc' '--disable-dom' '--disable-dba' '--without-unixODBC' '--disable-pdo' '--disable-xmlreader' '--disable-xmlwriter' '--disable-json'
Apache Version Apache/2.2.3 (CentOS)
Apache API Version 20051115
Loaded Modules core prefork http_core mod_so mod_auth_basic mod_auth_digest mod_authn_file mod_authn_alias mod_authn_anon mod_authn_dbm mod_authn_default mod_authz_host mod_authz_user mod_authz_owner mod_authz_groupfile mod_authz_dbm mod_authz_default util_ldap mod_authnz_ldap mod_include mod_log_config mod_logio mod_env mod_ext_filter mod_mime_magic mod_expires mod_deflate mod_headers mod_usertrack mod_setenvif mod_mime mod_status mod_autoindex mod_info mod_vhost_alias mod_negotiation mod_dir mod_actions mod_speling mod_userdir mod_alias mod_rewrite mod_proxy mod_proxy_balancer mod_proxy_ftp mod_proxy_http mod_proxy_connect mod_cache mod_suexec mod_disk_cache mod_file_cache mod_mem_cache mod_cgi mod_version mod_php5 mod_proxy_ajp
APC Support enabled
Session Support enabled
Registered save handlers files user
Registered serializer handlers php php_binary wddx
Directive Local Value Master Value
session.auto_start Off Off
session.bug_compat_42 Off Off
session.bug_compat_warn On On
session.cache_expire 180 180
session.cache_limiter nocache nocache
session.cookie_domain no value no value
session.cookie_httponly Off Off
session.cookie_lifetime 0 0
session.cookie_path / /
session.cookie_secure Off Off
session.entropy_file no value no value
session.entropy_length 0 0
session.gc_divisor 1000 1000
session.gc_maxlifetime 1440 1440
session.gc_probability 1 1
session.hash_bits_per_character 5 5
session.hash_function 0 0
session.name PHPSESSID PHPSESSID
session.referer_check no value no value
session.save_handler files files
session.save_path /var/lib/php/session /var/lib/php/session
session.serialize_handler php php
session.use_cookies On On
session.use_only_cookies Off Off
session.use_trans_sid 0 0
Got a report in the german forum (which I can't link here as akismet says that its spam ) that the changes in  weren't enough but comment:3 fixed it.
There are 3 cases (that I know) which can rise this weird "Exception thrown without a stack frame in Unknown on line 0" error:
1) an uncaught exception is thrown in the constructor or destructor of a class
2) something goes wrong while autoloading a class
3) - and I suppose, this is the case here, the customized Error- / Exception-Handler throws an unexpected Error / Exception by itself.
Since the ExceptionHandler is fully wrapped into try/catch, the ErrorHandler must be the problem here. We've fixed an potential error in #2499 (http://issues.piwik.org/attachments/2499/Refs_%232499.patch) that raises the "nesting level" error which could, in some cases, also produce the confusing error.
Ways to figure that out: Disable the custom Piwik Error/Exception Handler in index.php. Perhaps we well hopefully see the original error / exception then and can fix the issue with the error handler as well.
(In ) fixes #2491 - still can't reproduce (tested with/without Suhosin, across multiple PHP versions); calling Zend_Session::writeClose() multiple times is handled by Zend/Session.php
Bug still appears with applied .
Dunedan: Please also apply , try disabling APC and restarting the php fastcgi process. If you continue to have a problem, send us an email with host+ftp (or ssh) login/password, so we can take a look at your environment.
The bug still appears after applying , disabling APC and restarting the fastcgi processes.
I think I'll stick with the workaround from comment 3 for now.
Using the 'files' session.save_handler is now unsupported for the reasons given in #1279.
Upgrading to 5.3.4 or later should fix the problem for users who have the trunk patches, yet are still affected. There is a PHP build bug that depends on the extensions that are enabled at compile-time, which can cause session close + autoload to fail in in 5.2.x and 5.3.x. See bugs.php.net/bug.php?id=53141
(In ) refs #2491 - see ZF-11521
(In ) refs #2491 - replace Zend_Session_SaveHandler_DbTable with a leaner and cleaner implementation
(In ) refs #2491 - fix typo
The new savehandler uses the DB adapters that have already been well-tested in Piwik, instead of using Zend_DB_Table (as Zend_Db_Adapter_Mysqli isn't as well-supported as the PDO adapters in ZF).
Note: there's a MySQL-ism which we can address later in #1368.
Same probs as mentioned above. Now tried with 1.5.1, but I am getting as well "Fatal error: Exception thrown without a stack frame in Unknown on line 0" when opening piwik after update (same as for 1.5). I tried with several patches, but I get same results as mentioned.
I am using PHP 5.2.17 and I am not able to upgrade version (using a server of 1und1).
Now downgraded piwik to 1.4 again, which is working fine - which should not be the final solution I hope. Is there any possibility to use 1.5 and further updates with PHP 5.2?
Replying to webslave:
This is not specifically related to PHP 5.2.x versions. Maybe you can provide FTP / Piwik credentials to us so we can investigate the issue. I have not been able to reproduce this on any machine, and I don't know either if Anthon was able to reproduce.
I tried again to update, still getting the same error message. Could you please have a look?
Tried to send you my FTP & Piwik credentials by e-mail (to firstname.lastname@example.org, email@example.com and firstname.lastname@example.org), apparently without success. To which e-mail address may I send the FTP data?
Thank you in advance for your help!
please send FTP details + bug reminder at matt att piwik thanks!
I got the same problem with piwik version 1.5 and 1.5.1. Did someone found a solution??
If you're still having a problem, try the latest nightly QA build at http://qa.piwik.org:8080/nightly/
I tried the QA build, but I am getting the error "The requested website id = 1 couldn't be found".
I got the same message.
To everybody who still experiences some issues with this ticket:
Let's nail down the remaining issues that happen in 1.5.1, thank you for your reports
See the ticket for the same reason but different causes, in Piwik 1.6 #2717