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

Update from 2.3 to 2.4 breaks db password #341

Closed
olivierlambert opened this issue Jul 2, 2014 · 18 comments
Closed

Update from 2.3 to 2.4 breaks db password #341

olivierlambert opened this issue Jul 2, 2014 · 18 comments
Assignees
Labels
Bug For errors / faults / flaws / inconsistencies etc.

Comments

@olivierlambert
Copy link

Hi,

Just upgraded 2.3 to 2.4. Every previous upgrade were flawless.

But this time, it says that it can't connect to the database. I checked the config.php.ini: the db password had a "&" char, it was converted to its HTLM counterpart ("& amp;"). After fixing it, I reloaded the page, same error but this time, quote char (") were converted to "&quote;". After a second fix, it works fine.

Can't reproduce it now, because it works in production ^^

@mattab
Copy link
Member

mattab commented Jul 3, 2014

Maybe you are using the BotTracker plugin? someone reported the same issue when using this plugin.

@ways2web
Copy link

ways2web commented Jul 3, 2014

same problem. update from 2.3 to 2.4.
I used special-chars like ampersand.
From piwik 0.9 to 2.3, that was never a problem.

it was necessary to repair the config file manually.
i dont use BotTracker

@anonymous-matomo-user
Copy link

@ways2web thanks for report. maybe you use some other "non standard" plugin from the Marketplace? If not then it is for sure a bug in Piwik that we will fix.

@olivierlambert
Copy link
Author

I don't use any plugins (non-Core) on my installation.

@sdussaut
Copy link

sdussaut commented Jul 3, 2014

Same here while updating from 2.3.0 to 2.4.0. The DB password was altered in some way and I found special characters HTML escaped (& &quote;) that broke the whole update process.
I use a basic Piwik installation, no plugins at all.

@pmaziere
Copy link

pmaziere commented Jul 3, 2014

I have the same problem and it seems related to the SecurityInfo plugin that was not up to date (1.0.2 instead of 1.0.5). Now that I upgraded to 1.0.5, this & replacement issue in password did not happen again... for now

@luflow
Copy link

luflow commented Jul 3, 2014

Same problem for me...

May it be possible that the bug fix http://dev.piwik.org/trac/ticket/5349 leads to this error?

Because normally without INI_SCANNER_RAW the escaped ampersand would have been evaluated by php to a normal ampersand and everything would be fine?

But the more interesting question is: Why does the update process escape an ampersand to &?

@pmaziere
Copy link

pmaziere commented Jul 3, 2014

talked too fast, issue appeared again
I deactivated every plugin and here is how to reproduce:
1/ use db password containing a &
2/ activate a plugin
3/ KABOOM => the & in the password is modified to &

This problem started when upgrading from 2.3.x to 2.4.0

@mattab
Copy link
Member

mattab commented Jul 4, 2014

Thanks for the report! So far I cannot reproduce this issue yet.

  • What version of PHP are you using?

@mattab
Copy link
Member

mattab commented Jul 4, 2014

May it be possible that the bug fix http://dev.piwik.org/trac/ticket/5349 leads to this error

@krautnerds you're right it's likely this change that introduced the bug you're experiencing. I hope I can reproduce it soon in order to fix it!

@mattab
Copy link
Member

mattab commented Jul 4, 2014

After more investigation: it is expected that the characters are HTML encoded. When Piwik reads the config file the values should be HTML decoded.

It works for me locally but it seems many of you have an issue. Could someone please give me access to your Piwik server so I can reproduce there and try to understand why the values are not HTML decoded as they should be? (code)

@pmaziere
Copy link

pmaziere commented Jul 4, 2014

I use debian wheezy php 5.4.4-14+deb7u11
and sorry, but I can't give you access to my servers, but if you give me a roadmap, I might be of some help: just tell me where to put some hooks and I'll try to pinpoint the place where things go wrong

@scottnonnenberg
Copy link

+1 for a fix for this. Had an &, " and > in my password, and it didn't work. It was properly HTML encoded in the config file, but db connectivity didn't come back until I changed the password to one with no special characters.

@mattab
Copy link
Member

mattab commented Jul 6, 2014

what is your PHP version used?

@scottnonnenberg @pmaziere @krautnerds @sdussaut @ways2web @olivierlambert

If one of you can give us temporary access to the Piwik files, this would be appreciated to troubleshoot (email hello@piwik.org)

@olivierlambert
Copy link
Author

About my version of PHP: using Debian stable, so it's PHP 5.4.4-14+deb7u11

I'll check if I can give you an access.

@tsteur tsteur self-assigned this Jul 7, 2014
@tsteur
Copy link
Member

tsteur commented Jul 7, 2014

I can reproduce it on my "Ubuntu-precise" with "PHP 5.3.10-1ubuntu3.11 with Suhosin-Patch". Will debug it now

tsteur added a commit that referenced this issue Jul 7, 2014
…t it to an html entity to prevent it being interpreted as a PHP variable. This allows us to remove the RAW ini parser flag which causes trouble on some PHP versions as the parser seems to be buggy.
@tsteur
Copy link
Member

tsteur commented Jul 8, 2014

It was caused by INI_SCANNER_RAW indeed

@tsteur tsteur closed this as completed Jul 8, 2014
@olivierlambert
Copy link
Author

Thanks for the fix 👍

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.
Projects
None yet
Development

No branches or pull requests

9 participants