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

Goals Overview widget: Zend_Session is currently marked as read-only. #7274

Closed
peterbo opened this issue Feb 23, 2015 · 40 comments
Closed

Goals Overview widget: Zend_Session is currently marked as read-only. #7274

peterbo opened this issue Feb 23, 2015 · 40 comments
Labels
Bug For errors / faults / flaws / inconsistencies etc. Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical.
Milestone

Comments

@peterbo
Copy link
Contributor

peterbo commented Feb 23, 2015

Session handling refactoring introduced an error in the goal widget: Goals Overview widget: Zend_Session is currently marked as read-only.

Reproduced in 2 different instances after updating to 2.11.1.

@peterbo peterbo added the Bug For errors / faults / flaws / inconsistencies etc. label Feb 23, 2015
@peterbo
Copy link
Contributor Author

peterbo commented Feb 23, 2015

In Piwik\Plugin\Controller, the method "setGeneralVariablesView" (called from Goals\Controller.php) tries to retrieve and reset the notifications in the session. This triggers the read-only session error.

@mattab mattab added this to the Piwik 2.12.0 milestone Feb 23, 2015
@SystemZ
Copy link

SystemZ commented Feb 23, 2015

I can confirm this "Goals Overview widget: Zend_Session is currently marked as read-only."

@dkulchenko
Copy link

+1, having this issue as well.

@mattab mattab added the Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical. label Feb 23, 2015
@mattab
Copy link
Member

mattab commented Feb 23, 2015

Hi guys, thanks for the report. Please comment if you experience the issue.

Btw have you configured the session to use DB sessions in the config.ini.php or do you maybe use the default "file" session?

@dkulchenko
Copy link

I've tried both ways, and am seeing the same error in either case.

@jcmeier
Copy link

jcmeier commented Feb 23, 2015

Hi there, I have this error too!

Kind regards
Jan

@Stelefanten
Copy link

Just upgraded. Same issue with Goals

@twpol
Copy link

twpol commented Feb 23, 2015

Same issue here, nothing else seems amiss - just the Goals Overview. Using the default file sessions.

@chihoko
Copy link

chihoko commented Feb 24, 2015

Same problem after upgrading to 2.11.1

@tsteur
Copy link
Member

tsteur commented Feb 24, 2015

This is most likely caused by https://github.com/piwik/piwik/pull/7252/files

Can you explain what you do step by step? Just opening Step By Step works fine here

@tsteur
Copy link
Member

tsteur commented Feb 24, 2015

@peterbo can you maybe check which notifications it wants to show?

Just comment the line with NotificationManager::cancelAllNonPersistent(); and / or do a var_export($view->notifications)

tsteur added a commit that referenced this issue Feb 24, 2015
Please do not directly merge. First I want to understand which notification it wants to trigger in Goals overview.

Haven't tested it!
@mattab mattab modified the milestones: Piwik 2.12.0, Piwik 2.11.2 Feb 24, 2015
@mnapoli
Copy link
Contributor

mnapoli commented Feb 24, 2015

Can reproduce by simply creating a new goal and adding the "Goals overview" widget on the dashboard. (nginx, php 5.6, file sessions)

capture d ecran 2015-02-24 a 16 24 16

Commenting NotificationManager::cancelAllNonPersistent(); in Piwik\Plugin\Controller:646 doesn't change anything. var_export($view->notifications) shows an empty array.

@jensmc
Copy link

jensmc commented Feb 24, 2015

Same here after updating to 2.11.1

@yepa74
Copy link

yepa74 commented Feb 24, 2015

Same issue after upgrading to 2.11.1

@robertccs
Copy link

+1

@peterbo
Copy link
Contributor Author

peterbo commented Feb 24, 2015

@tsteur $notifications is NULL, that's why it's running into the if clause. It is not trying to add a message, just to get all pending and then reset the notification stack. So both (or better all methods in /core/Notification/Manager.php) should check if the session is writeable.

if (empty($notifications)) {
   $view->notifications = NotificationManager::getAllNotificationsToDisplay(); //tries to sort the notifications by reference: uasort($notifications, function ($n1, $n2) []
   NotificationManager::cancelAllNonPersistent(); //Calls unset($session->notifications[$id]);
}

@HeiaSamaHi
Copy link

Same here after updating to 2.11.1

@peterkraume
Copy link

I can confirm this issue too.

@althaus
Copy link

althaus commented Feb 24, 2015

+1

@BeldarConehead
Copy link

Same problem here.

@ghost
Copy link

ghost commented Feb 24, 2015

same problem after Update...

@sgiehl
Copy link
Member

sgiehl commented Feb 24, 2015

Problem is imho that the NotificationManager always tries to write the session if no notifications are available. See https://github.com/piwik/piwik/blob/master/core/Notification/Manager.php#L134-L136
Maybe it would be better to check with !isset or !is_array at that point?

@sgiehl
Copy link
Member

sgiehl commented Feb 24, 2015

Just tested that on a local instance. It fixed the exception in the widget

@ghost
Copy link

ghost commented Feb 24, 2015

Hi sgiel: what needs to be done?

@sgiehl
Copy link
Member

sgiehl commented Feb 24, 2015

Checking with !isset instead of empty in the code part linked above. But I don't know if that has any other impact.

@fushnisoft
Copy link

After upgrade to 2.11.1 I see this on goals as described but also on Visits Overview widget (with or without graph).

image

@tsteur
Copy link
Member

tsteur commented Feb 24, 2015

thanks @sgiehl that's it! Didn't see it would always try to write something there.

I fixed it in #7283

If anyone wants to fix it just replace content of the file core/Notification/Manager.php with this content: https://raw.githubusercontent.com/piwik/piwik/3699f22e0410b39ff4bcb2cafdf2f38e0669b146/core/Notification/Manager.php

@DrTyrell
Copy link

@tsteur +1, fixed it for me, thanks.

@SystemZ
Copy link

SystemZ commented Feb 24, 2015

@tsteur +1, works for me too :)

@BeldarConehead
Copy link

Worked for me as well.

@HeiaSamaHi
Copy link

perfect!

@KevinNash
Copy link

Perfect fix for me too 👍

@jcmeier
Copy link

jcmeier commented Feb 25, 2015

Fixed it for me!

@ghost
Copy link

ghost commented Feb 25, 2015

thanks, it work fine.

@Trance-Man
Copy link

Had same problem below info worked for me as well...

== QUOTE ==
If anyone wants to fix it just replace content of the file core/Notification/Manager.php with this content: https://raw.githubusercontent.com/piwik/piwik/7274/core/Notification/Manager.php
== END QUOTE ==

@tobybaier
Copy link

thanks for fixing, looking forward to the next release :)

@mattab
Copy link
Member

mattab commented Mar 2, 2015

fixed in #7283

@mattab mattab closed this as completed Mar 2, 2015
@lksnmnn
Copy link

lksnmnn commented Mar 3, 2015

Can you guys reupload the fixed version of Manager.php ? (or provide a working link)
I only see "not found".

Thanks ! 👍

@tsteur
Copy link
Member

tsteur commented Mar 3, 2015

Sure, thx for letting us know. I updated the link in previous comment: https://raw.githubusercontent.com/piwik/piwik/3699f22e0410b39ff4bcb2cafdf2f38e0669b146/core/Notification/Manager.php

@mattab
Copy link
Member

mattab commented Mar 3, 2015

Btw to get the fix, it's recommended to use the latest beta which includes several fixes: http://piwik.org/faq/how-to-update/faq_159/

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. Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical.
Projects
None yet
Development

No branches or pull requests