<#2327 [BUG] ListNamedEntity breaks when passing a...
# flyte-github
a
#2327 [BUG] ListNamedEntity breaks when passing a filter with sortKey of created_at Issue created by pmahindrakar-oss Describe the bug By default flytectl uses created_at as sort key when listing flyte entities When making ListNamedEntities with workflow resource type , the current api breaks with the following error
Copy code
flytectl get workflow -p flytesnacks -d development                                  
Error: rpc error: code = Unknown desc = failed database operation with column "workflows.created_at" must appear in the GROUP BY clause or be used in an aggregate function
Similarly it breaks on passing a field selector too
Copy code
flytectl get workflow -p flytesnacks -d development --filter.fieldSelector "state=0"
Error: rpc error: code = Unknown desc = failed database operation with column "workflows.created_at" must appear in the GROUP BY clause or be used in an aggregate function
It returns correctly in case of project, domain, name
Copy code
flytectl get workflow -p flytesnacks -d development --filter.fieldSelector "state=0" --filter.sortBy "project"
 --------------- ------------- ------------------------------------------------------------- ------------- ------- 
| PROJECT (45)  | DOMAIN      | NAME                                                        | DESCRIPTION | STATE |
 --------------- ------------- ------------------------------------------------------------- ------------- ------- 
| flytesnacks   | development | core.containerization.use_secrets.my_secret_workflow        |             |       |
 --------------- ------------- ------------------------------------------------------------- ------------- ------- 
| flytesnacks   | development | core.control_flow.chain_tasks.chain_tasks_wf                |             |       |
 --------------- ------------- ------------------------------------------------------------- ------------- -------
Expected behavior Named Entities should be able to sorted by created_at Additional context to reproduce No response Screenshots No response Are you sure this issue hasn't been raised already? ☑︎ Yes Have you read the Code of Conduct? ☑︎ Yes flyteorg/flyte