Unable to save questions

Hi everyone!

We are on a hurry with a huge problem in Metabase. We have upgrade the version to 33.6, and we were not able to save questions with joins, and we still are not able to save in 33.4. Can anyone help?
The database is PostgreSQL and the enconding is utf8, however, the sample data is not working neither.

I have been checking the following posts:

Also: INFO metabase.api.card Card results metadata passed in to API is MISSING. Running query to fetch correct metadata.

bug2

Hi @alejandrorial
Please post Diagnostic Info from Admin > Troubleshooting.
Are you using a CDN or WAF on your domain, like Cloudflare, Cloudfront or another proxy?

Just for reference, since we cannot search images:
Unexpected token u in JSON at position 0 and Cannot read property 'type' of undefined

Solved with the change of uncoding in MySQL. Thanks a lot!

1 Like

Just for reference for others - this is how you check and convert to utf8mb4:
https://github.com/metabase/metabase/issues/10691 - upvote by clicking :+1: on the first post

2 Likes

Did it! My problem is different now but it is still the unavailability of saving questions with multiple joins in some cases, should we discuss here?

I retrieve the data and then I save the question:

el valor puede ser nulo, o si no es nulo, value must be an array of valid results column metadata maps
Request entities,questions,create failed:
The operation triggered by click in ButtonWithStatus failed
Uncaught (in promise)

@alejandrorial
Post the Diagnostic Info from Admin > Troubleshooting.
Is any of the tables you’re joining empty (meaning doesn’t have any data in them)?
Or is the result empty of the question, which you are trying to save?

Just for searchability, this is the error in English:
value may be nil, or if non-nil, value must be an array of valid results column metadata maps

There is error about numeric fields.

Moreover, the final log is when I press Save in the query.

[11c5e64e-ce59-48f8-850a-4c16f243f3f5] 2019-11-28T19:25:20+01:00 ERROR metabase.sync.util Error generating fingerprint for Field 'min_gap': Index -1 out of bounds for length 2
("java.base/jdk.internal.util.Preconditions.outOfBounds(Unknown Source)"
"java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Unknown Source)"
"java.base/jdk.internal.util.Preconditions.checkIndex(Unknown Source)"
"java.base/java.util.Objects.checkIndex(Unknown Source)"
"java.base/java.util.ArrayList.get(Unknown Source)"
"com.bigml.histogram.ArrayBinReservoir.merge(ArrayBinReservoir.java:128)"
"com.bigml.histogram.Histogram.merge(Histogram.java:524)"
"bigml.histogram.core$merge_BANG_.invokeStatic(core.clj:203)"
"bigml.histogram.core$merge_BANG_.invoke(core.clj:200)"
"bigml.histogram.core$mean.invokeStatic(core.clj:324)"
"bigml.histogram.core$mean.invoke(core.clj:320)"
"--> sync.analyze.fingerprint.fingerprinters$fn__44004$fn__44005.invoke(fingerprinters.clj:189)"
"sync.analyze.fingerprint.fingerprinters$with_error_handling$fn__43953$fn__43956.invoke(fingerprinters.clj:116)"
"sync.util$do_with_error_handling.invokeStatic(util.clj:149)"
"sync.util$do_with_error_handling.invoke(util.clj:144)"
"sync.analyze.fingerprint.fingerprinters$with_error_handling$fn__43953.invoke(fingerprinters.clj:116)"
"sync.analyze.fingerprint.fingerprinters$col_wise$fn__43916$fn__43919.invoke(fingerprinters.clj:26)"
"sync.analyze.fingerprint.fingerprinters$col_wise$fn__43916.invoke(fingerprinters.clj:26)"
"sync.analyze.query_results$add_insights.invokeStatic(query_results.clj:61)"
"sync.analyze.query_results$add_insights.invoke(query_results.clj:60)"
"sync.analyze.query_results$results__GT_column_metadata.invokeStatic(query_results.clj:88)"
"sync.analyze.query_results$results__GT_column_metadata.invoke(query_results.clj:81)"
"query_processor.middleware.results_metadata$record_and_return_metadata_BANG_$fn__44316.invoke(results_metadata.clj:91)"
"query_processor.middleware.format_rows$format_rows$fn__38510.invoke(format_rows.clj:26)"
"query_processor.middleware.add_dimension_projections$add_remapping$fn__34938.invoke(add_dimension_projections.clj:234)"
"query_processor.middleware.add_source_metadata$add_source_metadata_for_source_queries$fn__35638.invoke(add_source_metadata.clj:107)"
"query_processor.middleware.resolve_source_table$resolve_source_tables$fn__41607.invoke(resolve_source_table.clj:46)"
"query_processor.middleware.add_row_count_and_status$add_row_count_and_status$fn__35498.invoke(add_row_count_and_status.clj:16)"
"query_processor.middleware.driver_specific$process_query_in_context$fn__37521.invoke(driver_specific.clj:12)"
"query_processor.middleware.resolve_driver$resolve_driver$fn__41221.invoke(resolve_driver.clj:22)"
"query_processor.middleware.bind_effective_timezone$bind_effective_timezone$fn__36835$fn__36836.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__36835.invoke(bind_effective_timezone.clj:8)"
"query_processor.middleware.store$initialize_store$fn__44341$fn__44342.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__44341.invoke(store.clj:10)"
"query_processor.middleware.async$async__GT_sync$fn__20798.invoke(async.clj:23)"
"query_processor.middleware.async_wait$runnable$fn__36561.invoke(async_wait.clj:89)")
[11c5e64e-ce59-48f8-850a-4c16f243f3f5] 2019-11-28T19:25:20+01:00 DEBUG metabase.middleware.log POST /api/dataset 200 [ASYNC: completed] 5.8 s (19 DB calls) Jetty threads: 4/50 (2 idle, 0 queued) (88 total active threads) Queries in flight: 0
[11c5e64e-ce59-48f8-850a-4c16f243f3f5] 2019-11-28T19:25:27+01:00 DEBUG metabase.middleware.log POST /api/card 400 2.6 ms (0 DB calls)
{:errors {:result_metadata "el valor puede ser nulo, o si no es nulo, value must be an array of valid results column metadata maps."}}

