Bug : ActiveRecord::StatementInvalid: Mysql2::Error: Incorrect string value:

I got lots of error like this one and I can’t get these people posts as a result.

WARN PID-29102 TID-69992700354980 Sidekiq: DiasporaFederation::Federation::Fetcher::NotFetchable: Failed to fetch Post:029cde0014dd01360155047d7b62795e from eileen@despora.de: DiasporaFederation::Federation::Fetcher::NotFetchable: Failed to fetch Post:0aba3a4014d90136cd390242ac110006 from schestowitz@joindiaspora.com: DiasporaFederation::Discovery::DiscoveryError: Failed discovery for schestowitz@joindiaspora.com: ActiveRecord::StatementInvalid: Mysql2::Error: Incorrect string value: ‘\xE7\xBD\x97\xE4\xBC\x8A…’ for column ‘first_name’ at row 1: INSERT INTO profiles (first_name, image_url, image_url_small, image_url_medium, person_id, created_at, updated_at, full_name) VALUES (‘Dr. Roy Schestowitz (罗伊)’, ‘https://joindiaspora.com/uploads/images/thumb_large_856dd9cc430d2e29660f.jpeg’, ‘https://joindiaspora.com/uploads/images/thumb_small_856dd9cc430d2e29660f.jpeg’, ‘https://joindiaspora.com/uploads/images/thumb_medium_856dd9cc430d2e29660f.jpeg’, 68200, ‘2018-03-28 22:35:11’, ‘2018-03-28 22:35:11’, ‘dr. roy schestowitz (罗伊)’)

I suspect an encoding issue , maybe some table are not set to utf-8 encoding.

| profiles | CREATE TABLEprofiles(idint(11) NOT NULL AUTO_INCREMENT,diaspora_handlevarchar(255) DEFAULT NULL,first_namevarchar(127) DEFAULT NULL,last_namevarchar(127) DEFAULT NULL,image_urlvarchar(255) DEFAULT NULL,image_url_smallvarchar(255) DEFAULT NULL,image_url_mediumvarchar(255) DEFAULT NULL,birthdaydate DEFAULT NULL,gendervarchar(255) DEFAULT NULL,biotext,searchabletinyint(1) NOT NULL DEFAULT '1',person_idint(11) NOT NULL,created_atdatetime NOT NULL,updated_atdatetime NOT NULL,locationvarchar(255) DEFAULT NULL,full_namevarchar(70) DEFAULT NULL,nsfwtinyint(1) DEFAULT '0',public_detailstinyint(1) DEFAULT '0', PRIMARY KEY (id), KEYindex_profiles_on_full_name_and_searchable(full_name,searchable), KEYindex_profiles_on_full_name(full_name), KEYindex_profiles_on_person_id(person_id), CONSTRAINTprofiles_person_id_fkFOREIGN KEY (person_id) REFERENCESpeople(id) ON DELETE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=49153 DEFAULT CHARSET=latin1

yep it was utf-8… problem fixed as follow

mysqldump  --add-drop-table -u root --password='pwd' diaspora_production | sed -e 's/CHARSET\=latin1/CHARSET\=utf8\ COLLATE\=utf8_general_ci/g' | iconv -f latin1 -t utf8 | mysql -u root --password='pwd' diaspora_production

shutdown service and make a db backup before…

this is a dev issue, the scheme is setup by diaspora-common, I didn’t check who maintain the package if he/she comes to visit discourse but if you know, tell him/her

Well, there are reasons why the package is not an official installation method… :wink: Also, the maintainer of that package is not on Discourse, so please file a bug report in Debians bug tracker. https://bugs.debian.org/cgi-bin/pkgreport.cgi?package=diaspora-common

actually the fix partially solved the problem. French characters are broken now in the posts and profiles. I suspect there is a bug with character encoding generally… Has anyone else seen this error on non package install base ? I didn’t dig in the code yet, I am new to diaspora architecture, maybe there is a problem with the frontend… Nowadays it is best to use UTF-8 everywhere …

Once again: The debian package is unsupported. We are not able to provide support. Ask the maintainers of that package. If the collation is wrong on one table, it’s probably wrong on all tables. Changing the collation without manually converting the data is probably almost impossible, so good luck with that. A google search may help, I’m sure this is not a new issues. Otherwiese, the Debian maintainers can probably help you out, as they have to figure out a solution anyway, if that’s an issue in their default distribution.

Unsupported installation method.