jm163
June 10, 2024, 3:00pm
1
Get the following error when trying to edit and save a metabase question after latest update.
Created a question from a table to a collection, then go to question edit and try to save. get a failed on the button, this is same for duplicating question also .
DEBUG metabase.server.middleware.log POST /api/card 400 2.6 ms (0 DB calls)
{:errors {:dataset "nullable boolean"}, :specific-errors {:dataset ["should be a boolean, received: 0"]}}
{
"browser-info": {
"language": "en-GB",
"platform": "Win32",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36",
"vendor": "Google Inc."
},
"system-info": {
"file.encoding": "UTF-8",
"java.runtime.name": "OpenJDK Runtime Environment",
"java.runtime.version": "11.0.20+8-post-Debian-1deb10u1",
"java.vendor": "Debian",
"java.vendor.url": "https://tracker.debian.org/openjdk-11 ",
"java.version": "11.0.20",
"java.vm.name": "OpenJDK 64-Bit Server VM",
"java.vm.version": "11.0.20+8-post-Debian-1deb10u1",
"os.name": "Linux",
"os.version": "4.19.0-25-amd64",
"user.language": "en",
"user.timezone": "Europe/London"
},
"metabase-info": {
"databases": [
"mysql",
"redshift"
],
"hosting-env": "unknown",
"application-database": "mysql",
"application-database-details": {
"database": {
"name": "MariaDB",
"version": "10.3.39-MariaDB-0+deb10u1"
},
"jdbc-driver": {
"name": "MariaDB Connector/J",
"version": "2.7.10"
}
},
"run-mode": "prod",
"version": {
"date": "2024-05-28",
"tag": "v0.49.13",
"hash": "de28e83"
},
"settings": {
"report-timezone": null
}
}
}
TonyC
June 11, 2024, 12:48pm
2
Can you upgrade to 0.49.14, not sure if you are hitting this:
metabase:master
← SakuragiYoshimasa:fix-report-cart-dataset-boolean
opened 09:46AM - 29 May 24 UTC
Liquibase changed their boolean type in MySQL from `bit(1)` to
`tinyint(4)` in … version 4.25.1. Our JDBC driver does not recognize these
as booleans, so we converted them to `bit(1)`s.
As discussed [here](https://github.com/metabase/metabase/pull/36964), we
changed all existing `boolean` types that were in the
`001_update_migrations.yml` but not the SQL initialization file.
For new installations, this works: things in the SQL initialization file
get created with the `bit(1)` type.
However, for existing installations, there's a potential issue. Say I'm
on v42 and am upgrading to v49. In v43, a new `boolean` was added.
In this case, I'll get the `boolean` from the liquibase migration rather
than from the SQL initialization file, and it need to be changed to a
`bit(1)`.
I installed Metabase v41 with MySQL, migrated the database, and then
installed Metabase v49 and migrated again. I made a list of all the
columns that had the type `tinyint`:
```
mysql> SELECT TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME, COLUMN_TYPE, COLUMN_DEFAULT, IS_NULLABLE FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_TYPE = 'tinyint' AND TABLE_SCHEMA='metabase_test';
+---------------+------------------------------+-------------------+-------------+----------------+-------------+
| TABLE_SCHEMA | TABLE_NAME | COLUMN_NAME | COLUMN_TYPE | COLUMN_DEFAULT | IS_NULLABLE |
+---------------+------------------------------+-------------------+-------------+----------------+-------------+
| metabase_test | core_user | is_datasetnewb | tinyint | 1 | NO |
| metabase_test | metabase_field | database_required | tinyint | 0 | NO |
| metabase_test | metabase_fieldvalues | has_more_values | tinyint | 0 | YES |
| metabase_test | permissions_group_membership | is_group_manager | tinyint | 0 | NO |
| metabase_test | persisted_info | active | tinyint | 0 | NO |
| metabase_test | report_card | dataset | tinyint | 0 | NO |
| metabase_test | timeline | archived | tinyint | 0 | NO |
| metabase_test | timeline | default | tinyint | 0 | NO |
| metabase_test | timeline_event | archived | tinyint | 0 | NO |
| metabase_test | timeline_event | time_matters | tinyint | NULL | NO |
+---------------+------------------------------+-------------------+-------------+----------------+-------------+
10 rows in set (0.01 sec)
```
Then wrote migrations. For each column, we:
- turn it into a `bit(1)`,
- re-set the previously existing default value, and
- re-add the NOT NULL constraint, if applicable.
I (@johnswanson) didn't have to do this for `report_card.dataset` as @SakuragiYoshimasa had already done it for me - many thanks! When I was investigating why this had gotten missed originally, I uncovered the other columns that needed updating.
Closes https://github.com/metabase/metabase/issues/40600
jm163
June 11, 2024, 1:16pm
3
upgraded to 0.49.14 and still hitting this error
{:errors {:dataset "nullable boolean"}, :specific-errors {:dataset ["should be a boolean, received: 0"]}}
{
"browser-info": {
"language": "en-GB",
"platform": "Win32",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36",
"vendor": "Google Inc."
},
"system-info": {
"file.encoding": "UTF-8",
"java.runtime.name": "OpenJDK Runtime Environment",
"java.runtime.version": "11.0.20+8-post-Debian-1deb10u1",
"java.vendor": "Debian",
"java.vendor.url": "https://tracker.debian.org/openjdk-11 ",
"java.version": "11.0.20",
"java.vm.name": "OpenJDK 64-Bit Server VM",
"java.vm.version": "11.0.20+8-post-Debian-1deb10u1",
"os.name": "Linux",
"os.version": "4.19.0-25-amd64",
"user.language": "en",
"user.timezone": "Europe/London"
},
"metabase-info": {
"databases": [
"mysql",
"redshift"
],
"hosting-env": "unknown",
"application-database": "mysql",
"application-database-details": {
"database": {
"name": "MariaDB",
"version": "10.3.39-MariaDB-0+deb10u1"
},
"jdbc-driver": {
"name": "MariaDB Connector/J",
"version": "2.7.10"
}
},
"run-mode": "prod",
"version": {
"date": "2024-06-05",
"tag": "v0.49.14",
"hash": "3606ed3"
},
"settings": {
"report-timezone": null
}
}
}
TonyC
June 11, 2024, 1:18pm
4
my bad you need the 1.49.15 actually since the error is close to this one:
opened 07:45PM - 25 Mar 24 UTC
closed 07:55PM - 06 Jun 24 UTC
Type:Bug
Priority:P1
Organization/Collections
.Backend
.Regression
.Team/AdminWebapp
**Describe the bug**
Cannot duplicate a question
**Logs**
Error 400 card AP… I : should be a boolean, recebido: 0
PUT /api/card/310 400 1.9 ms (0 chamadas ao banco de dados)
{:errors {:collection_preview "nullable boolean"},
:specific-errors {:collection_preview ["should be a boolean, recebido: 1"]}}
**To Reproduce**
Steps to reproduce the behavior:
1. Go to Question
2. Click on Duplicate
3. Click in Duplicate
**Expected behavior**
Duplicate
**Screenshots**
![image](https://github.com/metabase/metabase/assets/3492068/698b2410-8069-4102-8702-f6774ffacef1)
**Severity**
It's very Hard because I copy many
**Additional context**
It happens if I change something and try to save as another question too.
**Metabase Diagnostic Info**
```json
{
"browser-info": {
"language": "en-US",
"platform": "Win32",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36",
"vendor": "Google Inc."
},
"system-info": {
"file.encoding": "UTF-8",
"java.runtime.name": "OpenJDK Runtime Environment",
"java.runtime.version": "11.0.22+7",
"java.vendor": "Eclipse Adoptium",
"java.vendor.url": "https://adoptium.net/",
"java.version": "11.0.22",
"java.vm.name": "OpenJDK 64-Bit Server VM",
"java.vm.version": "11.0.22+7",
"os.name": "Linux",
"os.version": "5.4.0-1111-azure",
"user.language": "en",
"user.timezone": "GMT"
},
"metabase-info": {
"databases": [
"h2",
"mysql",
"mongo"
],
"hosting-env": "unknown",
"application-database": "mysql",
"application-database-details": {
"database": {
"name": "MySQL",
"version": "8.0.32"
},
"jdbc-driver": {
"name": "MariaDB Connector/J",
"version": "2.7.10"
}
},
"run-mode": "prod",
"version": {
"date": "2024-03-21",
"tag": "v0.49.1",
"hash": "54ef5e9"
},
"settings": {
"report-timezone": null
}
}
}
```
did you upgraded recently?
jm163
June 11, 2024, 1:30pm
5
Yes that seems to be the bug, sorry couldn't find that when I looked before posting.
It was just about 2 weeks ago I updated from much older think 0.41 version to 0.49.14 so the bug you posted seems to be the issue from reading through. Will upgrade to 0.49.15 as soon as it releases with the bug fix.
Much appreciated for the help
jm163
June 12, 2024, 7:53am
6
Upgraded to 0.49.15 resolved the issue. many thanks
1 Like