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

OVH: Update to 1.5.0 crashes #1243

Closed
symac opened this issue Sep 5, 2016 · 26 comments
Closed

OVH: Update to 1.5.0 crashes #1243

symac opened this issue Sep 5, 2016 · 26 comments
Assignees
Milestone

Comments

@symac
Copy link

symac commented Sep 5, 2016

Hello,
my freshrss install was 1.2.0, going to the check for update page I was offered to update to 1.4.0, everything went fine, then checking again for a new version I was offered the 1.5.0, I decided to run this second update and it crashed. I now get an error "### Fatal error! ### See logs files." and in the log files I can see an error saying "Access to database is denied for".

Looking at the latest CHANGELOG I can see that mysql 5.5.* is required, I am on an OVH shared hosting and according to my phpinfo() the "Client API version" for mysql is 5.1.73, I assume it might be the issue.

So my questions are :

  • is this a correct assumption regarding the issue, should I just revert the files on my server to 1.4.0 version ?
  • should not the update process check that the mysql version is ok and warn the user if not before breaking everything ?

Btw thanks for the great work, first time I encounter a breaking bug with Freshrss after all this time !

@Alkarex
Copy link
Member

Alkarex commented Sep 5, 2016

Hello,
If you get this error message, it is more probably a password problem for accessing your database.
During update from version 1.4.0, nothing should change regarding the database, and you should be able to run FreshRSS 1.5.0 even on older MySQL versions (MySQL 5.5.3 is from March 2010), as long as you do not attempt to read feeds that contain advanced Unicode such as emojis 💾 in the titles of their entries.
Indeed, we should add a version check for the database.

@symac
Copy link
Author

symac commented Sep 6, 2016

Hello,
giving the issue a second chance this morning I can confirm that 1.5.0 does not work on my OVH shared hosting for the moment. Trying a clean install I know the database connection is working fine as three tables *category *entry *feed have been created with the test prefix I have set for this clean install. But afterwards, the login page redirects me to an error on /p/i/

Will let you know if I can find anything.

@symac
Copy link
Author

symac commented Sep 6, 2016

Ok, I have now found the issue, related to the change regarding emojis I imagine, not only does it crash when you try to read feeds containing special characters as I have a clean install without any feed configured, but I have found that the change in ModelPDO.php was the origin of the crash.

According to phpmyadmin on my server the mysql version is 5.5.46-0+deb7u1-log so I believe it should be ok but there seems to be an issue with this specific encoding. I will stay with the 1.4.0 for the moment but it should be good to improve the prerequites checking at some point to prevent users from crashing their system while trying to update.

@Alkarex
Copy link
Member

Alkarex commented Sep 6, 2016

Thank you for testing. Do you have any error message?
There are two cases:

  • When making a clean install of 1.5.0, the charset utf8mb4 is used immediately. Did you have a chance of trying a clean install?
  • When updating from 1.4.0, we only update to utf8mb4 the first time it is needed (special Unicode characters detected).

@Alkarex
Copy link
Member

Alkarex commented Sep 6, 2016

Link to #1219

@symac
Copy link
Author

symac commented Sep 6, 2016

