Unable to Open Downloaded .xlsx file

Metabase Version : v0.40.3.1
Downloads results for a question using the xlsx format.
But after i open the file i get error shown in the image below

Below is my diagnotic info

{
  "browser-info": {
    "language": "en-US",
    "platform": "Win32",
    "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.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.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": "5.4.204-113.362.amzn2.x86_64",
    "user.language": "en",
    "user.timezone": "GMT"
  },
  "metabase-info": {
    "databases": [
      "mongo",
      "postgres",
      "googleanalytics"
    ],
    "hosting-env": "unknown",
    "application-database": "postgres",
    "application-database-details": {
      "database": {
        "name": "PostgreSQL",
        "version": "13.7 (Ubuntu 13.7-1.pgdg20.04+1)"
      },
      "jdbc-driver": {
        "name": "PostgreSQL JDBC Driver",
        "version": "42.2.18"
      }
    },
    "run-mode": "prod",
    "version": {
      "date": "2021-08-26",
      "tag": "v0.40.3.1",
      "branch": "release-x.40.x",
      "hash": "0550b86"
    },
    "settings": {
      "report-timezone": null
    }
  }
}

Hi @anonymous
You should upgrade to a newer release immediately: https://github.com/metabase/metabase/security/advisories/GHSA-vmm4-cwrm-38rj
Latest release is 0.45.1: https://github.com/metabase/metabase/releases/latest

Version has been upgraded to the latest version but still issue persists

@anonymous Then open the file in Notepad, since it's just a stacktrace error, and include it here.

