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] Timeout Error is thrown when importing records that contain large attachments #525

Open
hung-cybo opened this issue Oct 13, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@hung-cybo
Copy link
Contributor

hung-cybo commented Oct 13, 2023

Summary

A timeout error is thrown when importing records that contain large attachments.

[2023-10-13T09:07:39.468Z] INFO: Starting to import records...
[2023-10-13T09:08:40.451Z] INFO: Imported 0 of 1 records successfully
[2023-10-13T09:08:40.452Z] ERROR: Failed to add all records.
[2023-10-13T09:08:40.452Z] ERROR: No records are processed successfully.
[2023-10-13T09:08:40.452Z] ERROR: [ECONNABORTED] timeout of 60000ms exceeded
[2023-10-13T09:08:40.452Z] ERROR: The cli-kintone aborted due to a network error.
[2023-10-13T09:08:40.452Z] ERROR: Please check your network connection.

Root cause of the issue

The follow-redirects library used by the Axios has a problem. This library provides http(s) requests with the following redirects. The Axios uses it internally if the client requires the following redirects here.

The 'follow-redirects' provides its own implementation of setTimeout(). This implementation NEVER considers in-progress requests. The request produced by follow-redirects emits a 'timeout' event if the request is still in progress. The reason why we can download huge attachment files is the time is canceled when the client receives a response from the server.

The related issues on follow-redirects:

Target Version

v1.10.0

Reproduction

$ cat records.csv
"Attachment"
"Attachment-1/1gb"

$ ls -l attachments/Attachment-1/1gb
-rw-r--r-- 1 shinya-u shinya-u 1073741824 Sep 14 05:09 attachments/Attachment-1/1gb

$ cli-kintone record import --base-url https://****kintone.com --app 9 --attachments-dir attachments --file-path records.csv

Expected Behavior

Should importing successfully

Actual Behavior

A timeout error is thrown.

[2023-09-14T05:09:29.317Z] INFO: Starting to import records...
[2023-09-14T05:10:29.905Z] INFO: Imported 0 of 1 records successfully
[2023-09-14T05:10:29.906Z] ERROR: Failed to add all records.
[2023-09-14T05:10:29.906Z] ERROR: No records are processed successfully.
[2023-09-14T05:10:29.906Z] ERROR: [ECONNABORTED] timeout of 60000ms exceeded
[2023-09-14T05:10:29.906Z] ERROR: The cli-kintone aborted due to a network error.
[2023-09-14T05:10:29.906Z] ERROR: Please check your network connection.

Operation System (if relevant)

No response

Shell (if relevant)

No response

@hung-cybo hung-cybo added the bug Something isn't working label Oct 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant