slackapi / node-slack-sdk

Slack Developer Kit for Node.js
https://tools.slack.dev/node-slack-sdk/
MIT License
3.27k stars 662 forks source link

File Upload API succeeds despite 408 Request Timeout #1541

Closed SusumuKanazawa closed 1 year ago

SusumuKanazawa commented 2 years ago

files.upload API successds despite 408 error.

same, python: https://github.com/slackapi/python-slack-sdk/issues/1165 java: https://github.com/slackapi/java-slack-sdk/pull/1065

sample

// fileSize: 8.4MB

  async fileUpload (filePath) {
    try {
      const client = new WebClient(this.TOKEN, {
        retryConfig: { retries: 1 },
        logLevel: LogLevel.DEBUG
      })

      const file = fs.readFileSync(filePath)
      const filename = path.basename(filePath)

      await client.files.upload({
        channels: this.channelId,
        file,
        filename
      })
    } catch (e) {
      throw new Error(`upload error: ${e}`)
    }
  }

error:

[WARN]  web-api:WebClient:0 http request failed An HTTP protocol error occurred: statusCode = 408
[WARN]  web-api:WebClient:0 http request failed An HTTP protocol error occurred: statusCode = 408
upload error: Error: An HTTP protocol error occurred: statusCode = 408

// files upload complete 2 files.

Packages:

Select all that apply:

Reproducible in:

slack/web-api: 6.7.2 node: v16.14.0 npm: 8.3.1 Mac OS: 11.6.7

seratch commented 2 years ago

Hi @SusumuKanazawa, thanks for taking the time to report this issue.

We are aware of this and are now working on the fix for it. Please refer to the pull requests adding a new way to upload files in a stable manner:

We will add the same to Node SDK sometime soon!

SusumuKanazawa commented 2 years ago

@seratch thanks.

srajiang commented 1 year ago

@SusumuKanazawa - Heads up that we have just merged support for files.uploadV2 in node-slack-sdk and its slated for release v6.8.0!

SusumuKanazawa commented 1 year ago

@srajiang very thanks!