@Alkarex I did a clean install of 1.5.0, reached the end of the install process and the 3 tables are created but then, when I try to follow the link to open the app at the end of the install process (don't remember the name), I see the big blue button for a second, then am redirected to an error screen that just tell me there is a Fatal error and suggests to look the logs. I have found that changing back the two occurences of utf8mb4 in ModelPDO.php were fixing the issue.

The same happens when trying to run the upgrade fro 1.4 to 1.5, I have not tried to apply the same fix on this version but the error seems to be the same.

@Alkarex
Copy link
Member

Alkarex commented Sep 6, 2016

Ah indeed, I was wrong: utf8mb4 is of course needed immediately to open the connection. I will have to test whether utf8 could maybe be enough for the connexion itself.

@Alkarex
Copy link
Member

Alkarex commented Sep 6, 2016

But utf8mb4 should be available already from MySQL 5.5.3 https://dev.mysql.com/doc/refman/5.5/en/charset-unicode-utf8mb4.html so it is a bit strange that you are facing problems with a version 5.5.46

@Alkarex
Copy link
Member

Alkarex commented Sep 6, 2016

Could you please try to run a little test?

<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

$dbHost = 'localhost';
$dbName = 'freshrss';
$dbUser = 'freshrss';
$dbPassword = 'XXX';
$table = 'freshrss_alex_category';


header('Content-Type: text/plain;charset=UTF-8');

echo "PHP version:\t", PHP_VERSION, "\n";

$db = new PDO('mysql:host=' . $dbHost . ';dbname=' . $dbName . ';charset=utf8mb4',
                $dbUser,
                $dbPassword,
                array(
                    PDO::ATTR_EMULATE_PREPARES => false,
                    PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
                )
              );

echo "MySQL version:\t", $db->getAttribute(PDO::ATTR_SERVER_VERSION), "\n";

$stmt = $db->query('SELECT VERSION()');
$results = $stmt->fetchAll(PDO::FETCH_ASSOC);

print_r($results);

$stmt = $db->query('SELECT * FROM ' . $table);
$results = $stmt->fetchAll(PDO::FETCH_ASSOC);

print_r($results);

@symac
Copy link
Author

symac commented Sep 6, 2016

Sure :

PHP version:    5.5.37

<b>Fatal error</b>:  Uncaught exception 'PDOException' with message 'SQLSTATE[HY000] [2019] Can't initialize character set utf8mb4 (path: /usr/share/mysql/charsets/)' in /home/opensour/www/outils_perso/frssdev/test.php:25
Stack trace:
#0 /home/opensour/www/outils_perso/frssdev/test.php(25): PDO-&gt;__construct('mysql:host=mysq...', 'opensourdrup', 'XXXX', Array)
#1 {main}
  thrown in <b>/home/opensour/www/outils_perso/frssdev/test.php</b> on line <b>25</b><br />

@symac
Copy link
Author

symac commented Sep 6, 2016

i have noticed that using set names utf8mb4 seems to be ok, at least it doesn't return any error message, bug using it in the PDO init string will generate an error.

@Alkarex
Copy link
Member

Alkarex commented Sep 6, 2016

Ok, thanks. And when you use charset=utf8, what do you get an an output (in particular, the MySQL version)?

@symac
Copy link
Author

symac commented Sep 6, 2016

PHP version: 5.5.37
MySQL version: 5.5.46-0+deb7u1-log
Array
(
[0] => Array
(
[VERSION()] => 5.5.46-0+deb7u1-log
)

)
Array
(
[0] => Array
(
[id] => 1
[name] => Sans catégorie
)

)

@Alkarex
Copy link
Member

Alkarex commented Sep 6, 2016

Merci. So, now I need to find why utf8mb4 does not work on your instance, despite being > 5.5.3...
BWT, you can alternatively use SQLite...

@Alkarex
Copy link
Member

Alkarex commented Sep 6, 2016

Could you please try this new test?

<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

$dbHost = 'localhost';
$dbName = 'freshrss';
$dbUser = 'freshrss';
$dbPassword = 'XXX';
$table = 'freshrss_alex_category';


header('Content-Type: text/plain;charset=UTF-8');

echo "PHP version:\t", PHP_VERSION, "\n";

$db = new PDO('mysql:host=' . $dbHost . ';dbname=' . $dbName . ';charset=utf8',
                $dbUser,
                $dbPassword,
                array(
                    PDO::ATTR_EMULATE_PREPARES => false,
                    PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
                )
              );

echo "MySQL version:\t", $db->getAttribute(PDO::ATTR_SERVER_VERSION), "\n";

$stmt = $db->query('SELECT VERSION()');
$results = $stmt->fetchAll(PDO::FETCH_ASSOC);
print_r($results);

$stmt = $db->query("SELECT CHARACTER_SET_NAME AS cs FROM information_schema.CHARACTER_SETS WHERE CHARACTER_SET_NAME LIKE 'utf%'");
$results = $stmt->fetchAll(PDO::FETCH_ASSOC);
print_r($results);

$db = new PDO('mysql:host=' . $dbHost . ';dbname=' . $dbName . ';charset=utf8mb4',
                $dbUser,
                $dbPassword,
                array(
                    PDO::ATTR_EMULATE_PREPARES => false,
                    PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
                )
              );

$stmt = $db->query('SELECT * FROM ' . $table);
$results = $stmt->fetchAll(PDO::FETCH_ASSOC);
print_r($results);

Voir aussi (il semblerait que vous ayez une solution) :

@Alkarex Alkarex changed the title Update to 1.5.0 crashes OVH: Update to 1.5.0 crashes Sep 6, 2016
@Alkarex Alkarex added this to the 1.5.2-beta milestone Sep 6, 2016
@Alkarex Alkarex self-assigned this Sep 6, 2016
@symac
Copy link
Author

symac commented Sep 6, 2016

the utf8mb4 appears in the list but trying to use it as a charset still generates an error :

PHP version:    5.5.37
MySQL version:  5.5.46-0+deb7u1-log
Array
(
    [0] => Array
        (
            [VERSION()] => 5.5.46-0+deb7u1-log
        )

)
Array
(
    [0] => Array
        (
            [cs] => utf8
        )

    [1] => Array
        (
            [cs] => utf8mb4
        )

    [2] => Array
        (
            [cs] => utf16
        )

    [3] => Array
        (
            [cs] => utf32
        )

)
<br />
<b>Fatal error</b>:  Uncaught exception 'PDOException' with message 'SQLSTATE[HY000] [2019] Can't initialize character set utf8mb4 (path: /usr/share/mysql/charsets/)' in /home/opensour/www/outils_perso/frssdev/test.php:46
Stack trace:
#0 /home/opensour/www/outils_perso/frssdev/test.php(46): PDO-&gt;__construct('mysql:host=mysq...', 'XXXXX
#1 {main}

I will give a try to the different links suggested.

@Alkarex
Copy link
Member

Alkarex commented Oct 1, 2016

Anything new? Did it work when updating the OVH settings?

@Alkarex
Copy link
Member

Alkarex commented Oct 6, 2016

Feel free to re-open if needed.

@ghost
Copy link

ghost commented Oct 12, 2016

The same for me, after the update (one week ago), impossible to access my freshrss. When installing a new one, it cannot connect to the old mysql database. It's only working with sqlite but in this case i loose my feeds.
Mysql server : 5.1.73
Error message:
"Arf ! Vérifiez les informations d’accès à la base de données. : SQLSTATE[42000] [1115] Unknown character set: 'utf8mb4'"

@Alkarex
Copy link
Member

Alkarex commented Oct 12, 2016

@majoux OVH offers the possibility to upgrade to a newer MySQL version supporting utf8mb4. See the links a bit higher up #1243 (comment)
https://docs.ovh.com/fr/fr/web/hosting/modifier-lenvironnement-dexecution-de-mon-hebergement-web/

@Alkarex
Copy link
Member

Alkarex commented Oct 12, 2016

@majoux Please give a try to https://docs.ovh.com/fr/fr/web/hosting/modifier-lenvironnement-dexecution-de-mon-hebergement-web/ and let me know whether that helps.

@ghost
Copy link

ghost commented Oct 14, 2016

I'm not using ovh, I use a Debian Squeeze that's why mysql is so old.
My server is in production, I can't change the Debian version easily.

@Alkarex
Copy link
Member

Alkarex commented Oct 14, 2016

@majoux Ok. Debian Squeeze is not suited for production anymore as it has passed its end-of-life (February 2016). Concretely, if you cannot upgrade Debian (which seems to be needed anyway), the options are:

  • Use SQLite;
  • Stick to FreshRSS 1.4.
  • Do a little manual patch MySQL 5.1: Update to 1.5 crashes setup #1297 (comment) by replacing utf8mb4 by utf8 in the source code.
  • Make a manual update of MySQL to a newer version.
  • Give a try to PostgreSQL in FreshRSS 1.6 (I have not checked the minimal version of PostgreSQL)

@Alkarex
Copy link
Member

Alkarex commented Oct 14, 2016

For reference: #1153

@Alkarex
Copy link
Member

Alkarex commented Oct 22, 2016

@Alkarex
Copy link
Member

Alkarex commented Nov 12, 2016

@symac Un autre utilisateur a testé avec succès de passer l'environnement OVH de legacy à stable #1369 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants