Skip to content

Commit 8e9fe89

Browse files
committed
fix: load agent for ws to support proxy during transfer
log errors when the transfer task faill ex error we will be able to see when we run the transfer task: console.error(e) ``` ProviderTransferError at WebSocket.<anonymous> (/builds/web/cms/node_modules/ @strapi/data-transfer/dist/strapi/providers/utils.js:158:20) at Object.onceWrapper (node:events:639:26) at WebSocket.emit (node:events:524:28) at WebSocket.emit (node:domain:489:12) at emitErrorAndClose (/builds/web/cms/node_modules/ws/lib/ websocket.js:1035:13) at ClientRequest.<anonymous> (/builds/web/cms/node_modules/ ws/lib/websocket.js:880:5) at ClientRequest.emit (node:events:524:28) at ClientRequest.emit (node:domain:489:12) at emitErrorEvent (node:_http_client:101:11) at TLSSocket.socketErrorListener (node:_http_client:504:5) { origin: 'provider', severity: 'fatal', details: { step: 'transfer', details: { details: [Object] } } } ``` console.error(e.details.details) ``` { details: { error: '' } } ```` And the default error message we used to see: `Transfer process failed.`
1 parent 1177bc9 commit 8e9fe89

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

packages/core/strapi/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@
150150
"fs-extra": "11.2.0",
151151
"get-latest-version": "5.1.0",
152152
"git-url-parse": "14.0.0",
153+
"global-agent": "3.0.0",
153154
"html-webpack-plugin": "5.6.0",
154155
"inquirer": "8.2.5",
155156
"lodash": "4.17.21",
@@ -176,6 +177,7 @@
176177
"devDependencies": {
177178
"@strapi/ts-zen": "^0.2.0",
178179
"@types/fs-extra": "11.0.4",
180+
"@types/global-agent": "2.1.3",
179181
"@types/jest": "29.5.2",
180182
"@types/lodash": "^4.14.191",
181183
"@types/node": "18.19.24",

packages/core/strapi/src/cli/commands/transfer/action.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import 'global-agent/bootstrap';
12
import { isObject } from 'lodash/fp';
23
import { engine as engineDataTransfer, strapi as strapiDataTransfer } from '@strapi/data-transfer';
34

@@ -189,6 +190,9 @@ export default async (opts: CmdOptions) => {
189190

190191
exitWith(0, exitMessageText('transfer'));
191192
} catch (e) {
193+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
194+
// @ts-ignore: the key exists...
195+
console.error(e, e?.details?.details);
192196
await strapi.telemetry.send('didDEITSProcessFail', getTransferTelemetryPayload(engine));
193197
exitWith(1, exitMessageText('transfer', true));
194198
}

yarn.lock

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9683,6 +9683,7 @@ __metadata:
96839683
"@strapi/upload": "npm:5.14.0"
96849684
"@strapi/utils": "npm:5.14.0"
96859685
"@types/fs-extra": "npm:11.0.4"
9686+
"@types/global-agent": "npm:2.1.3"
96869687
"@types/jest": "npm:29.5.2"
96879688
"@types/lodash": "npm:^4.14.191"
96889689
"@types/node": "npm:18.19.24"
@@ -9711,6 +9712,7 @@ __metadata:
97119712
fs-extra: "npm:11.2.0"
97129713
get-latest-version: "npm:5.1.0"
97139714
git-url-parse: "npm:14.0.0"
9715+
global-agent: "npm:3.0.0"
97149716
html-webpack-plugin: "npm:5.6.0"
97159717
inquirer: "npm:8.2.5"
97169718
jest: "npm:29.6.0"

0 commit comments

Comments
 (0)