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

ChatServiceClient.uploadAttachment does not work #5964

Open
7 tasks done
mitchierichie opened this issue Jan 16, 2025 · 2 comments
Open
7 tasks done

ChatServiceClient.uploadAttachment does not work #5964

mitchierichie opened this issue Jan 16, 2025 · 2 comments

Comments

@mitchierichie
Copy link

Please make sure you have searched for information in the following guides.

A screenshot that you have tested with "Try this API".

Uploading attachments to Google Chat via the Node.js Google Chat SDK is not working.

 interface IUploadAttachmentRequest {
    /** UploadAttachmentRequest parent */
    parent?: (string|null);

    /** UploadAttachmentRequest filename */
    filename?: (string|null);
}

Note that the interface does not have a property for the media body.

Example usage is something like this:

chatServiceClient.uploadAttachment({parent, filename}) as shown in the samples/docs.

Link to the code that reproduces this issue. A link to a public Github Repository or gist with a minimal reproduction.

https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.upload_attachment.js

A step-by-step description of how to reproduce the issue, based on the linked reproduction.

Follow the official sample in the link above

A clear and concise description of what the bug is, and what you expected to happen.

File attachment is not uploaded as expected, see this error:

Error: 13 INTERNAL: Internal error encountered.
    at callErrorFromStatus (/Users/mitchie/PhpstormProjects/mio-universal/tests/uat/node_modules/@grpc/grpc-js/src/call.ts:82:17)
    at Object.onReceiveStatus (/Users/mitchie/PhpstormProjects/mio-universal/tests/uat/node_modules/@grpc/grpc-js/src/client.ts:360:55)
    at Object.onReceiveStatus (/Users/mitchie/PhpstormProjects/mio-universal/tests/uat/node_modules/@grpc/grpc-js/src/client-interceptors.ts:458:34)
    at Object.onReceiveStatus (/Users/mitchie/PhpstormProjects/mio-universal/tests/uat/node_modules/@grpc/grpc-js/src/client-interceptors.ts:419:48)
    at /Users/mitchie/PhpstormProjects/mio-universal/tests/uat/node_modules/@grpc/grpc-js/src/resolving-call.ts:163:24
    at processTicksAndRejections (node:internal/process/task_queues:77:11)
for call at
    at ServiceClientImpl.makeUnaryRequest (/Users/mitchie/PhpstormProjects/mio-universal/tests/uat/node_modules/@grpc/grpc-js/src/client.ts:325:42)
    at ServiceClientImpl.<anonymous> (/Users/mitchie/PhpstormProjects/mio-universal/tests/uat/node_modules/@grpc/grpc-js/src/make-client.ts:189:15)
    at /Users/mitchie/PhpstormProjects/mio-universal/tests/uat/node_modules/@google-apps/chat/src/v1/chat_service_client.ts:357:25
    at /Users/mitchie/PhpstormProjects/mio-universal/tests/uat/node_modules/google-gax/build/src/normalCalls/timeout.js:44:16
    at repeat (/Users/mitchie/PhpstormProjects/mio-universal/tests/uat/node_modules/google-gax/build/src/normalCalls/retries.js:82:25)
    at /Users/mitchie/PhpstormProjects/mio-universal/tests/uat/node_modules/google-gax/build/src/normalCalls/retries.js:125:13
    at OngoingCallPromise.call (/Users/mitchie/PhpstormProjects/mio-universal/tests/uat/node_modules/google-gax/build/src/call.js:67:27)
    at NormalApiCaller.call (/Users/mitchie/PhpstormProjects/mio-universal/tests/uat/node_modules/google-gax/build/src/normalCalls/normalApiCaller.js:34:19)
    at /Users/mitchie/PhpstormProjects/mio-universal/tests/uat/node_modules/google-gax/build/src/createApiCall.js:112:30 {
  code: 13,
  details: 'Internal error encountered.',
  metadata: Metadata {
    internalRepr: Map(3) {
      'endpoint-load-metrics-bin' => [Array],
      'grpc-server-stats-bin' => [Array],
      'pc-high-bwd-bin' => [Array]
    },
    options: {}
  },
  note: 'Exception occurred in retry method that was not classified as transient'
}

A clear and concise description WHY you expect this behavior, i.e., was it a recent change, there is documentation that points to this behavior, etc. **

See the included sample and this documentation:

https://developers.google.com/workspace/chat/api/reference/rest/v1/media/upload

Copy link
Contributor

Issue was opened with an invalid reproduction link. Please make sure the repository is a valid, publicly-accessible github repository, and make sure the url is complete (example: https://github.com/googleapis/google-cloud-node)

@sofisl sofisl reopened this Jan 16, 2025
@mitchierichie
Copy link
Author

@sofisl thanks for reopening 🙏🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants