CSV Upload Error

Hi Folks,

I am having issues uploading a csv to my postgres database. I am running self hosted on prem with a helm chart. I have a staging and a prod version of metabase running and I have tried versions 0.55.X and 0.56.X. I am currently running both instances with 0.55.7. I am able to upload csv files to my databases in my stg version with no issues but cannot upload with our prod metabase instance. In terms of differences in our deployments, our only difference is the k8s namespace the deployment is running in and the ingress host, all other values are the same. Below is the stack trace for the error:

{'via': [
        {'type': 'java.lang.IllegalArgumentException',
   'message': 'No matching clause: :request',
   'at': ['metabase.api.macros$decode_and_validate_params93360__93361',
    'invokeStatic',
    'macros.clj',
                372
            ]
        }
    ],
 'trace': [
        ['metabase.api.macros$decode_and_validate_params93360__93361',
   'invokeStatic',
   'macros.clj',
            372
        ],
        ['metabase.api.macros$decode_and_validate_params93360__93361',
   'invoke',
   'macros.clj',
            364
        ],
        ['metabase.upload.api$fn__123020$fn__123028', 'invoke', 'api.clj',
            33
        ],
        ['metabase.api.macros$_core_fn93370__93371$core_fn__93372',
   'invoke',
   'macros.clj',
            415
        ],
        ['metabase.api.macros$endpoint_handler_STAR_93414__93416$handler__93420',
   'invoke',
   'macros.clj',
            611
        ],
        ['ring.middleware.multipart_params$wrap_multipart_params$fn__93260$fn__93267',
   'invoke',
   'multipart_params.clj',
            199
        ],
        ['ring.middleware.multipart_params$handle_request_and_errors$fn__93254$fn__93255',
   'invoke',
   'multipart_params.clj',
            140
        ],
        ['ring.middleware.multipart_params$handle_request_and_errors',
   'invokeStatic',
   'multipart_params.clj',
            138
        ],
        ['ring.middleware.multipart_params$handle_request_and_errors',
   'invoke',
   'multipart_params.clj',
            137
        ],
        ['ring.middleware.multipart_params$wrap_multipart_params$fn__93260',
   'invoke',
   'multipart_params.clj',
            197
        ],
        ['metabase.api.macros$build_ns_handler93447__93448$ns_handler_STAR___93449',
   'invoke',
   'macros.clj',
            675
        ],
        ['metabase.api.open_api.HandlerWithOpenAPISpec',
   'invoke',
   'open_api.clj',
            42
        ],
        ['metabase.api.routes.common$enforce_authentication$fn__115293',
   'invoke',
   'common.clj',
            91
        ],
        ['metabase.api.open_api.HandlerWithOpenAPISpec',
   'invoke',
   'open_api.clj',
            42
        ],
        ['metabase.api.util.handlers$_route_map_handler$fn__100059',
   'invoke',
   'handlers.clj',
            23
        ],
        ['metabase.api.open_api.HandlerWithOpenAPISpec',
   'invoke',
   'open_api.clj',
            42
        ],
        ['compojure.core$routes$fn__99996$f__99997', 'invoke', 'core.clj',
            198
        ],
        ['compojure.core$routes$fn__99996$f__99997$respond_SINGLEQUOTE___99998',
   'invoke',
   'core.clj',
            197
        ],
        ['metabase.api_routes.routes$fn__124733', 'invokeStatic', 'routes.clj',
            97
        ],
        ['metabase.api_routes.routes$fn__124733', 'invoke', 'routes.clj',
            96
        ],
        ['metabase.api.open_api.HandlerWithOpenAPISpec',
   'invoke',
   'open_api.clj',
            42
        ],
        ['compojure.core$routes$fn__99996$f__99997', 'invoke', 'core.clj',
            198
        ],
        ['compojure.core$routes$fn__99996', 'invoke', 'core.clj',
            200
        ],
        ['metabase.api.open_api.HandlerWithOpenAPISpec',
   'invoke',
   'open_api.clj',
            42
        ],
        ['clojure.lang.Var', 'invoke', 'Var.java',
            395
        ],
        ['metabase.server.routes$api_handler100647__100648$api_handler_STAR___100649',
   'invoke',
   'routes.clj',
            72
        ],
        ['compojure.core$routes$fn__99996$f__99997', 'invoke', 'core.clj',
            198
        ],
        ['compojure.core$routes$fn__99996', 'invoke', 'core.clj',
            200
        ],
        ['compojure.core$make_context$handler__100024', 'invoke', 'core.clj',
            290
        ],
        ['compojure.core$make_context$fn__100028', 'invoke', 'core.clj',
            300
        ],
        ['compojure.core$routes$fn__99996$f__99997', 'invoke', 'core.clj',
            198
        ],
        ['compojure.core$routes$fn__99996$f__99997$respond_SINGLEQUOTE___99998',
   'invoke',
   'core.clj',
            197
        ],
        ['compojure.core$wrap_route_matches$fn__99977', 'invoke', 'core.clj',
            153
        ],
        ['compojure.core$routes$fn__99996$f__99997', 'invoke', 'core.clj',
            198
        ],
        ['compojure.core$routes$fn__99996$f__99997$respond_SINGLEQUOTE___99998',
   'invoke',
   'core.clj',
            197
        ],
        ['compojure.core$wrap_route_matches$fn__99977', 'invoke', 'core.clj',
            153
        ],
        ['compojure.core$routes$fn__99996$f__99997', 'invoke', 'core.clj',
            198
        ],
        ['compojure.core$routes$fn__99996$f__99997$respond_SINGLEQUOTE___99998',
   'invoke',
   'core.clj',
            197
        ],
        ['compojure.core$wrap_route_matches$fn__99977', 'invoke', 'core.clj',
            153
        ],
        ['compojure.core$routes$fn__99996$f__99997', 'invoke', 'core.clj',
            198
        ],
        ['compojure.core$routes$fn__99996$f__99997$respond_SINGLEQUOTE___99998',
   'invoke',
   'core.clj',
            197
        ],
        ['compojure.core$wrap_route_matches$fn__99977', 'invoke', 'core.clj',
            153
        ],
        ['compojure.core$routes$fn__99996$f__99997', 'invoke', 'core.clj',
            198
        ],
        ['compojure.core$routes$fn__99996$f__99997$respond_SINGLEQUOTE___99998',
   'invoke',
   'core.clj',
            197
        ],
        ['metabase.api.util.handlers$_route_map_handler$fn__100059',
   'invoke',
   'handlers.clj',
            24
        ],
        ['metabase.api.open_api.HandlerWithOpenAPISpec',
   'invoke',
   'open_api.clj',
            42
        ],
        ['metabase.api.util.handlers$_route_map_handler$fn__100059',
   'invoke',
   'handlers.clj',
            23
        ],
        ['metabase.api.open_api.HandlerWithOpenAPISpec',
   'invoke',
   'open_api.clj',
            42
        ],
        ['compojure.core$routes$fn__99996$f__99997', 'invoke', 'core.clj',
            198
        ],
        ['compojure.core$routes$fn__99996', 'invoke', 'core.clj',
            200
        ],
        ['metabase.server.middleware.exceptions$catch_uncaught_exceptions$fn__118568',
   'invoke',
   'exceptions.clj',
            77
        ],
        ['metabase.server.middleware.exceptions$catch_api_exceptions$fn__118565',
   'invoke',
   'exceptions.clj',
            66
        ],
        ['metabase.server.middleware.log$log_api_call$fn__112093$fn__112094$fn__112095',
   'invoke',
   'log.clj',
            224
        ],
        ['metabase.driver.sql_jdbc.execute.diagnostic$do_with_diagnostic_info',
   'invokeStatic',
   'diagnostic.clj',
            17
        ],
        ['metabase.driver.sql_jdbc.execute.diagnostic$do_with_diagnostic_info',
   'invoke',
   'diagnostic.clj',
            12
        ],
        ['metabase.server.middleware.log$log_api_call$fn__112093$fn__112094',
   'invoke',
   'log.clj',
            215
        ],
        ['toucan2.execute$do_with_call_counts', 'invokeStatic', 'execute.clj',
            112
        ],
        ['toucan2.execute$do_with_call_counts', 'invoke', 'execute.clj',
            103
        ],
        ['metabase.server.middleware.log$log_api_call$fn__112093',
   'invoke',
   'log.clj',
            214
        ],
        ['metabase.server.middleware.browser_cookie$ensure_browser_id_cookie$fn__125579',
   'invoke',
   'browser_cookie.clj',
            42
        ],
        ['metabase.server.middleware.security$add_security_headers$fn__118538',
   'invoke',
   'security.clj',
            277
        ],
        ['metabase.server.middleware.json$wrap_json_body$fn__117707',
   'invoke',
   'json.clj',
            128
        ],
        ['metabase.server.middleware.offset_paging$handle_paging$fn__120469',
   'invoke',
   'offset_paging.clj',
            48
        ],
        ['metabase.server.middleware.json$wrap_streamed_json_response$fn__117695',
   'invoke',
   'json.clj',
            83
        ],
        ['ring.middleware.keyword_params$wrap_keyword_params$fn__125846',
   'invoke',
   'keyword_params.clj',
            55
        ],
        ['ring.middleware.params$wrap_params$fn__125865',
   'invoke',
   'params.clj',
            77
        ],
        ['metabase.server.middleware.misc$maybe_set_site_url$fn__111209',
   'invoke',
   'misc.clj',
            59
        ],
        ['metabase.server.middleware.session$reset_session_timeout$fn__125566',
   'invoke',
   'session.clj',
            262
        ],
        ['metabase.server.middleware.session$bind_current_user$fn__125559$fn__125560',
   'invoke',
   'session.clj',
            237
        ],
        ['metabase.request.session$do_with_current_user$fn__78590',
   'invoke',
   'session.clj',
            51
        ],
        ['metabase.request.session$do_with_current_user$do_with_user_local_values__78585',
   'invoke',
   'session.clj',
            47
        ],
        ['metabase.request.session$do_with_current_user',
   'invokeStatic',
   'session.clj',
            48
        ],
        ['metabase.request.session$do_with_current_user',
   'invoke',
   'session.clj',
            30
        ],
        ['metabase.server.middleware.session$bind_current_user$fn__125559',
   'invoke',
   'session.clj',
            236
        ],
        ['metabase.server.middleware.session$wrap_current_user_info$fn__125555',
   'invoke',
   'session.clj',
            212
        ],
        ['metabase.analytics.sdk$embedding_mw$embedding_mw_fn__57885',
   'invoke',
   'sdk.clj',
            68
        ],
        ['metabase.server.middleware.session$wrap_session_key$fn__125524',
   'invoke',
   'session.clj',
            82
        ],
        ['metabase.server.middleware.auth$wrap_static_api_key$fn__112825',
   'invoke',
   'auth.clj',
            17
        ],
        ['ring.middleware.cookies$wrap_cookies$fn__125766',
   'invoke',
   'cookies.clj',
            200
        ],
        ['metabase.server.middleware.misc$add_content_type$fn__111191',
   'invoke',
   'misc.clj',
            28
        ],
        ['metabase.server.middleware.misc$disable_streaming_buffering$fn__111217',
   'invoke',
   'misc.clj',
            75
        ],
        ['ring.middleware.gzip$wrap_gzip$fn__125808', 'invoke', 'gzip.clj',
            86
        ],
        ['metabase.server.middleware.request_id$wrap_request_id$fn__101266',
   'invoke',
   'request_id.clj',
            10
        ],
        ['metabase.server.middleware.misc$bind_request$fn__111220$fn__111221',
   'invoke',
   'misc.clj',
            87
        ],
        ['metabase.request.current$do_with_current_request',
   'invokeStatic',
   'current.clj',
            19
        ],
        ['metabase.request.current$do_with_current_request',
   'invoke',
   'current.clj',
            15
        ],
        ['metabase.server.middleware.misc$bind_request$fn__111220',
   'invoke',
   'misc.clj',
            86
        ],
        ['metabase.server.middleware.ssl$redirect_to_https_middleware$fn__125595',
   'invoke',
   'ssl.clj',
            42
        ],
        ['metabase.server.instance$async_proxy_handler$fn__111826',
   'invoke',
   'instance.clj',
            81
        ],
        ['metabase.server.instance.proxy$org.eclipse.jetty.ee9.servlet.ServletHandler$ff19274a',
   'doHandle',
   None,
            -1
        ],
        ['org.eclipse.jetty.ee9.nested.ScopedHandler',
   'handle',
   'ScopedHandler.java',
            127
        ],
        ['metabase.server.statistics_handler$new_handler$fn__99239',
   'invoke',
   'statistics_handler.clj',
            105
        ],
        ['metabase.server.statistics_handler.proxy$org.eclipse.jetty.ee9.nested.HandlerWrapper$ff19274a',
   'handle',
   None,
            -1
        ],
        ['org.eclipse.jetty.ee9.nested.HandlerWrapper',
   'handle',
   'HandlerWrapper.java',
            124
        ],
        ['org.eclipse.jetty.ee9.nested.ScopedHandler',
   'nextHandle',
   'ScopedHandler.java',
            197
        ],
        ['org.eclipse.jetty.ee9.nested.ContextHandler',
   'doHandle',
   'ContextHandler.java',
            1045
        ],
        ['org.eclipse.jetty.ee9.nested.ScopedHandler',
   'nextScope',
   'ScopedHandler.java',
            164
        ],
        ['org.eclipse.jetty.ee9.servlet.ServletHandler',
   'doScope',
   'ServletHandler.java',
            483
        ],
        ['metabase.server.instance.proxy$org.eclipse.jetty.ee9.servlet.ServletHandler$ff19274a',
   'doScope',
   None,
            -1
        ],
        ['org.eclipse.jetty.ee9.nested.ScopedHandler',
   'nextScope',
   'ScopedHandler.java',
            162
        ],
        ['org.eclipse.jetty.ee9.nested.ContextHandler',
   'doScope',
   'ContextHandler.java',
            966
        ],
        ['org.eclipse.jetty.ee9.nested.ScopedHandler',
   'handle',
   'ScopedHandler.java',
            125
        ],
        ['org.eclipse.jetty.ee9.nested.ContextHandler',
   'handle',
   'ContextHandler.java',
            1719
        ],
        ['org.eclipse.jetty.ee9.nested.HttpChannel$RequestDispatchable',
   'dispatch',
   'HttpChannel.java',
            1564
        ],
        ['org.eclipse.jetty.ee9.nested.HttpChannel',
   'dispatch',
   'HttpChannel.java',
            723
        ],
        ['org.eclipse.jetty.ee9.nested.HttpChannel',
   'handle',
   'HttpChannel.java',
            511
        ],
        ['org.eclipse.jetty.ee9.nested.ContextHandler$CoreContextHandler$CoreToNestedHandler',
   'handle',
   'ContextHandler.java',
            2943
        ],
        ['org.eclipse.jetty.server.handler.ContextHandler',
   'handle',
   'ContextHandler.java',
            1071
        ],
        ['org.eclipse.jetty.server.Server', 'handle', 'Server.java',
            182
        ],
        ['org.eclipse.jetty.server.internal.HttpChannelState$HandlerInvoker',
   'run',
   'HttpChannelState.java',
            665
        ],
        ['org.eclipse.jetty.server.internal.HttpConnection',
   'onFillable',
   'HttpConnection.java',
            416
        ],
        ['org.eclipse.jetty.io.AbstractConnection$ReadCallback',
   'succeeded',
   'AbstractConnection.java',
            322
        ],
        ['org.eclipse.jetty.io.FillInterest', 'fillable', 'FillInterest.java',
            99
        ],
        ['org.eclipse.jetty.io.SelectableChannelEndPoint$1',
   'run',
   'SelectableChannelEndPoint.java',
            53
        ],
        ['org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy',
   'runTask',
   'AdaptiveExecutionStrategy.java',
            480
        ],
        ['org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy',
   'consumeTask',
   'AdaptiveExecutionStrategy.java',
            443
        ],
        ['org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy',
   'tryProduce',
   'AdaptiveExecutionStrategy.java',
            293
        ],
        ['org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy',
   'run',
   'AdaptiveExecutionStrategy.java',
            201
        ],
        ['org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread',
   'run',
   'ReservedThreadExecutor.java',
            311
        ],
        ['org.eclipse.jetty.util.thread.QueuedThreadPool',
   'runJob',
   'QueuedThreadPool.java',
            981
        ],
        ['org.eclipse.jetty.util.thread.QueuedThreadPool$Runner',
   'doRunJob',
   'QueuedThreadPool.java',
            1211
        ],
        ['org.eclipse.jetty.util.thread.QueuedThreadPool$Runner',
   'run',
   'QueuedThreadPool.java',
            1166
        ],
        ['java.lang.Thread', 'run', None,
            -1
        ]
    ],
 'cause': 'No matching clause: :request',
 'message': 'No matching clause: :request'
}

