"value may be nil, or if non-nil, value must be a valid embedding params map

Here is the error we are getting when trying to update an existing question:

[96427a6f-88cb-462d-8a9b-748010664716] 2021-06-15T14:50:39-04:00 DEBUG metabase.server.middleware.log PUT /api/card/240 400 1.5 ms (0 DB calls)
{:errors {:embedding_params "value may be nil, or if non-nil, value must be a valid embedding params map."}}

we can create a new question, but having issue saving over existing.

0.39.2 is the version we have installed.

Hi @Toga
Please post "Diagnostic Info" from Admin > Troubleshooting.
So, if you create a new question and then refresh your browser and try to edit that question again, does that work?

"browser-info": {
"language": "en-US",
"platform": "MacIntel",
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.101 Safari/537.36",
"vendor": "Google Inc."
"system-info": {
"file.encoding": "UTF-8",
"java.runtime.name": "OpenJDK Runtime Environment",
"java.runtime.version": "11.0.11+9",
"java.vendor": "AdoptOpenJDK",
"java.vendor.url": "https://adoptopenjdk.net/",
"java.version": "11.0.11",
"java.vm.name": "OpenJDK 64-Bit Server VM",
"java.vm.version": "11.0.11+9",
"os.name": "Linux",
"os.version": "4.14.192-147.314.amzn2.x86_64",
"user.language": "en",
"user.timezone": "GMT"
"metabase-info": {
"databases": [
"hosting-env": "elastic-beanstalk",
"application-database": "postgres",
"application-database-details": {
"database": {
"name": "PostgreSQL",
"version": "12.5"
"jdbc-driver": {
"name": "PostgreSQL JDBC Driver",
"version": "42.2.18"
"run-mode": "prod",
"version": {
"date": "2021-04-27",
"tag": "v0.39.1",
"branch": "release-x.39.x",
"hash": "6beba48"
"settings": {
"report-timezone": "Canada/Eastern"

It did work, but it is no longer updating the new questions either.

@Toga Okay, so you're using 0.39.1, not 0.39.2, but I have not seen errors like this on either version.

Can you post the request data from the browser developer Network-tab for /api/card/240 ?
It might contain some sensitive information, but I'm mostly interested in what your browser is trying to send, which seems like the root problem.

When did this problem start? After an upgrade, which version?
Can you try the latest release, 0.39.3? https://github.com/metabase/metabase/releases/latest

I see request payload in Google Chrome.

"name":"WIP: Product Sales Report (Custom Tags, Connectors, and Upsellables)","dataset_query":{"database":4,"type":"native","native":{"query":"select\n`order`.create_dt as 'UTC Order Create Time',\nconvert_tz(`order`.create_dt, 'UTC', 'EST') as 'EST Order Create Time',\nconvert_tz(`payment`.complete_dt, 'UTC', 'EST') as 'EST Pay Time',\nconcat(`owner`.first_name, ' ', `owner`.last_name) as 'Full Name',\nowner.email as `Email`,\nconcat(`order`.id) as 'Order Number',\nconcat(`address`.civic, ' ', `address`.street) as 'Street Address',\n`address`.city_name as 'Address City',\n`address`.postal as 'Postal Code',\ndp_city_translation.name as \"DP City\",\nformat((`item`.product_amount + if(`info`.customization_amount is not null,`info`.customization_amount,0.00)), 2) as 'Item Price',\nif(`info`.id, 'Y', 'N') as 'Personalized',\nif(`item`.discount_amount > 0, concat('-',format(`item`.discount_amount, 2)), format(`item`.discount_amount, 2)) as 'Discount Amount',\n`discount`.code as 'Discount Code',\nformat(((`item`.product_amount + if(`info`.customization_amount is not null,`info`.customization_amount,0.00)) - `item`.discount_amount), 2) as 'Total After Discount',\nformat(`item`.tax_amount,2) as 'Tax on Item',\n`payment`.type as 'Payment Method',\nif (`product`.style is not null,`product`.style,`product`.id) as 'Product Identifier',\npt.long_name as 'Product',\ncase when dp_vendor_translation.short_name is null then 'Docupet - Online' else dp_vendor_translation.short_name end as 'Vendor',\ndp_administrator.name as 'Admin'\n\nfrom dp_order_item `item`\njoin dp_order_item_group `group` on `item`.order_item_group_id = `group`.id\njoin dp_order `order` on `group`.order_id = `order`.id\njoin dp_product `product` on `item`.product_id = `product`.id\njoin dp_product_translation pt on pt.translatable_id = `product`.id\njoin dp_pet_owner `owner` on `order`.pet_owner_id = `owner`.id\njoin dp_address `address` on `owner`.address_id = `address`.id\njoin dp_payment `payment` on `payment`.order_id = `order`.id\njoin dp_city `city` on `owner`.city_id = `city`.id\njoin dp_city_translation on dp_city_translation.translatable_id = `city`.id\nleft join dp_custom_tag_order_info `info` on `info`.order_item_id = `item`.id\nleft join dp_vendor `vendor` on `order`.vendor_id = `vendor`.id\nleft join dp_vendor_translation on dp_vendor_translation.translatable_id =`vendor`.id\nleft join dp_administrator on `order`.administrator_id = dp_administrator.id\nleft join dp_discount_code `discount` on `discount`.id = `order`.discount_id\n\nwhere true\nand (`product`.product_type in ('G', 'O') or (`product`.product_type = 'X' and upsellable = 1))\nand convert_tz(`payment`.complete_dt, 'UTC', 'EST') between {{ start }} and {{ end }}\n[[ and {{ city }} ]]\nand `payment`.type not in ('NP')\nand `payment`.status = 'A'\ngroup by `item`.id\norder by convert_tz(`payment`.complete_dt, 'UTC', 'EST') asc, `owner`.id asc, `product`.product_type asc","template-tags":{"start":{"id":"55d94d28-121d-6b68-9e2a-ac56fb3f75fa","name":"start","display-name":"Start","type":"date"},"end":{"id":"3716cd34-2ebf-2670-e0a4-6b1d3b009841","name":"end","display-name":"End","type":"date"},"city":{"id":"857286c9-f500-dfd0-5114-45ee7ca4db22","name":"city","display-name":"City","type":"dimension","dimension":["field",3679,null],"widget-type":"category"}}}},"display":"table","description":"test","visualization_settings":{"table.pivot_column":"tax_code","table.cell_column":"city_id","column_settings":{"[\"name\",\"totalIncoming\"]":{"column_title":"Total Before Discount"}}},"archived":false,"enable_embedding":false,"embedding_params":"NULL","collection_id":6,"collection_position":null}

sorry, I guess we just noticed it with 0.39.1.. i will see if i can get the newer version up.
i just tried saving an update to a new question, and it worked. this is making me pull my hair.

@Toga Okay, so your browser is sending "embedding_params": "NULL"
When it should be sending "embedding_params": null

And since you say that it now works, then I'm 95% sure that you are using some reverse-proxy that is modifying the requests. I have spend way too many days investigating the strangest behaviors caused by random CDNs, WAFs and other optimization reverse-proxies.
I can only recommend disabling them:

The null were actually NULL in the database, i switched them to actual null and it is working again! thank you

@Toga I have no idea how you have gotten into this state. Perhaps someone accidentally edited something incorrect in the application database. It's highly recommended not to manual edit the application database, since it's a great way of corrupting Metabase - use the API instead:

i think it happened when i moved the data from one server to another..

@Toga May I highly recommend using pg_dump or some other non-data-changing tool in the future:
I would actually advise you to do the move again, since I have no idea if some of your other metadata has been changed, which will then give you headaches in the future.