Hi! I'm trying to run the User Filter brick and I ...
# gooddata-platform
p
Hi! I'm trying to run the User Filter brick and I get the following error:
Copy code
Error during k8s execution: undefined method `uri' for nil:NilClass Did you mean? URI
What could be the cause? Configuration in thread >>>>
1
gd_encoded_params:
Copy code
{
  "segments_filter": [
    "segment_dso_default"
  ],
  "bigquery_client": {
    "connection": {
      "authentication": {
        "serviceAccount": {
          "clientEmail": "<redacted>",
          "privateKey": "${serviceAccount_privateKey}"
        }
      },
      "schema": "<redacted>",
      "project": "<redacted>"
    }
  },
  "input_source": {
    "type": "bigquery",
    "query": "SELECT * FROM <redacted>"
  },
  "filters_config": {
    "user_column": "login",
    "labels": [
      {
        "label": "clinic.cp__clinic",
        "column": "clinic__cp_clinic"
      }
    ]
  },
  "users_brick_config": {
    "login_column": "login",
    "input_source": {
      "type": "bigquery",
      "query": "SELECT * FROM <redacted>"
    }
  }
}
Other params:
Copy code
sync_mode: sync_domain_client_workspaces
ignore_missing_values: true
restrict_if_missing_all_values: true
data_product: dataproduct_dso
organization: <redacted>
serviceAccount_privateKey: <redacted, secure param>
Full error:
Copy code
E, [2022-05-20T17:36:15.581154 #6] ERROR -- : Execution failed. Error: [
  {
    "action": "GoodData::LCM2::SynchronizeUserFilters",
    "err": "undefined method `uri' for nil:NilClass\nDid you mean?  URI",
    "backtrace": [
      "/src/lib/gooddata/models/user_filters/user_filter_builder.rb:223:in `block in create_expression'",
      "org/jruby/RubyArray.java:2577:in `map'",
      "/src/lib/gooddata/models/user_filters/user_filter_builder.rb:222:in `create_expression'",
      "/src/lib/gooddata/models/user_filters/user_filter_builder.rb:338:in `block in maqlify_filters'",
      "/src/lib/gooddata/models/user_filters/user_filter_builder.rb:360:in `block in maqlify_filters'",
      "/usr/local/rvm/gems/jruby-9.2.5.0/gems/pmap-1.1.1/lib/pmap.rb:82:in `block in pmap'",
      "/usr/local/rvm/gems/jruby-9.2.5.0/gems/pmap-1.1.1/lib/pmap/thread_pool.rb:58:in `block in spawn_worker'"
    ]
  }
]
m
Hi Philippe, Can you please make sure you are using the correct sync_mode?
m
Hi Philippe, if it fails in the create_expression phase (when it creates the MAQL expression from the label and internal IDs of the values, I think there might be two reasons: • either you have incorrectly defined the label to be used • or there might be some invalid (empty or NULL) value in your data for filter value Looking at your configuration, I think it will be the first case.
"clinic.cp__clinic"
does not seem like a valid label identifier in GoodData. Here in the configuration you should not use the name of the column in your database (the ADD naming convention), but rather the identifier of the proper label object in your dataset. Identifiers of labels usually start with
label.
prefix and you can find their identifiers in the modeller. Click the “view details” on a dataset and then find the label identifier in the “ID” column. (be sure to use the label, not the attribute in this case). So I believe in your case you should use
label.clinic.clinic
instead of
clinic.cp__clinic
in your user filter brick configuration:
Copy code
"filters_config": {
    "user_column": "login",
    "labels": [{
      "label": "label.clinic.clinic",
      "column": "clinic__cp_clinic"
    }]
(The second parameter “column” is how the column with the filter values is called in your query. So its value is up to how your data is structured.)
1
p
Woot woot! @Michal Hauzírek Thanks, that solves it! I wasn't sure what to write as a value in the label field. Also thanks @Moises Morales for your answer 🙂