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

[BUG] Sending cloud events from flyteadmin not documented properly for GCP and results in errors #3663

Closed
2 tasks done
fg91 opened this issue May 10, 2023 · 1 comment · Fixed by #6334
Closed
2 tasks done
Assignees
Labels
bug Something isn't working stale

Comments

@fg91
Copy link
Member

fg91 commented May 10, 2023

Describe the bug

How the cloud events integration of flyteadmin can be configured is documented here.

For GCP, for instance, it says:

         cloud_events.yaml: |
           cloudEvents:
             enable: true
             gcp:
               region: us-east-2
             eventsPublisher:
               eventTypes:
               - all # or node, task, workflow
               topicName: my-topic
             type: gcp

When including such a config in the helm values file, the following error is raised in flyteadmin:

{"json":{},"level":"fatal","msg":"caught panic: project id is required [goroutine 1 [running]:\nruntime/debug.Stack()\n\t/usr/local/go/src/runtime/debug/stack.go:24 +0x65\ngithub.ghproxy.top/flyteorg/flyteadmin/pkg/rpc/adminservice.NewAdminServer.func1()\n\t/go/src/github.com/flyteorg/flyteadmin/pkg/rpc/adminservice/base.go:74 +0x88\npanic({0x2273960, 0xc0013f1dd0})\n\t/usr/local/go/src/runtime/panic.go:838 +0x207\ngithub.ghproxy.top/flyteorg/flyteadmin/pkg/async/cloudevent.NewCloudEventsPublisher({0x2c04440, 0xc000128000}, {0x1, {0xc00051b4e8, 0x3}, {{0xc00051b470, 0xb}}, {{0x0, 0x0}}, {{0x0, ...}, ...}, ...}, ...)\n\t/go/src/github.com/flyteorg/flyteadmin/pkg/async/cloudevent/factory.go:61 +0x905\ngithub.ghproxy.top/flyteorg/flyteadmin/pkg/rpc/adminservice.NewAdminServer({0x2c04440?, 0xc000128000}, 0xc0006a3b80, {0x2c0cb60, 0xc00058c6c0}, {0x0, 0x0}, {0x0, 0x0}, 0xc000b563c0, ...)\n\t/go/src/github.com/flyteorg/flyteadmin/pkg/rpc/adminservice/base.go:103 +0x845\ngithub.ghproxy.top/flyteorg/flyteadmin/pkg/

When setting the projectId instead of the region as done here, this error disappears.

However, the resulting yaml file in the flyteadmin configmap still contains aws config:

❯ k -n flyte get configmaps flyte-admin-base-config -o yaml
apiVersion: v1
data:
  cloud_events.yaml: "cloudEvents: \n  aws:\n    region: us-east-2\n  enable: true\n
    \ eventsPublisher:\n    eventTypes:\n    - all\n    topicName: <my-topic>\n
    \ gcp:\n    projectId: <my-project>\n  type: gcp\n"

Despite the unintended aws config, the published events do make it to GCP pub/sub and can be pulled in the cloud console.

However, even though the messages can successfully be pulled from the pub sub topic/subscription, flyteadmin always shows error logs:

{"json":{"exec_id":"b862f22a535442bda2e4","node":"n0"},"level":"error","msg":"Failed to publish a message with key [flyteidl.admin.TaskExecutionEventRequest] and message [Context Attributes,\n  specversion: 1.0\n  type: com.flyte.resource.flyteidl.admin.TaskExecutionEventRequest\n   ... ] and error: context canceled","ts":"2023-05-10T11:46:42Z"}
{"json":{"exec_id":"b862f22a535442bda2e4","node":"n0"},"level":"error","msg":"Failed to send message [event:\u003ctask_id:\u003cresource_type:TASK ... ] with error: context canceled","ts":"2023-05-10T11:46:42Z"}

Expected behavior

  • The documentation should not say to add the region for GCP but the projedId.
  • When configuring GCP, the resulting configmap should not contain AWS config.
  • Flyteadmin should not show errors even though the published events make it to pub/sub and can be pulled from there.

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
@fg91 fg91 added bug Something isn't working untriaged This issues has not yet been looked at by the Maintainers labels May 10, 2023
@eapolinario eapolinario removed the untriaged This issues has not yet been looked at by the Maintainers label May 12, 2023
@eapolinario eapolinario self-assigned this May 12, 2023
Copy link

github-actions bot commented Feb 7, 2024

Hello 👋, this issue has been inactive for over 9 months. To help maintain a clean and focused backlog, we'll be marking this issue as stale and will engage on it to decide if it is still applicable.
Thank you for your contribution and understanding! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants