• b

    Babis Kiosidis

    5 months ago
    Hey, it seems that the UpdateProjectDomainAttributes fails on the actual update flyteadmin:v0.6.92 , is it expected functionality? It used to work with simply overriding the existing domain attribute [error in 🧵 ]
  • $ flyte-cli  -h flyteadmin.host  update-cluster-resource-attributes -p flyte-java-build-test -d production --attributes ksa_annotation ksa_value
    
    
    Traceback (most recent call last):
      File "/Users/babisk/.pyenv/versions/3.8.9/lib/python3.8/site-packages/flytekit/clients/raw.py", line 131, in handler
        return fn(*args, **kwargs)
      File "/Users/babisk/.pyenv/versions/3.8.9/lib/python3.8/site-packages/flytekit/clients/raw.py", line 701, in update_project_domain_attributes
        return self._stub.UpdateProjectDomainAttributes(
      File "/Users/babisk/.pyenv/versions/3.8.9/lib/python3.8/site-packages/grpc/_channel.py", line 946, in __call__
        return _end_unary_response_blocking(state, call, False, None)
      File "/Users/babisk/.pyenv/versions/3.8.9/lib/python3.8/site-packages/grpc/_channel.py", line 849, in _end_unary_response_blocking
        raise _InactiveRpcError(state)
    grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
    	status = StatusCode.ALREADY_EXISTS
    	details = "value with matching already exists (duplicate key value violates unique constraint "resource_idx")"
    	debug_error_string = "{"created":"@1645702544.400290000","description":"Error received from peer ipv4:10.173.33.105:8443","file":"src/core/lib/surface/call.cc","file_line":1070,"grpc_message":"value with matching already exists (duplicate key value violates unique constraint "resource_idx")","grpc_status":6}"
    >
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/Users/babisk/.pyenv/versions/3.8.9/bin/flyte-cli", line 8, in <module>
        sys.exit(_flyte_cli())
      File "/Users/babisk/.pyenv/versions/3.8.9/lib/python3.8/site-packages/click/core.py", line 829, in __call__
        return self.main(*args, **kwargs)
      File "/Users/babisk/.pyenv/versions/3.8.9/lib/python3.8/site-packages/click/core.py", line 782, in main
        rv = self.invoke(ctx)
      File "/Users/babisk/.pyenv/versions/3.8.9/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
      File "/Users/babisk/.pyenv/versions/3.8.9/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
        return ctx.invoke(self.callback, **ctx.params)
      File "/Users/babisk/.pyenv/versions/3.8.9/lib/python3.8/site-packages/click/core.py", line 610, in invoke
        return callback(*args, **kwargs)
      File "/Users/babisk/.pyenv/versions/3.8.9/lib/python3.8/site-packages/flytekit/clis/flyte_cli/main.py", line 2189, in update_cluster_resource_attributes
        client.update_project_domain_attributes(project, domain, matching_attributes)
      File "/Users/babisk/.pyenv/versions/3.8.9/lib/python3.8/site-packages/flytekit/clients/friendly.py", line 902, in update_project_domain_attributes
        super(SynchronousFlyteClient, self).update_project_domain_attributes(
      File "/Users/babisk/.pyenv/versions/3.8.9/lib/python3.8/site-packages/flytekit/clients/raw.py", line 145, in handler
        raise _user_exceptions.FlyteEntityAlreadyExistsException(e)
    flytekit.common.exceptions.user.FlyteEntityAlreadyExistsException: <_InactiveRpcError of RPC that terminated with:
    	status = StatusCode.ALREADY_EXISTS
    	details = "value with matching already exists (duplicate key value violates unique constraint "resource_idx")"
    	debug_error_string = "{"created":"@1645702544.400290000","description":"Error received from peer ipv4:10.173.33.105:8443","file":"src/core/lib/surface/call.cc","file_line":1070,"grpc_message":"value with matching already exists (duplicate key value violates unique constraint "resource_idx")","grpc_status":6}"
  • it used to work on a previous version
  • p

    Prafulla Mahindrakar

    5 months ago
    Hi @Babis Kiosidis, Do you mind trying the same using flytectlhttps://docs.flyte.org/projects/flytectl/en/latest/gen/flytectl_update_cluster-resource-attribute.html attr.yaml
    domain: production
    project: flyte-java-build-test
    attributes:
      ksa_annotation: "ksa_value"
    flytectl update cluster-resource-attribute --attrFile attr.yaml
    I tried the same on latest admin and it worked when i fired multiple requests.
  • Ketan (kumare3)

    Ketan (kumare3)

    5 months ago
    @Babis Kiosidis we are moving to flytectl and flytecli will return, but want to change the api
  • And not break people
  • b

    Babis Kiosidis

    5 months ago
    Ah thanks! Actually I used flyte-cli only to illustrate the example. The error we noticed it in a k8s operator that talks to flyteadmin. Running the UpdateProjectDomainAttributes seems to fail when the key exists (overwrite), so we had to introduce a delete before changing the value.
  • p

    Prafulla Mahindrakar

    5 months ago
    Thanks for reporting this issue. Sending out a fix for it .