I have tried to debug in just about every way I can think of, I have downloaded and compared the http requests from dev tools, I have tried to upload to both our stg and prod db in both environments (metabase stg works for both our prod and stg postgres, metabase prod doesnt work for either), restarted the metabase pod, tried different versions of metabase, gone through the metabase application db to look for anything that might seem weird, etc. The database user for the csv upload have write permissions (proved by being able to upload via our metabase stg insance), I'm just not sure what to do next.

Based on the stack trace, I assume that the error comes from this line, but I am not sure what is causing the issue.

Any insight would be helpful to resolve the issue. Thanks!

To clarify,

Are you performing the upload using the Metabase UI, or are you using an API call? Is the UI embedded in another webpage or app?

Are you using the same database as the upload target for all of the environments? If so, is the connection information for that database is the same across all the environments?

Upload is via the UI. The UI is not embedded and is only accessed directly via the metabase webpage.

We have two databases on two different hosts that I am able to upload to in our metabase stg environment. I am feel quite sure the connection information being used in our metabase prod deployment is correct because I can read and query the uploads i have made from our metabase staging env in our metabase prod env.

Thanks for the response and let me know if there are more details i can clarify!

You're using the same database for both envs. I agree we can eliminate that as a source. Usually exceptions come from the JDBC driver layer if there's a database issue.

The traceback implies a problem with the API call the frontend is making, like one of the parameters is missing.

Can you try clearing cache & restarting the browser you are using to access the prod site?

I agree, it seems that there is a weird issue coming from the front end. Fully shut down the browser, cleared cookies, tried incognito mode, etc and the issue is the same.

I also port forwarded the k8s service to see if the ingress was an issue, and the issue was still present.