Skip to content

Data transfer transfer websocket connection dies due to memory leak #17749

@derrickmehaffy

Description

@derrickmehaffy

Bug report

Required System information

  • Node.js version: v18
  • NPM version: v9
  • Strapi version: v4.12.5 (though various versions in v4.12.x)
  • Database: SQLite, PG, MySQL, MariaDB
  • Operating system: Linux Mint 21.2
  • Is your project Javascript or Typescript: Javascript

Describe the bug

When executing a transfer (regardless of push/pull) at some point the websocket connection may die (latency, network outage, ect) and the transfer will stall and fail with similar though not exact errors.

From TID4618

error: [ERROR] WebSocket is not open: readyState 3 (CLOSED)
Transfer process failed.

From TID4617

Starting transfer...
✔ entities: 701 transfered (size: 661.4 KB) (elapsed: 825 ms)
✔ assets: 570 transfered (size: 51.2 MB) (elapsed: 3676 ms)
✖ links: 1047 transfered (size: 209.3 KB) (elapsed: 15374 ms)
[2023-08-21 18:01:51.209] error: [ERROR] WebSocket is not open: readyState 3 (CLOSED)
Transfer process failed.

From TID4602
image

Steps to reproduce the behavior

Reproducing is quite difficult, it appears related to high network latency or a spotty internet connection. So far the support team has not been able to reproduce.

Expected behavior

If the websocket connection temp breaks we should re-establish the the connection and continue the transfer

Screenshots

N/A

Code snippets

N/A

Additional context

Related to the following Internal TID:

  • 4617
  • 4618
  • 4602

(There are more but will add them as we find them)

Most likely related to #14417 or a new memory leak. Effectively the asset transfer causes a memory leak that leads to the destination server running out of memory and crashing/restarting which terminates the websocket connection.

Metadata

Metadata

Labels

flag: EEIssues correlates to internal EE ticketissue: bugIssue reporting a bugseverity: criticalIf the issue has a security impact or breaks core usage of the productsource: core:data-transferSource is core/data-transfer packagestatus: confirmedConfirmed by a Strapi Team member or multiple community members

Type

No type

Projects

Status

Fixed/Shipped

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions