# Search with Custom attributes is failing with INVALID\_ARGUMENT unable to filter

**URL:** <https://community.temporal.io/t/search-with-custom-attributes-is-failing-with-invalid-argument-unable-to-filter/7469>\
**Category:** Community Support\
**Tags:** java-sdk\
**Created:** [March 3, 2023, 10:54am UTC](https://community.temporal.io/t/search-with-custom-attributes-is-failing-with-invalid-argument-unable-to-filter/7469 "2023-03-03T10:54:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kiran\_S](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/kiran_s/32/3430_2.png) [@kiran\_S](https://community.temporal.io/u/kiran_S)\
**Post date:** [March 3, 2023, 10:54am UTC](https://community.temporal.io/t/search-with-custom-attributes-is-failing-with-invalid-argument-unable-to-filter/7469/1 "2023-03-03T10:54:42Z")

</div>

While doing the query with custom attribute with tctl or from web ui we are getting **INVALID\_ARGUMENT: invalid query: unable to convert filter expression: unable to convert left part of comparison expression: filter by ‘BusinessKey1’ not supported for standard visibility** in one of the environment but with the same configuration in other environment its working. Any idea how to debug the issue. Current Temporal java sdk version used 1.18.1 and temporal server version is 1.18.0 and temporal ui version is 2.6.1 in both the environments

---

<div class="post-metadata">

**Author:** ![tihomir](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/tihomir/32/6580_2.png) [@tihomir](https://community.temporal.io/u/tihomir)\
**Post date:** [March 3, 2023, 2:37pm UTC](https://community.temporal.io/t/search-with-custom-attributes-is-failing-with-invalid-argument-unable-to-filter/7469/2 "2023-03-03T14:37:09Z")

</div>

Can you compare (and share if possible) your static configs (you can bash into one of your service pods and look at /etc/temporal/config/docker.yaml) please?

---

<div class="post-metadata">

**Author:** ![kiran\_S](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/kiran_s/32/3430_2.png) [@kiran\_S](https://community.temporal.io/u/kiran_S)\
**Post date:** [March 7, 2023, 12:42pm UTC](https://community.temporal.io/t/search-with-custom-attributes-is-failing-with-invalid-argument-unable-to-filter/7469/3 "2023-03-07T12:42:39Z")

</div>

Thanks for the information.It worked

---

<div class="post-metadata">

**Author:** ![jackklika](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/jackklika/32/4615_2.png) [@jackklika](https://community.temporal.io/u/jackklika)\
**Post date:** [November 29, 2023, 4:42pm UTC](https://community.temporal.io/t/search-with-custom-attributes-is-failing-with-invalid-argument-unable-to-filter/7469/4 "2023-11-29T16:42:46Z")

</div>

I’m getting the same error. From the python client that is failing:

```auto
temporalio.service.RPCError: invalid query: unable to convert filter expression: unable to convert left side of "AccountId = 'xxx'": filter by 'AccountId' not supported for standard visibility

```

I have added the search attribute (sshing into temporal frontend container)

```auto
temporal-frontend-769db9864b-jf8r5:/etc/temporal$ temporal operator search-attribute create --name AccountId --type Text
Search attributes already exist

```

And this works on my local machine using the temporal dev server. Here is an example of the /etc/temporal/config/docker.yaml

```auto
persistence:                               
  defaultStore: default                    
  visibilityStore: visibility              
  numHistoryShards: 512                    
  datastores:                              
    default:                               
      sql:                                 
        pluginName: "postgres"             
        driverName: "postgres"             
        databaseName: "temporal"           
        connectAddr: "XXX:5432"    
        connectProtocol: "tcp"             
        user: XXX                     
        password: "XXX" 
        maxConnLifetime: 1h                
        maxConns: 20                       
        secretName: ""                     
    visibility:                            
      sql:                                 
        pluginName: "postgres"             
        driverName: "postgres"             
        databaseName: "temporal_visibility"
        connectAddr: "XXX:5432"   
        connectProtocol: "tcp"            
        user: "XXX"                  
        password: "XXX"
        maxConnLifetime: 1h        
        maxConns: 20               
        secretName: ""   

global:
  membership:
    name: temporal
    maxJoinDuration: 30s
    broadcastAddress: 10.1.0.165

  pprof:
    port: 7936

  metrics:
    tags:
      type: frontend
    prometheus:
      timerType: histogram
      listenAddress: "0.0.0.0:9090"

services:
  frontend:
    rpc:
      grpcPort: 7233
      membershipPort: 6933
      bindOnIP: "0.0.0.0"

  history:
    rpc:
      grpcPort: 7234
      membershipPort: 6934
      bindOnIP: "0.0.0.0"

  matching:
    rpc:
      grpcPort: 7235
      membershipPort: 6935
      bindOnIP: "0.0.0.0"

  worker:
    rpc:
      grpcPort: 7239
      membershipPort: 6939
      bindOnIP: "0.0.0.0"
clusterMetadata:
  enableGlobalDomain: false
  failoverVersionIncrement: 10
  masterClusterName: "active"
  currentClusterName: "active"
  clusterInformation:
    active:
      enabled: true
      initialFailoverVersion: 1
      rpcName: "XXX"
      rpcAddress: "127.0.0.1:7933"
dcRedirectionPolicy:
  policy: "noop"
  toDC: ""
archival:
  status: "disabled"

publicClient:
  hostPort: "temporal-frontend:7233"

dynamicConfigClient:
  filepath: "/etc/temporal/dynamic_config/dynamic_config.yaml"

```

I’ve made sure the schemas are up to date, postgres is version 14, and the following is the output of inspecting the cluster using the temporal cli:

```auto
jack@terminal temporal % temporal operator cluster describe
  ClusterName PersistenceStore VisibilityStore  
  active postgres postgres         
jack@terminal temporal % temporal operator cluster system        
  ServerVersion SupportsSchedules UpsertMemo  
  1.22.2 true true        
jack@terminal temporal % 

```

As I’m writing this, I figured it out. My database was using schema v96 instead of v12. Advanced visiblity is only available on postgres12. Since these are not sequential, this really confused me (intuitively 96\>12?). I updated the temporal visibility to v12 schema version 1.3, changed plugin name from pluginName: “postgres” to pluginName: “postgres12”, and all is well
