Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Session SaveHandler DbTable - Fatal error: Exception thrown without a stack frame in Unknown on line 0 #2491

Closed
anonymous-matomo-user opened this issue Jun 19, 2011 · 39 comments
Labels
Bug For errors / faults / flaws / inconsistencies etc. Critical Indicates the severity of an issue is very critical and the issue has a very high priority.
Milestone

Comments

@anonymous-matomo-user
Copy link

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.

@sense-design
Copy link

Attachment: "Unable to start session." Screenshot
piwik-error-session.jpg

@sense-design
Copy link

Confirmed, getting the same error, see attached screen

@robocoder
Copy link
Contributor

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.

@robocoder
Copy link
Contributor

Temporary workaround:
In core/Session.php, change:

if(in_array($currentSaveHandler, array('user', 'mm', 'files')))

to:

if(in_array($currentSaveHandler, array('user', 'mm')))

@robocoder
Copy link
Contributor

(In [4941]) fixes #2491

  • couldn't reproduce it, but description matches ZF-7611, ZF-7171 - exception thrown
  • also, http://forum.piwik.org/read.php?5,78021 - ini_set disabled
  • quickly sanity tested on 5.1.3, 5.2.0, and 5.3.6

Note to self: there's a ZF1 memcache savehandler in ZF-10561

@robocoder
Copy link
Contributor

(In [4942]) refs #2491 - partial revert - ini_set is checked in testMinimumPhpVersion.php

@anonymous-matomo-user
Copy link
Author

After applying #4942 the problem still occurs.
On the other hand your previous mentioned workaround is working.

@sense-design
Copy link

I am getting the error "The requested website id = 1 couldn't be found" after applying the the patch (#2491) and #4941

@anonymous-matomo-user
Copy link
Author

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).

@sense-design
Copy link

Attachment: "The requested website id = 1 couldn't be found" Error
piwik-error-session-2.jpg

@mattab
Copy link
Member

mattab commented Jun 19, 2011

Reported by many users in http://forum.piwik.org/read.php?2,78026

@sense-design
Copy link

But until now nothing helped me to solve my issue

@mattab
Copy link
Member

mattab commented Jun 19, 2011

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?

@sense-design
Copy link

Applying all db updates manually finally did the trick and everything now seems to work fine

@anonymous-matomo-user
Copy link
Author

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:

  • Debian/squeeze
  • PHP 5.3.3-7+squeeze1 with Suhosin via fastcgi
  • APC as opcode cache

@robocoder
Copy link
Contributor

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.)

@anonymous-matomo-user
Copy link
Author

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.

@mattab
Copy link
Member

mattab commented Jun 20, 2011

There is a proposal fix in: #2499

To anyone experiencing the issue, would you mind trying the fix proposed in #2499 ?

@anonymous-matomo-user
Copy link
Author

Experienced the problem after 1.4 > 1.5 upgrade, and it was fixed by changing :

if(in_array($currentSaveHandler, array('user', 'mm', 'files')))

to:

if(in_array($currentSaveHandler, array('user', 'mm')))

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
Version 3.1.6

session
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

@anonymous-matomo-user
Copy link
Author

Got a report in the german forum (which I can't link here as akismet says that its spam ) that the changes in [4941] weren't enough but comment:3 fixed it.

@peterbo
Copy link
Contributor

peterbo commented Jun 22, 2011

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
    • 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.

@robocoder
Copy link
Contributor

(In [4950]) 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

@anonymous-matomo-user
Copy link
Author

Bug still appears with applied [4950].

@robocoder
Copy link
Contributor

Dunedan: Please also apply [4949], 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.

@anonymous-matomo-user
Copy link
Author

The bug still appears after applying [4949], disabling APC and restarting the fastcgi processes.
I think I'll stick with the workaround from comment 3 for now.

@robocoder
Copy link
Contributor

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

@robocoder
Copy link
Contributor

(In [4958]) refs #2491 - see ZF-11521

@robocoder
Copy link
Contributor

(In [4969]) refs #2491 - replace Zend_Session_SaveHandler_DbTable with a leaner and cleaner implementation

@robocoder
Copy link
Contributor

(In [4970]) 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.

@anonymous-matomo-user
Copy link
Author

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?

@peterbo
Copy link
Contributor

peterbo commented Jul 12, 2011

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.

@anonymous-matomo-user
Copy link
Author

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 trac@piwik.org, piwik-trac@piwik.org and piwik-trac-owner@piwik.org), apparently without success. To which e-mail address may I send the FTP data?

Thank you in advance for your help!

@mattab
Copy link
Member

mattab commented Jul 31, 2011

please send FTP details + bug reminder at matt att piwik thanks!

@anonymous-matomo-user
Copy link
Author

I got the same problem with piwik version 1.5 and 1.5.1. Did someone found a solution??

@robocoder
Copy link
Contributor

If you're still having a problem, try the latest nightly QA build at http://qa.piwik.org:8080/nightly/

@anonymous-matomo-user
Copy link
Author

I tried the QA build, but I am getting the error "The requested website id = 1 couldn't be found".

@anonymous-matomo-user
Copy link
Author

I got the same message.

@mattab
Copy link
Member

mattab commented Aug 10, 2011

To everybody who still experiences some issues with this ticket:

  • What version of Piwik are you using?
  • Do you get an error while upgrading to 1.5.1 automatically? try manual FTP upload all 1.5.1 files
  • What is the exact error message and where / when does it display?

Let's nail down the remaining issues that happen in 1.5.1, thank you for your reports

@mattab
Copy link
Member

mattab commented Nov 11, 2011

See the ticket for the same reason but different causes, in Piwik 1.6 #2717

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. Critical Indicates the severity of an issue is very critical and the issue has a very high priority.
Projects
None yet
Development

No branches or pull requests

5 participants