Skip to content
This repository has been archived by the owner on Jun 19, 2022. It is now read-only.

Wrong error message when failed to verify Pub/Sub topic exists #1672

Closed
zhongduo opened this issue Sep 9, 2020 · 1 comment · Fixed by #1675
Closed

Wrong error message when failed to verify Pub/Sub topic exists #1672

zhongduo opened this issue Sep 9, 2020 · 1 comment · Fixed by #1675
Assignees
Labels
kind/bug Something isn't working

Comments

@zhongduo
Copy link
Contributor

zhongduo commented Sep 9, 2020

Describe the bug
When the system failed to verify Pub/Sub topic exists, the error message in broker status is shown as before instead of real cause:

  - lastTransitionTime: "2020-09-09T13:23:24Z"
    message: 'Failed to verify Pub/Sub topic exists: %!w(*status.Error=&{0xc0024ffe60})'
    reason: TopicVerificationFailed

Expected behavior
The message should print out the detailed reason of the failure.

To Reproduce
Without a valid service account, create the GCP broker. Then check status part in the yaml of the broker.

Knative-GCP release version

Additional context
Add any other context about the problem here such as proposed priority

@zhongduo zhongduo added the kind/bug Something isn't working label Sep 9, 2020
@zhongduo zhongduo self-assigned this Sep 9, 2020
@zhongduo
Copy link
Contributor Author

zhongduo commented Sep 9, 2020

Experiment shows that %w does not invoke the Error() string method that the error type provides for proper struct formatting. Changing to %v fixed the problem. Example output after fix:

- lastTransitionTime: "2020-09-09T14:13:41Z"
    message: |-
      Failed to verify Pub/Sub topic exists: rpc error: code = Unauthenticated desc = transport: oauth2: cannot fetch token: 400 Bad Request
      Response: {"error":"invalid_grant","error_description":"Invalid JWT Signature."}
    reason: TopicVerificationFaile

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

Successfully merging a pull request may close this issue.

1 participant