@alejandrorial

I feel like I keep asking questions and never get answers.

  1. Please post “Diagnostic Info” from Admin > Troubleshooting.
  2. Is any of the tables you’re joining empty (meaning doesn’t have any data in them)?
  3. Or is the result empty of the question, which you are trying to save?

When is the database column type of column you think is failing?
And what is the Field Type? Admin > Data Model > (database) > (table) > (column) :gear:

Does this only happen when you create a Custom question with joins or how do you trigger the error?

Sorry, I understood the logs:

  1. Please post “Diagnostic Info” from Admin > Troubleshooting.

{
"browser-info": {
"language": "en",
"platform": "Win32",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36",
"vendor": "Google Inc."
},
"system-info": {
"java.runtime.name": "OpenJDK Runtime Environment",
"java.runtime.version": "11.0.4+11",
"java.vendor": "AdoptOpenJDK",
"java.vendor.url": "https://adoptopenjdk.net/",
"java.version": "11.0.4",
"java.vm.name": "OpenJDK 64-Bit Server VM",
"java.vm.version": "11.0.4+11",
"os.name": "Linux",
"os.version": "4.9.0-11-amd64",
"user.language": "en",
"user.timezone": "UTC"
},
"metabase-info": {
"databases": [
"h2",
"postgres",
"redshift"
],
"hosting-env": "unknown",
"application-database": "mysql",
"run-mode": "prod",
"version": {
"date": "2019-10-07",
"tag": "v0.33.4",
"branch": "release-0.33.x",
"hash": "9559406"
},
"settings": {
"report-timezone": null
}
}
}

  1. Is any of the tables you’re joining empty (meaning doesn’t have any data in them)? -> Every table is filled
  2. Or is the result empty of the question, which you are trying to save? -> The question is not empty

When is the database column type of column you think is failing? -> In the log that I added, it is being shown this:

[11c5e64e-ce59-48f8-850a-4c16f243f3f5] 2019-11-28T19:25:20+01:00 ERROR metabase.sync.util Error generating fingerprint for Field ‘min_gap’: Index -1 out of bounds for length 2

And what is the Field Type? Admin > Data Model > (database) > (table) > (column) :gear: -> There is not type selected. There is a drop down list to select a type. In the previous version of Metabase, v0.28 I did not choose specific type for this field, which is a number in the database

Thanks a lot!

@alejandrorial

Try upgrading to latest release 0.33.6

The fingerprint error does not show the column type of min_gap. And Number is not a column type on any databases I know of.
Which database type and version are you querying?

Does it make any difference if you set Field Type to “Number”?

@flamber

The column data type in PostgreSQL is float8, anyway, there was questions showing this error that was saved. I change to number and there is not any change
The version of this database is PostgreSQL 9.6.11

Now we are on Metabase v0.33.4 because we were not able to save the queries in v0.33.6.

The error of the browser console,as we talked before, is:

result_metadata "value may be nil, or if non-nil, value must be an array of valid results column metadata maps.

And the Troubleshooting (without fingerprint error)log is:

[11c5e64e-ce59-48f8-850a-4c16f243f3f5] 2019-11-28T20:29:06+01:00 DEBUG metabase.middleware.log POST /api/card 400 1.8 ms (0 DB calls)
{:errors {:result_metadata "value may be nil, or if non-nil, value must be an array of valid results column metadata maps."}}

Maybe just as last option try to update again and to see what happens.

Thanks a lot for your help

@alejandrorial

Okay, so the column min_gap has nothing to do with if you can save questions or not, since some questions that have the column can save without any problem?

I don’t understand. Are you saying that you can save all questions on 0.33.4, but not on 0.33.6?

This specific error usually means that it’s getting an empty (or missing) result, which it is trying to save, but that’s not allowed.

If there are not any other errors in the log from startup until the save fails, then I don’t know what’s going on.

@flamber

Okay, so the column min_gap has nothing to do with if you can save questions or not, since some questions that have the column can save without any problem? -> Exactly. Some questions are saved with the same error in the log, so I think that this is not the problem

I don’t understand. Are you saying that you can save all questions on 0.33.4, but not on 0.33.6? -> I was in 0.33.6, we were not able to save questions, we downgrade to 0.33.4, and we are still not able to save questions. Then we change the encoding, and we get the Button error of 400 http that I show you in previous mesaages.

This specific error usually means that it’s getting an empty (or missing) result, which it is trying to save, but that’s not allowed. -> The reuslt is not empty because I am joining 3 tables, getting the result, and then saving the questions.

@alejandrorial I have tried several times to reproduce this problem without success, so I don’t know what’s wrong. You would need to do some debugging or share a sample database, where the problem can be triggered.