Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot edit segment/metric unless adding new filters #9783

Closed
flamber opened this issue Apr 14, 2019 · 6 comments

Comments

Projects
None yet
7 participants
@flamber
Copy link
Contributor

commented Apr 14, 2019

Steps to reproduce:

  • Create a segment/metric
  • Edit it and change name, description and/or current filter
  • Returns to table overview without updating anything - console errors with 500 Server Error

Workaround is to add a new filter, then it saves the changes.

0.32.5 with JAR on MariaDB and dev env on H2 / Chromium 73 and Firefox 66

ERROR middleware.log :: PUT /api/segment/4 500 15 ms (1 DB calls) (49 total active threads) 
{:value [nil],
 :error [(named (named (not (matches-some-precondition? nil)) "Keyword or string") token)],
 :message "Input to normalize-token does not match schema: \n\n\t   [(named (named (not (matches-some-precondition? nil)) \"Keyword or string\") token)]  \n\n",
 :type clojure.lang.ExceptionInfo,
 :stacktrace
 ("--> mbql.util$eval26356$normalize_token__26361.invoke(util.clj:14)"
  "mbql.normalize$normalize_time_interval_tokens.invokeStatic(normalize.clj:111)"
  "mbql.normalize$normalize_time_interval_tokens.invoke(normalize.clj:104)"
  "mbql.normalize$normalize_mbql_clause_tokens.invokeStatic(normalize.clj:142)"
  "mbql.normalize$normalize_mbql_clause_tokens.invoke(normalize.clj:135)"
  "mbql.normalize$normalize_tokens.invokeStatic(normalize.clj:270)"
  "mbql.normalize$normalize_tokens.doInvoke(normalize.clj:236)"
  "mbql.normalize$normalize_mbql_clause_tokens$fn__27021.invoke(normalize.clj:143)"
  "mbql.normalize$normalize_mbql_clause_tokens.invokeStatic(normalize.clj:143)"
  "mbql.normalize$normalize_mbql_clause_tokens.invoke(normalize.clj:135)"
  "mbql.normalize$normalize_tokens.invokeStatic(normalize.clj:270)"
  "mbql.normalize$normalize_tokens.doInvoke(normalize.clj:236)"
  "mbql.normalize$normalize_tokens$iter__27110__27114$fn__27115.invoke(normalize.clj:266)"
  "mbql.normalize$normalize_tokens.invokeStatic(normalize.clj:264)"
  "mbql.normalize$normalize_tokens.doInvoke(normalize.clj:236)"
  "mbql.normalize$normalize_tokens$iter__27110__27114$fn__27115.invoke(normalize.clj:266)"
  "mbql.normalize$normalize_tokens.invokeStatic(normalize.clj:264)"
  "mbql.normalize$normalize_tokens.doInvoke(normalize.clj:236)"
  "mbql.normalize$normalize_fragment.invokeStatic(normalize.clj:608)"
  "mbql.normalize$normalize_fragment.invoke(normalize.clj:599)"
  "mbql.normalize$normalize_fragment.invokeStatic(normalize.clj:609)"
  "mbql.normalize$normalize_fragment.invoke(normalize.clj:599)"
  "models.interface$normalize_metric_segment_definition.invokeStatic(interface.clj:87)"
  "models.interface$normalize_metric_segment_definition.invoke(interface.clj:85)"
  "api.segment$write_check_and_update_segment_BANG_.invokeStatic(segment.clj:71)"
  "api.segment$write_check_and_update_segment_BANG_.invoke(segment.clj:59)"
  "api.segment$fn__69595.invokeStatic(segment.clj:89)"
  "api.segment$fn__69595.invoke(segment.clj:76)"
  "middleware.auth$enforce_authentication$fn__5052.invoke(auth.clj:14)"
  "routes$fn__71191$fn__71192.doInvoke(routes.clj:113)"
  "middleware.exceptions$catch_uncaught_exceptions$fn__22982.invoke(exceptions.clj:104)"
  "middleware.exceptions$catch_api_exceptions$fn__22979.invoke(exceptions.clj:92)"
  "middleware.log$log_api_call$fn__23530$fn__23531.invoke(log.clj:168)"
  "middleware.log$log_api_call$fn__23530.invoke(log.clj:162)"
  "middleware.security$add_security_headers$fn__22937.invoke(security.clj:102)"
  "middleware.json$wrap_json_body$fn__23082.invoke(json.clj:61)"
  "middleware.json$wrap_streamed_json_response$fn__23100.invoke(json.clj:97)"
  "middleware.session$bind_current_user$fn__37197$fn__37198.invoke(session.clj:188)"
  "middleware.session$do_with_current_user.invokeStatic(session.clj:171)"
  "middleware.session$do_with_current_user.invoke(session.clj:165)"
  "middleware.session$bind_current_user$fn__37197.invoke(session.clj:187)"
  "middleware.session$wrap_current_user_id$fn__37182.invoke(session.clj:156)"
  "middleware.session$wrap_session_id$fn__37167.invoke(session.clj:118)"
  "middleware.auth$wrap_api_key$fn__5060.invoke(auth.clj:27)"
  "middleware.misc$maybe_set_site_url$fn__24578.invoke(misc.clj:54)"
  "middleware.misc$bind_user_locale$fn__24581.invoke(misc.clj:70)"
  "middleware.misc$add_content_type$fn__24568.invoke(misc.clj:29)"
  "middleware.misc$wrap_gzip$fn__24596.invoke(misc.clj:97)")}

⬇️ Please click the 👍 reaction instead of leaving a comment with no new details

@SuneelPodapati

This comment has been minimized.

Copy link

commented Apr 15, 2019

Not able to update metrics in versions 0.32.2 or 0.32.4 through Admin UI or API.

Payload:

{
    "description": "boom",
    "archived": false,
    "table_id": 83,
    "definition": {
        "aggregation": [
            [
                "*",
                [
                    "/",
                    [
                        "sum",
                        [
                            "field-id",
                            10997
                        ]
                    ],
                    [
                        "sum",
                        [
                            "field-id",
                            11176
                        ]
                    ]
                ],
                100
            ]
        ],
        "source-table": 83
    },
    "show_in_getting_started": false,
    "name": "CTC",
    "caveats": null,
    "id": 570,
    "how_is_this_calculated": null,
    "points_of_interest": null,
    "revision_message": "not a blank string"
}

Getting the following error:

{
    "message": "Wrong number of args (1) passed to: metabase.mbql.normalize/fn--20628",
    "type": "class clojure.lang.ArityException",
    "stacktrace": [
        "clojure.lang.AFn.throwArity(AFn.java:429)",
        "clojure.lang.AFn.invoke(AFn.java:32)",
        "clojure.lang.AFn.applyToHelper(AFn.java:154)",
        "clojure.lang.AFn.applyTo(AFn.java:144)",
        "clojure.core$apply.invokeStatic(core.clj:665)",
        "clojure.core$apply.invoke(core.clj:660)",
        "--> mbql.normalize$canonicalize_mbql_clauses$fn__20632.invoke(normalize.clj:486)",
        "mbql.normalize$canonicalize_mbql_clauses.invokeStatic(normalize.clj:478)",
        "mbql.normalize$canonicalize_mbql_clauses.invoke(normalize.clj:475)",
        "mbql.normalize$canonicalize.invokeStatic(normalize.clj:501)",
        "mbql.normalize$canonicalize.invoke(normalize.clj:496)",
        "mbql.normalize$normalize_fragment.invokeStatic(normalize.clj:608)",
        "mbql.normalize$normalize_fragment.invoke(normalize.clj:599)",
        "mbql.normalize$normalize_fragment.invokeStatic(normalize.clj:609)",
        "mbql.normalize$normalize_fragment.invoke(normalize.clj:599)",
        "models.interface$normalize_metric_segment_definition.invokeStatic(interface.clj:87)",
        "models.interface$normalize_metric_segment_definition.invoke(interface.clj:85)",
        "api.metric$write_check_and_update_metric_BANG_.invokeStatic(metric.clj:80)",
        "api.metric$write_check_and_update_metric_BANG_.invoke(metric.clj:68)",
        "api.metric$fn__49569.invokeStatic(metric.clj:99)",
        "api.metric$fn__49569.invoke(metric.clj:85)",
        "middleware.auth$enforce_authentication$fn__59520.invoke(auth.clj:14)",
        "routes$fn__61175$fn__61176.doInvoke(routes.clj:113)",
        "middleware.exceptions$catch_uncaught_exceptions$fn__59611.invoke(exceptions.clj:104)",
        "middleware.exceptions$catch_api_exceptions$fn__59608.invoke(exceptions.clj:92)",
        "middleware.log$log_api_call$fn__61055$fn__61056.invoke(log.clj:168)",
        "middleware.log$log_api_call$fn__61055.invoke(log.clj:162)",
        "middleware.security$add_security_headers$fn__59574.invoke(security.clj:103)",
        "middleware.json$wrap_json_body$fn__60760.invoke(json.clj:61)",
        "middleware.json$wrap_streamed_json_response$fn__60778.invoke(json.clj:97)",
        "middleware.session$bind_current_user$fn__58230$fn__58231.invoke(session.clj:188)",
        "middleware.session$do_with_current_user.invokeStatic(session.clj:171)",
        "middleware.session$do_with_current_user.invoke(session.clj:165)",
        "middleware.session$bind_current_user$fn__58230.invoke(session.clj:187)",
        "middleware.session$wrap_current_user_id$fn__58219.invoke(session.clj:156)",
        "middleware.session$wrap_session_id$fn__58204.invoke(session.clj:118)",
        "middleware.auth$wrap_api_key$fn__59528.invoke(auth.clj:27)",
        "middleware.misc$maybe_set_site_url$fn__61118.invoke(misc.clj:54)",
        "middleware.misc$bind_user_locale$fn__61121.invoke(misc.clj:70)",
        "middleware.misc$add_content_type$fn__61108.invoke(misc.clj:29)",
        "middleware.misc$wrap_gzip$fn__61136.invoke(misc.clj:97)"
    ]
}
@flamber

This comment has been minimized.

Copy link
Contributor Author

commented May 1, 2019

@salsakran Ping - I would think this is a P1 bug?

@SuneelPodapati

This comment has been minimized.

Copy link

commented May 2, 2019

Found that I am able to update the metric only if I change the filter definition or aggregation definition. A simple description change or name change is not happening.

Version: 0.32.5

@user432wb

This comment has been minimized.

Copy link

commented May 8, 2019

I have the same issue. Specifically that I couldn't update the excluded values from a filter. As a workaround, you can add a second instance of the filter that excludes everything you want to excluded and then (no save in between here) remove (x) the original instance of the filter. This worked for me.

@cemsbr

This comment has been minimized.

Copy link

commented Jun 2, 2019

No workaround works for me in 0.32.8 for a particular segment. For another one, the workaround immediately above worked.

@naxels

This comment has been minimized.

Copy link

commented Jun 6, 2019

I found the same problem running 0.32.8 when trying to update a Segment

@ogeagla ogeagla referenced this issue Jun 19, 2019

Merged

Fix edit segments and metrics #10224

3 of 3 tasks complete

@ogeagla ogeagla self-assigned this Jun 20, 2019

@ogeagla ogeagla added this to the 0.33 milestone Jun 20, 2019

@ogeagla ogeagla closed this Jun 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.