[fixed in 1.1.1] Login broken after online-upgrade from 1.0 to 1.1

hi,

I’ve just updated from 1.0 to 1.1 by clicking on “upgrade”. All went good but I cannot relogin into the admin interface.

The browser shows these messages:

Warning: array_map() [function.array-map]: An error occurred while invoking the map callback in /var/www/vhosts/tracking.billiton.de/httpdocs/core/Log.php on line 176

Warning: array_map() [function.array-map]: An error occurred while invoking the map callback in /var/www/vhosts/tracking.billiton.de/httpdocs/core/Log.php on line 176

And at the login box there’s this message:

Error: Form security key is invalid or has expired. Please reload the form and check that your cookies are enabled.

I changed php.ini to “display_errors = off” – a phpinfo(); tells me it is active – but the array_map error messages still appear.

What can I do?

thanks
tvierfixb

small correction:

I get six of the warnings when trying to login with the right password. And the error message at the login box changes to:

Fehler: You must call Zend_Session::regenerateId() before any output has been sent to the browser; output started in /var/www/vhosts/tracking.billiton.de/httpdocs/core/Log.php/176

As I have seen there’s a french thread with the same problem.

hi,

i just got the same problem…
is there a fixing, or what do i need to do ?

Error:
Warning: array_map() [function.array-map]: An error occurred while invoking the map callback in /var/www/web1/html/loadstats/piwik1/core/Log.php on line 176

thx
uwi

Please apply this patch: http://dev.piwik.org/trac/changeset/3607
This issue only shows up on older versions of PHP and we didn’t see it during our tests, sorry about that!

hi,

thanx for the fix …
the error is gone, but still the login does not work. no error massage at all…
if i type a wrong password i get the msg tha login data is not correct …

any idea ??

thanx a lot
uwi

Hi,

after the same patch, i have the same problem. the login does not work.

OK, i got this while automatic upgrade 1.0 -> 1.1 Fortunately, i had a snapshot of the running mashine and switched back to the older state. Guys, Piwik is really great, but you need more testing before you release something. I already am afraid of Piwik updates as there were so many issues in the past with that…

Anyway, here is what i can hopefully contribute to help fix the problems:

User Warning: json_decode: error parsing ‘p’ at position 0 in /var/www/html/libs/upgradephp/upgrade.php on line 333

Backtrace -->
#0 Piwik_ErrorHandler(512, json_decode: error parsing ‘p’ at position 0, /var/www/html/libs/upgradephp/upgrade.php, 333, Array ([json] => piwikadmin,[assoc] => 1,[n] => 0,[state] => 0,[waitfor] => 0,[val] => ,[lang_eq] => Array ([true] => 1,[false] => ,[null] => ),[str_eq] => Array ([n] => ,[r] => ,[] => ,["] => ",[f] => \f,[b] => \b,[t] => ,[/] => /),[c] => p,[uu] => Array ()))#1 trigger_error(json_decode: error parsing ‘p’ at position 0, 512) called at [/var/www/html/libs/upgradephp/upgrade.php:333]#2 json_decode(piwikadmin, 1) called at [/var/www/html/core/Cookie.php:236]#3 Piwik_Cookie->loadContentFromCookie() called at [/var/www/html/core/Cookie.php:93]#4 Piwik_Cookie->__construct(piwik_auth, 0, ) called at [/var/www/html/plugins/Login/Login.php:90]#5 Piwik_Login->initAuthenticationObject(Piwik_Event_Notification Object ([_notificationName] => FrontController.initAuthenticationObject,[_notificationObject] => ,[_notificationInfo] => Array (),[_notificationState] => 0,[_notificationCount] => 0))#6 call_user_func_array(Array ([0] => Piwik_Login Object (),[1] => initAuthenticationObject), Array ([0] => Piwik_Event_Notification Object ([_notificationName] => FrontController.initAuthenticationObject,[_notificationObject] => ,[_notificationInfo] => Array (),[_notificationState] => 0,[_notificationCount] => 0))) called at [/var/www/html/libs/Event/Dispatcher.php:284]#7 Event_Dispatcher->postNotification(Piwik_Event_Notification Object ([_notificationName] => FrontController.initAuthenticationObject,[_notificationObject] => ,[_notificationInfo] => Array (),[_notificationState] => 0,[_notificationCount] => 0), 1, ) called at [/var/www/html/core/PluginsManager.php:531]#8 Piwik_PostEvent(FrontController.initAuthenticationObject) called at [/var/www/html/core/FrontController.php:233]#9 Piwik_FrontController->init() called at [/var/www/html/index.php:59]