{
  "database_id": 5,
  "started_at": "2022-12-12T20:16:28.714485Z",
  "via": [
    {
      "status": "failed",
      "class": "class clojure.lang.ExceptionInfo",
      "error": "Error reducing result rows: ERROR: canceling statement due to conflict with recovery\n  Detail: User query might have needed to see row versions that must be removed.",
      "stacktrace": [
        "--> query_processor.context.default$default_reducef$fn__39654.invoke(default.clj:59)",
        "query_processor.context.default$default_reducef.invokeStatic(default.clj:56)",
        "query_processor.context.default$default_reducef.invoke(default.clj:48)",
        "query_processor.middleware.cache$run_query_with_cache$reducef_SINGLEQUOTE___53517$fn__53518.invoke(cache.clj:192)",
        "query_processor.middleware.cache.impl$do_with_serialization.invokeStatic(impl.clj:68)",
        "query_processor.middleware.cache.impl$do_with_serialization.invoke(impl.clj:39)",
        "query_processor.middleware.cache.impl$do_with_serialization.invokeStatic(impl.clj:58)",
        "query_processor.middleware.cache.impl$do_with_serialization.invoke(impl.clj:39)",
        "query_processor.middleware.cache$run_query_with_cache$reducef_SINGLEQUOTE___53517.invoke(cache.clj:188)",
        "query_processor.context$reducef.invokeStatic(context.clj:69)",
        "query_processor.context$reducef.invoke(context.clj:62)",
        "query_processor.context.default$default_runf$respond_STAR___39658.invoke(default.clj:68)",
        "driver.sql_jdbc.execute$execute_reducible_query.invokeStatic(execute.clj:506)",
        "driver.sql_jdbc.execute$execute_reducible_query.invoke(execute.clj:485)",
        "driver.sql_jdbc.execute$execute_reducible_query.invokeStatic(execute.clj:493)",
        "driver.sql_jdbc.execute$execute_reducible_query.invoke(execute.clj:485)",
        "driver.sql_jdbc$fn__88395.invokeStatic(sql_jdbc.clj:58)",
        "driver.sql_jdbc$fn__88395.invoke(sql_jdbc.clj:56)",
        "query_processor.context$executef.invokeStatic(context.clj:59)",
        "query_processor.context$executef.invoke(context.clj:48)",
        "query_processor.context.default$default_runf.invokeStatic(default.clj:67)",
        "query_processor.context.default$default_runf.invoke(default.clj:65)",
        "query_processor.context$runf.invokeStatic(context.clj:45)",
        "query_processor.context$runf.invoke(context.clj:39)",
        "query_processor.reducible$identity_qp.invokeStatic(reducible.clj:12)",
        "query_processor.reducible$identity_qp.invoke(reducible.clj:9)",
        "query_processor.middleware.cache$run_query_with_cache.invokeStatic(cache.clj:193)",
        "query_processor.middleware.cache$run_query_with_cache.invoke(cache.clj:178)",
        "query_processor.middleware.cache$maybe_return_cached_results$maybe_return_cached_results_STAR___53529.invoke(cache.clj:219)",
        "query_processor.middleware.permissions$check_query_permissions$fn__49184.invoke(permissions.clj:109)",
        "query_processor.middleware.mbql_to_native$mbql__GT_native$fn__52474.invoke(mbql_to_native.clj:23)",
        "query_processor$fn__55005$combined_post_process__55010$combined_post_process_STAR___55011.invoke(query_processor.clj:212)",
        "query_processor$fn__55005$combined_pre_process__55006$combined_pre_process_STAR___55007.invoke(query_processor.clj:209)",
        "query_processor.middleware.resolve_database_and_driver$resolve_database_and_driver$fn__53450$fn__53455.invoke(resolve_database_and_driver.clj:35)",
        "driver$do_with_driver.invokeStatic(driver.clj:76)",
        "driver$do_with_driver.invoke(driver.clj:72)",
        "query_processor.middleware.resolve_database_and_driver$resolve_database_and_driver$fn__53450.invoke(resolve_database_and_driver.clj:34)",
        "query_processor.middleware.fetch_source_query$resolve_card_id_source_tables$fn__49450.invoke(fetch_source_query.clj:314)",
        "query_processor.middleware.store$initialize_store$fn__49640$fn__49641.invoke(store.clj:11)",
        "query_processor.store$do_with_store.invokeStatic(store.clj:45)",
        "query_processor.store$do_with_store.invoke(store.clj:39)",
        "query_processor.middleware.store$initialize_store$fn__49640.invoke(store.clj:10)",
        "query_processor.middleware.normalize_query$normalize$fn__53722.invoke(normalize_query.clj:22)",
        "query_processor.middleware.constraints$add_default_userland_constraints$fn__50728.invoke(constraints.clj:53)",
        "query_processor.middleware.process_userland_query$process_userland_query$fn__53661.invoke(process_userland_query.clj:145)",
        "query_processor.middleware.catch_exceptions$catch_exceptions$fn__54033.invoke(catch_exceptions.clj:167)",
        "query_processor.reducible$async_qp$qp_STAR___45482$thunk__45484.invoke(reducible.clj:100)",
        "query_processor.reducible$async_qp$qp_STAR___45482$fn__45486.invoke(reducible.clj:105)"
      ],
      "error_type": "qp",
      "ex-data": {
        "type": "qp"
      }
    }
  ],
  "state": "40001",
  "error_type": "qp",
  "json_query": {
    "constraints": null,
    "type": "native",
    "middleware": {
      "js-int-to-string?": false,
      "ignore-cached-results?": true,
      "process-viz-settings?": true,
      "skip-results-metadata?": true,
      "format-rows?": false
    },
    "native": {
      "template-tags": {
        "customer": {
          "id": "e966cb39-3ed6-d7d9-45a8-09c96948c933",
          "name": "customer",
          "display-name": "Customer",
          "type": "text"
        },
        "end_date": {
          "id": "8c7ed2e8-171c-1e02-f32f-a0b3e15cc05a",
          "name": "end_date",
          "display-name": "End date",
          "type": "date"
        }
      },
      "query": "with current_prices as (\r\n    select p.price, p.product, (select name from petra_crm_product where id = p.product), p.pricedate\r\n    from petra_crm_price p\r\n    inner join (\r\n    \tselect p.product, max(pricedate)\r\n    \tfrom petra_crm_price p\r\n    \twhere p.pricedate <= [[ {{end_date}} --]]CURRENT_DATE\r\n    \tgroup by 1\r\n    ) foo on foo.product = p.product and p.pricedate = foo.max\r\n    group by 1,2,3,4\r\n)\r\nselect client, customer, cpetraid \"Customer Petra Id\", product, \"scheme\", pricedate \"Date of First Purchase\", price \"Purchase Price/price for first contribution\", first_contrib \"Amount of First Subscription\", \r\n\"Client Name\", \"Client Type (Retail/Institutional)\", \r\ntotal_Contrib_amount_test \"Invested Amount(contributions so far)\", total_Contrib_unit_test \"Units (No. of Shares)\", Address \"Address of Investor\", (total_units * curr_price) \"Current Value (current balance)\" \r\nfrom(\r\n\tSELECT \r\n\tdistinct on(cd.client, cd.customer, cd.product)\r\n     cd.client,\r\n\t cd.customer,cd.product,cp.price curr_price,\r\n\t petra_crm_product.name \"scheme\",\r\n     pc.price, customer.fullname \"Client Name\", customer.type \"Client Type (Retail/Institutional)\" , customer.petraid cpetraid,\r\n    min(cd.pricedate) pricedate, max(cd.amount) first_contrib,\r\n     (select sum(units) from customer_deal where product = cd.product and customer = cd.customer) total_units,\r\n        \t( select concat(address_line1,' ',address_line2)\r\n    \t from  petra_crm_customer_address address \r\n    \t where address.address_line1 is not null and address.address_line1 != '' \r\n    \t and  address.customer = cd.customer \r\n    \t limit 1\r\n\t    ) Address ,\r\n--      sum(case when deal_type = 'issue' then coalesce(amount, 0) end ) as \"Contrib\",\r\n-- \t sum(case when deal_type = 'issue' then coalesce(units, 0) end ) as \"Contrib Units\",\r\n     (select sum(amount) from customer_deal where deal_type = 'issue' and customer = cd.customer ) total_Contrib_test,\r\n    -- (select sum(units) * price from customer_deal where customer = cd.customer and product = cd.product) AUM\r\n    (select sum(amount) from customer_deal where deal_type = 'issue' and product = cd.product and customer = cd.customer) total_Contrib_amount_test, ----- per product\r\n    (select sum(units) from customer_deal where deal_type = 'issue' and product = cd.product and customer = cd.customer) total_Contrib_unit_test ----- per product\r\n\tFROM customer_deal cd\r\n\tJOIN petra_crm_client  ON petra_crm_client.id = cd.client\r\n\tjoin petra_crm_price pc on pc.product = cd.product and pc.pricedate = cd.pricedate\r\n    join petra_crm_customer customer on customer.id = cd.customer\r\n\tjoin petra_crm_product on petra_crm_product.id = cd.product\r\n\tjoin current_prices cp on cp.product = cd.product\r\n-- \tJOIN petra_crm_customer_product customer_product ON customer_product.customer = cd.customer and customer_product.product =  cd.product\r\nwhere 1=1 \r\n         [[and customer.petraid = {{customer}} ]]\r\n    --  and cd.customer = 502\r\ngroup by 1,2,3,4,5,6,7,8,9\r\n    ) foo"
    },
    "database": 5,
    "parameters": null,
    "async?": true,
    "cache-ttl": 5039160
  },
  "status": "failed",
  "class": "class org.postgresql.util.PSQLException",
  "stacktrace": [
    "org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2676)",
    "org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2366)",
    "org.postgresql.core.v3.QueryExecutorImpl.fetch(QueryExecutorImpl.java:2562)",
    "org.postgresql.jdbc.PgResultSet.next(PgResultSet.java:2145)",
    "com.mchange.v2.c3p0.impl.NewProxyResultSet.next(NewProxyResultSet.java:685)",
    "--> driver.sql_jdbc.execute$row_thunk$row_thunk_STAR___56009.invoke(execute.clj:455)",
    "query_processor.reducible$reducible_rows$reify__45496.reduce(reducible.clj:149)",
    "query_processor.context.default$default_reducef$fn__39654.invoke(default.clj:57)",
    "query_processor.context.default$default_reducef.invokeStatic(default.clj:56)",
    "query_processor.context.default$default_reducef.invoke(default.clj:48)",
    "query_processor.middleware.cache$run_query_with_cache$reducef_SINGLEQUOTE___53517$fn__53518.invoke(cache.clj:192)",
    "query_processor.middleware.cache.impl$do_with_serialization.invokeStatic(impl.clj:68)",
    "query_processor.middleware.cache.impl$do_with_serialization.invoke(impl.clj:39)",
    "query_processor.middleware.cache.impl$do_with_serialization.invokeStatic(impl.clj:58)",
    "query_processor.middleware.cache.impl$do_with_serialization.invoke(impl.clj:39)",
    "query_processor.middleware.cache$run_query_with_cache$reducef_SINGLEQUOTE___53517.invoke(cache.clj:188)",
    "query_processor.context$reducef.invokeStatic(context.clj:69)",
    "query_processor.context$reducef.invoke(context.clj:62)",
    "query_processor.context.default$default_runf$respond_STAR___39658.invoke(default.clj:68)",
    "driver.sql_jdbc.execute$execute_reducible_query.invokeStatic(execute.clj:506)",
    "driver.sql_jdbc.execute$execute_reducible_query.invoke(execute.clj:485)",
    "driver.sql_jdbc.execute$execute_reducible_query.invokeStatic(execute.clj:493)",
    "driver.sql_jdbc.execute$execute_reducible_query.invoke(execute.clj:485)",
    "driver.sql_jdbc$fn__88395.invokeStatic(sql_jdbc.clj:58)",
    "driver.sql_jdbc$fn__88395.invoke(sql_jdbc.clj:56)",
    "query_processor.context$executef.invokeStatic(context.clj:59)",
    "query_processor.context$executef.invoke(context.clj:48)",
    "query_processor.context.default$default_runf.invokeStatic(default.clj:67)",
    "query_processor.context.default$default_runf.invoke(default.clj:65)",
    "query_processor.context$runf.invokeStatic(context.clj:45)",
    "query_processor.context$runf.invoke(context.clj:39)",
    "query_processor.reducible$identity_qp.invokeStatic(reducible.clj:12)",
    "query_processor.reducible$identity_qp.invoke(reducible.clj:9)",
    "query_processor.middleware.cache$run_query_with_cache.invokeStatic(cache.clj:193)",
    "query_processor.middleware.cache$run_query_with_cache.invoke(cache.clj:178)",
    "query_processor.middleware.cache$maybe_return_cached_results$maybe_return_cached_results_STAR___53529.invoke(cache.clj:219)",
    "query_processor.middleware.permissions$check_query_permissions$fn__49184.invoke(permissions.clj:109)",
    "query_processor.middleware.mbql_to_native$mbql__GT_native$fn__52474.invoke(mbql_to_native.clj:23)",
    "query_processor$fn__55005$combined_post_process__55010$combined_post_process_STAR___55011.invoke(query_processor.clj:212)",
    "query_processor$fn__55005$combined_pre_process__55006$combined_pre_process_STAR___55007.invoke(query_processor.clj:209)",
    "query_processor.middleware.resolve_database_and_driver$resolve_database_and_driver$fn__53450$fn__53455.invoke(resolve_database_and_driver.clj:35)",
    "driver$do_with_driver.invokeStatic(driver.clj:76)",
    "driver$do_with_driver.invoke(driver.clj:72)",
    "query_processor.middleware.resolve_database_and_driver$resolve_database_and_driver$fn__53450.invoke(resolve_database_and_driver.clj:34)",
    "query_processor.middleware.fetch_source_query$resolve_card_id_source_tables$fn__49450.invoke(fetch_source_query.clj:314)",
    "query_processor.middleware.store$initialize_store$fn__49640$fn__49641.invoke(store.clj:11)",
    "query_processor.store$do_with_store.invokeStatic(store.clj:45)",
    "query_processor.store$do_with_store.invoke(store.clj:39)",
    "query_processor.middleware.store$initialize_store$fn__49640.invoke(store.clj:10)",
    "query_processor.middleware.normalize_query$normalize$fn__53722.invoke(normalize_query.clj:22)",
    "query_processor.middleware.constraints$add_default_userland_constraints$fn__50728.invoke(constraints.clj:53)",
    "query_processor.middleware.process_userland_query$process_userland_query$fn__53661.invoke(process_userland_query.clj:145)",
    "query_processor.middleware.catch_exceptions$catch_exceptions$fn__54033.invoke(catch_exceptions.clj:167)",
    "query_processor.reducible$async_qp$qp_STAR___45482$thunk__45484.invoke(reducible.clj:100)",
    "query_processor.reducible$async_qp$qp_STAR___45482$fn__45486.invoke(reducible.clj:105)"
  ],
  "card_id": 634,
  "context": "xlsx-download",
  "error": "ERROR: canceling statement due to conflict with recovery\n  Detail: User query might have needed to see row versions that must be removed.",
  "row_count": 0,
  "running_time": 0,
  "data": {
    "rows": [
      
    ],
    "cols": [
      
    ]
  }
}

@anonymous Your Postgres database is in recovery-mode - contact your database administrator:
https://stackoverflow.com/questions/14592436/postgresql-error-canceling-statement-due-to-conflict-with-recovery

ok
well after i upgraded to the latest version. Most users couldnt login anymore so i switched back to the previous version i was running before.
Now this is the error feedback im getting after been able to login

@anonymous You cannot just downgrade. You'll have to revert to your backup you made before upgrading.

okay but what could be the reason for not being able to login after the upgrade.
I even tried the reset password option. Below is the email content i received. But there is no "Sign in with SSO" button on the page.

@anonymous If the user accounts are created using SSO, then they'll need to login via SSO.

but how SSO
there is not SSO button on the UI
All i see is one login button

@anonymous The users have been created with SSO. You'll need to fix that manually in the application database in the table core_user and set google_auth=false, set ldap_auth=false and set sso_source=null

Thank you
Issue Sorted