wallabag: 500 HTTP error adding a new article
Issue details
- Add => http://lamiradadelreplicante.com/2017/03/12/15-anos-de-arch-linux/
- Error happens;
500: Internal Server Error
An exception occurred while executing 'INSERT INTO `wallabag_entry` (uid, title, url, is_archived, is_starred, content, created_at, updated_at, mimetype, language, reading_time, domain_name, preview_picture, is_public, http_status, user_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' with params [null, "15 a\u00f1os de Arch Linux", "http:\/\/lamiradadelreplicante.com\/2017\/03\/12\/15-anos-de-arch-linux\/", 0, 0, "<section cl
...
o.jpg", null, 200, 1]: SQLSTATE[HY000]: General error: 1366 Incorrect string value: '\xF0\x9F\x98\x89</...' for column 'content' at row 1
Environment
- Wallabag 2.2.2
- Mysql 5.7.17
- PHP: 7.0.15
- wallabag_entry table encoding => utf8mb4_unicode_ci (not changed)
Update: I recently upgrade from 2.2.1 without problems. This is happening only in this article.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 19 (11 by maintainers)
I changed the mysql server configuration adding this:
Now the previous sql query retuns:
Now I can add the article correctly, but since this is not the default mysql server configuration I think you should add this in wallabag. This is the configuration used by mysql if you don’t add the encoding when you stablish the connection in PHP.
More info => https://mathiasbynens.be/notes/mysql-utf8mb4
For people like me who keep finding this thread because they get
General error: 1366when trying to add certain articles to a docker wallabag using mysql: firstly, make sure your mysql wallabag schema is set so thatcharacter_set_database = utf8mb4as above; and addSYMFONY__ENV__DATABASE_CHARSET=utf8mb4to your wallabag docker environment so that ansible builds the correct value in parameters.yml. This isn’t documented and took ages to find.