and:

User Warning: json_decode: error parsing ‘a’ at position 1 in /var/www/html/libs/upgradephp/upgrade.php on line 333

Backtrace -->
#0 Piwik_ErrorHandler(512, json_decode: error parsing ‘a’ at position 1, /var/www/html/libs/upgradephp/upgrade.php, 333, Array ([json] => 4a4cd40b6413c584ca5675102f3fde46,[assoc] => 1,[n] => 1,[state] => 0,[waitfor] => 0,[val] => 4,[lang_eq] => Array ([true] => 1,[false] => ,[null] => ),[str_eq] => Array ([n] => ,[r] => ,[] => ,["] => ",[f] => \f,[b] => \b,[t] => ,[/] => /),[c] => a,[uu] => Array ()))#1 trigger_error(json_decode: error parsing ‘a’ at position 1, 512) called at [/var/www/html/libs/upgradephp/upgrade.php:333]#2 json_decode(4a4cd40b6413c584ca5675102f3fde46, 1) called at [/var/www/html/core/Cookie.php:236]#3 Piwik_Cookie->loadContentFromCookie() called at [/var/www/html/core/Cookie.php:93]#4 Piwik_Cookie->__construct(piwik_auth, 0, ) called at [/var/www/html/plugins/Login/Login.php:90]#5 Piwik_Login->initAuthenticationObject(Piwik_Event_Notification Object ([_notificationName] => FrontController.initAuthenticationObject,[_notificationObject] => ,[_notificationInfo] => Array (),[_notificationState] => 0,[_notificationCount] => 0))#6 call_user_func_array(Array ([0] => Piwik_Login Object (),[1] => initAuthenticationObject), Array ([0] => Piwik_Event_Notification Object ([_notificationName] => FrontController.initAuthenticationObject,[_notificationObject] => ,[_notificationInfo] => Array (),[_notificationState] => 0,[_notificationCount] => 0))) called at [/var/www/html/libs/Event/Dispatcher.php:284]#7 Event_Dispatcher->postNotification(Piwik_Event_Notification Object ([_notificationName] => FrontController.initAuthenticationObject,[_notificationObject] => ,[_notificationInfo] => Array (),[_notificationState] => 0,[_notificationCount] => 0), 1, ) called at [/var/www/html/core/PluginsManager.php:531]#8 Piwik_PostEvent(FrontController.initAuthenticationObject) called at [/var/www/html/core/FrontController.php:233]#9 Piwik_FrontController->init() called at [/var/www/html/index.php:59]

I have the same Problem after die Log-In.
If the new Version only works on PHP 5.3 you should tell us, before you tell us to update.
I hope that you will soon find a solution.

Anyway Piwik rocks! … Just the updates are ab BIT tricky and spoil a bit of the fun.

I 've got the same error after the upgrade and now I can’t to login. When I try it I receive this error:

You must call Zend_Session::regenerateId() before any output has been sent to the browser; output started in /var/www/httpdocs/mdb/piwik/libs/Zend/Log/Writer/Stream.php/130

The same for me – no warning any more, but no login possible.

There no error message at the login box any more. just no login.

same problem on my side, no login possible after Update from 1.0 to 1.1 - any ideas?

Olaf

after applying the patch:

  • wrong password/username says: “Error: Username & Password not correct”
  • right password/username says nothing and brings me back to the login

PHP 5.2

I see nothing in error_log

In “./plugins/Login/Controller.php” line 42 is a validate() that returns false…

            $form = new Piwik_Login_FormLogin();
            if($form->validate())
            {... never be here

Sorry for the inconvenience. There are some code paths that we have to test manually at the moment, and I’m sorry we didn’t catch these.

In core/Cookie.php, try changing line 236, prefixing the json_decode with @, eg


@json_decode

Hi all,

Can you please try to delete your cookies, and try again?

[ul]
[li] If you get errors on the screen, please copy paste the full error + backtrace
[/li][li] if you don’t see any error, check your web server error log and see if there is anything interesting in there and copy paste here
[/li][/ul]

Thanks

it works! Thanks

not for me :frowning: (php 5.2).

I did http://dev.piwik.org/trac/changeset/3607 and added the “@” (to suppress warnings) and removed the cookies and loaded the login box. After entering my login and klicking the button I am not logged in.

hi,

sorry, not working on my side …
php 5.2.0 and nothing in the error log.
i deleted cookies and even tested in different browsers …
any idea ?
or could you tell me how overwrite a session to be log-id be default …

thanx a lot
uwi2k2

Hi all

Same for me…

Login doesn’t work for me. The fixed above are done.
I’m on PHP 5.2.0.

On Piwik 1.0 it worked until now.

Regards,
Christian.

I did a little digging and the warnings/errors about array_map are just a symptom and not the source of the problem. The Logger tries to process the following event which can’t be handled by array_map.

Array ( [errno] => 2048 [message] => Non-static method Piwik_FrontController::dispatch() should not be called statically, assuming $this from incompatible context [errfile] => /var/www/sub/piwik/core/Controller.php [errline] => 434 [backtrace] => #0 Piwik_ErrorHandler(2048, Non-static method Piwik_FrontController::dispatch() should not be called statically, assuming $this from incompatible context, /var/www/sub/piwik/core/Controller.php, 434, Array ([moduleToRedirect] => CoreHome,[actionToRedirect] => index,[websiteId] => ,[defaultPeriod] => day,[defaultDate] => yesterday,[currentLogin] => )) called at [/var/www/sub/piwik/core/Controller.php:434] #1 Piwik_Controller->redirectToIndex(CoreHome, index) called at [/var/www/sub/piwik/plugins/CoreHome/Controller.php:41] #2 Piwik_CoreHome_Controller->redirectToCoreHomeIndex() #3 call_user_func_array(Array ([0] => Piwik_CoreHome_Controller Object ([] => CoreHome,[] => ,[] => ,[] => 0,[] => ),[1] => redirectToCoreHomeIndex), Array ()) called at [/var/www/sub/piwik/core/FrontController.php:125] #4 Piwik_FrontController->dispatch() called at [/var/www/sub/piwik/index.php:60] [timestamp] => 2011-01-04T12:23:21+00:00 )

short: function call as static to a non-static method. (Piwik_FrontController::dispatch()).

From what I understand there is no problem changing this method to static. But its a couple of years since i last coded something in php and today i took the first climpse in the piwik code, so everything after here might be wrong.

Changing the method to static prevents the error from happening: FrontController.php Line 68:

static function dispatch( $module = null, $action = null, $parameters = null)

From what i understand the following code maybe a better fix than that from matthieu because the method does exactly what is needed here, at least how i understand it.

return Piwik_Common::sanitizeInputValues($event);

But as i said i am no expert. But this still leaves us with the problem that the login is not working.

plugins/Login/Controller.php in login():
Like tvierb stated i also think that there is something wrong with the login form. validate() allways returns false, if hardcoding true in the if you get false at the nonce check. With a hardcoded true there also you get problems with the username/password check further down the road. The name and password seem to get read correctly from the form but somehow it screws up later in the auth process(Login.php initSession()). I never used Zend and i have to go back to work so i hope someone can take it from here.

But the good news is that it seems that you don’t lose any data, you just can’t access via the interface. The API still works and you can read the data from there.

cant login possible after Update from 1.0 to 1.1…