Website dropdown doesn't appear in 2.2

I saw a similar thread that perhaps this overflow thread may help to give some trouble shooting ideas. Perhaps one of the static files has some coding residue that needs to be omitted? I also am icluding a ajax ref that might give someone smarter than me a aha moment!

See comments below as well

Encoding is more than specifying the meta tag and content type - the files themselves must really be in the encoding you specify, or you’ll get mojibake.

Check that everything is using UTF-8, your database, database connection, table columns. Check that any static files you are including are also encoded in UTF-8.
share|improve this answer

answered May 20 '10 at 21:17
mdma
33.3k24282

Ok, I changed all my files including all the includes from ANSI to UTF-8. I looked at the database, but not sure I’m looking in right spot. The columns say under “COLLATION” “Latin1_swedish_ci” Not sure what this means though. How else can I check if the db tables/columns is utf-8? Also, after I saved all the files to utf-8 I now get an error stating “Cannot send session cache limiter - headers already sent” but I didn’t change any code other than saving the file as utf-8 and everything worked before I did this…not sure whats going on. Thanks for your help – Ronedog May 20 '10 at 23:10

Like the other comments are saying, this is to do with the byte order mark. See the other links from other posters, and also forum.mamboserver.com/showthread.php?t=42814 – mdma May 20 '10 at 23:21

Ok, I’ve read all those other posts. Basically they are saying there is a space or new line character either before the <?php or after the ?> tag. I’ve gone through all my code and all the includes and still get the same result. I even removed out every bit of code from the index.php page so it looked like this: <?php session_start(); ?>…no spaces anywhere before or after…no includes of other files that could affect it When I reload the page, I get same error message. HOWEVER, I decided to resave the index.php page as ANSI, and the error went away, but the encoding was no good??? – Ronedog May 21 '10 at 4:52

If you save index.php as UTF-8 and then open it up in a hex editor,you will see that there are indeed characters betore <?php - the byte order mark - it’s metadata and not shown in notepad/wordpad, but php has trouble with it. Use an editor that can save UTF-8 without the BOM and the problem will go away. – mdma May 21 '10 at 6:07

Thanks for your help…any idea on an editor? All I’ve ever used is notepad, notepad2, dreamweaver, wordpad. will any of these work? – Ronedog May 21 '10 at 14:28

Hello

To all of you who have this dropdown issue: can you please email thomas@piwik.org

and let him know:

  • clear description of the bug
  • Access to Piwik (URl, login, password)
  • if possible, FTP or SSH access to piwik files (so we can debug / troubleshoot)

Once few of you can send us this access we will be able to investigate and correct the issue. Thanks in advance!

Thanks Matt. I will have a word with my client to see how much access I can give to our version of piwik.

Alas my client says no to the permission, but hopefully someone else will … just trying the latest version 2.4 beta… you never know…

I also experienced the same thing

If you still experience this issue, please try with the latest 2.4.0 beta which is available as per instructions here: I would like to test early beta and RC releases, how do I enable automatic updates to use these development versions? - Analytics Platform - Matomo

After upgrading to 2.4.0 if you still have the issue please let me know here! We are really hoping to fix this problem for all of you!

Sorry Matt, dropdown not working with 2.4.0-b3 for myself… wondering if I can setup a mirrored version for Thomas to look at without violating security concerns of my client.

In fact the dropdown is slightly worse now, as before there was an option called ‘All Websites’ - and that has gone now. Only shows 1 website now out of the 469 websites on the system. However on the plus side, seems to load a lot faster, if can just resolve the dropdown problem it would be the best release yet.

Just tried clearing out the /tmp folder - only change is that the ‘All Websites’ link has returned, but other than that the same problem as before. On firefox/developer getting the same ajax error message as before when I click on the dropdown (and it calls for ajax data):

An attempt was made to declare a non-UTF-8 encoding for JSON retrieved using XMLHttpRequest. Only UTF-8 is supported for decoding JSON

May have found the problem - mod-security violation with rule 1234123440 - will confirm in just a second.

CONFIRMED - Matt the dropdown wasn’t working on my client’s server due to the following mod-security error been generated on ajax request…

Pattern match “\%(?![0-9a-fA-F]{2}|u[0-9a-fA-F]{4})” at ARGS:pattern. [file “/usr/local/apache/conf/modsec2.user.conf”] [line “20”] [id “1234123440”] [msg “URL Encoding Abuse Attack Attempt”] [severity “WARNING”]

[31/May/2014:12:13:29 --0400] U4n-qUIt@YIADWbyzkUAAAB1 86.112.15.155 35095 66.45.249.132 80
–74545369-B–
POST /piwik/index.php?date=2014-05-24,2014-05-30&format=JSON&idSite=1&method=SitesManager.getPatternMatchSites&;module=API&pattern=%25&period=range HTTP/1.1

If I temporary disable mod-security rule 1234123440 - then the dropdown instantly starts working again, but alas I cannot have it perm. disabled as it is a security concern, so would be better to have Piwik fixed to not produce these mod-security triggers… didn’t do this in version 2.1

Hope this helps.

@platinumshore unfortunately, we cannot change piwik to avoid the mod_security rules. So at this stage Piwik is not compatible with mod_security. this is discussed with links in this ticket: New system check to warn that Piwik is not compatible with mod_security · Issue #3371 · matomo-org/matomo · GitHub

we will add a system check to warn about mod_security. Maybe we could put in the FAQ the list of rules to add to mod_security, if users could help us come up with them?

Hope it helps,

Thanks Matt for the reply, obviously mistaken in my belief that it would be easy to fix the urls so Piwik would work again under the same mod-security settings as it did with Piwik version 2.1 (where the ajax url calls had no problem with mod-security on pattern part of url) - didn’t realise the urls have changed to much from version 2.1.

the URL haven’t changed, so maybe your mod_security config has changed?

Hi everyone,

I’ve had the same problem. In my case it was a pagespeed’s (apache module) fault. An extra line


ModPagespeedDisallow "*path_to_piwik*"

to pagespeed.conf file and the problem is gone.

Thanks for the awesome software!

@ignas Thanks for the tip !

We will add a FAQ for this problem, see ticket: Create FAQ to help troubleshoot the error "Failed to load HTML file" · Issue #5404 · matomo-org/matomo · GitHub

Hi Matt, as I said “under the same mod-security settings as it did with Piwik version 2.1” ie mod-security settings didn’t change between version 2.1 and 2.4 of piwik but I can confirm your urls for the dropdown did change from version 2.1 - on latest version this bit on the url is causing false positives “&pattern=%25” - shouldn’t take more than 5 minutes to fix, as fixed it on my own version, and it would potentially cut down a lot of thread responding.

Hope I have helped.

Yes we change a lot of things in Piwik all the time. can you show us your fix you applied ?