Question Saving Failed

Hello all,
I am getting Saving Failed error while saving the question in case of , if i add the column from the foreign key relation (referenced table ) . If i save the question with the base table without adding any foreign referenced column, i am able to save without any issue, but facing with after adding the column from the referenced table and below are the logs from the back end.

Deployed using Custom Jar
OS: Centos 8
Metabase version : 32.10

08-19 19:15:15 ERROR middleware.results-metadata :: Error recording results metadata for query:
java.sql.BatchUpdateException (conn=180) Incorrect string value: ‘\xE2\x86\x92 Fi…’ for column ‘result_metadata’ at row 1
(“org.mariadb.jdbc.MariaDbStatement.executeBatchExceptionEpilogue(MariaDbStatement.java:289)”
“org.mariadb.jdbc.MariaDbPreparedStatementClient.executeBatch(MariaDbPreparedStatementClient.java:306)”
“com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeBatch(NewProxyPreparedStatement.java:2544)”
“clojure.java.jdbc$execute_batch.invokeStatic(jdbc.clj:591)”
“clojure.java.jdbc$execute_batch.invoke(jdbc.clj:584)”
“clojure.java.jdbc$db_do_execute_prepared_statement$fn__13136.invoke(jdbc.clj:1039)”
“clojure.java.jdbc$db_transaction_STAR_.invokeStatic(jdbc.clj:799)”
“clojure.java.jdbc$db_transaction_STAR_.invoke(jdbc.clj:769)”
“clojure.java.jdbc$db_transaction_STAR_.invokeStatic(jdbc.clj:782)”
“clojure.java.jdbc$db_transaction_STAR_.invoke(jdbc.clj:769)”
“clojure.java.jdbc$db_do_execute_prepared_statement.invokeStatic(jdbc.clj:1038)”
“clojure.java.jdbc$db_do_execute_prepared_statement.invoke(jdbc.clj:1024)”
“clojure.java.jdbc$db_do_prepared.invokeStatic(jdbc.clj:1062)”
“clojure.java.jdbc$db_do_prepared.invoke(jdbc.clj:1042)”
“clojure.java.jdbc$execute_BANG_$execute_helper__13204.invoke(jdbc.clj:1446)”
“clojure.java.jdbc$execute_BANG_.invokeStatic(jdbc.clj:1450)”
“clojure.java.jdbc$execute_BANG_.invoke(jdbc.clj:1417)”
“toucan.db$execute_BANG_.invokeStatic(db.clj:411)”
“toucan.db$execute_BANG_.doInvoke(db.clj:406)”
“clojure.lang.RestFn.invoke(RestFn.java:410)”
“toucan.db$update_BANG_.invokeStatic(db.clj:466)”
“toucan.db$update_BANG_.invoke(db.clj:455)”
“toucan.db$update_BANG_.invokeStatic(db.clj:475)”
“toucan.db$update_BANG_.invoke(db.clj:455)”
“toucan.db$update_BANG_.invokeStatic(db.clj:483)”
“toucan.db$update_BANG_.doInvoke(db.clj:455)”
“clojure.lang.RestFn.invoke(RestFn.java:470)”
“–> query_processor.middleware.results_metadata$record_metadata_BANG_.invokeStatic(results_metadata.clj:23)”
“query_processor.middleware.results_metadata$record_metadata_BANG_.invoke(results_metadata.clj:21)”
“query_processor.middleware.results_metadata$record_and_return_metadata_BANG_$fn__42845.invoke(results_metadata.clj:97)”
“query_processor.middleware.format_rows$format_rows$fn__37028.invoke(format_rows.clj:26)”
“query_processor.middleware.add_dimension_projections$add_remapping$fn__33088.invoke(add_dimension_projections.clj:234)”
“query_processor.middleware.add_source_metadata$add_source_metadata_for_source_queries$fn__33776.invoke(add_source_metadata.clj:101)”
“query_processor.middleware.resolve_source_table$resolve_source_tables$fn__40126.invoke(resolve_source_table.clj:48)”
“query_processor.middleware.add_row_count_and_status$add_row_count_and_status$fn__33639.invoke(add_row_count_and_status.clj:16)”
“query_processor.middleware.driver_specific$process_query_in_context$fn__35805.invoke(driver_specific.clj:12)”
“query_processor.middleware.resolve_driver$resolve_driver$fn__39746.invoke(resolve_driver.clj:23)”
“query_processor.middleware.bind_effective_timezone$bind_effective_timezone$fn__34996$fn__34997.invoke(bind_effective_timezone.clj:9)”
“util.date$call_with_effective_timezone.invokeStatic(date.clj:88)”
“util.date$call_with_effective_timezone.invoke(date.clj:77)”
“query_processor.middleware.bind_effective_timezone$bind_effective_timezone$fn__34996.invoke(bind_effective_timezone.clj:8)”
“query_processor.middleware.store$initialize_store$fn__42870$fn__42871.invoke(store.clj:11)”
“query_processor.store$do_with_store.invokeStatic(store.clj:46)”
“query_processor.store$do_with_store.invoke(store.clj:40)”
“query_processor.middleware.store$initialize_store$fn__42870.invoke(store.clj:10)”
“query_processor.middleware.async$async__GT_sync$fn__19259.invoke(async.clj:23)”
“query_processor.middleware.async_wait$runnable$fn__34724.invoke(async_wait.clj:89)”)

Hi @sushant.naik
I cannot reproduce your issue with 0.32.10
That looks like a encoding problem with your MySQL/MariaDB metadata database.
Are you using utf8mb4 for collation everywhere? In this case, specifically report_card.result_metadata

Hello @flamber,
Thanks for the reply, now i have downgraded to 0.32.9 . i am able to save the question.
But need to check for the utf8mb4 in the collation variable name .

when i run this in Maria i am getting below results.

SHOW VARIABLES
WHERE Variable_name
LIKE 'character_set_%'
OR Variable_name LIKE ‘collation%’;

Variable_name Value
character_set_client utf8
character_set_connection utf8
character_set_database latin1
character_set_filesystem binary
character_set_results utf8
character_set_server latin1
character_set_system utf8
collation_connection utf8_general_ci
collation_database latin1_swedish_ci
collation_server latin1_swedish_ci

@sushant.naik
You should be using utf8mb4 everywhere. You also need to check charset/collation of the Metabase database/tables/columns.

I had this issue also, you can update all tables and columns with this procedure.
mysqldump -uusername-ppassword-c -e --default-character-set=utf8mb4 --single-transaction --skip-set-charset --add-drop-database -Bdatabase name> dump.sql
sed -i.bak -e 's/DEFAULT CHARACTER SET latin1/DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci/' -e 's/DEFAULT CHARSET=latin1/DEFAULT CHARSET=utf8mb4/' dump.sql
mysql -uusername-ppassword< dump.sql

@kelsen.faria

Thank you so much…:slight_smile: