Skip to content

Commit a56bce9

Browse files
authored
[WI 2129366][BashV3] Add explicit error message for OOM error (#19529)
* [US 2129366] Add 137 explicit error message for BashV3 task * Bump task version
1 parent a09e055 commit a56bce9

File tree

13 files changed

+43
-19
lines changed

13 files changed

+43
-19
lines changed

Tasks/BashV3/Strings/resources.resjson/en-US/resources.resjson

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"loc.input.help.bashEnvValue": "If input is specified, it's value is expanded and used as the path of a startup file to execute before running the script. If the environment variable `BASH_ENV` has already been defined, the task will override this variable only for the current task. You can find more details by [link](https://www.gnu.org/software/bash/manual/html_node/Bash-Startup-Files.html).",
2020
"loc.messages.GeneratingScript": "Generating script.",
2121
"loc.messages.JS_ExitCode": "Bash exited with code '%s'.",
22+
"loc.messages.JS_ExitCode_137": "Bash exited with code 137, which means it ran out of memory. Make sure the agent (container) host has sufficient memory configured.",
2223
"loc.messages.JS_FormattedCommand": "Formatted command: %s",
2324
"loc.messages.JS_InvalidFilePath": "Invalid file path '%s'.",
2425
"loc.messages.JS_ScriptContents": "Script contents:",

Tasks/BashV3/bash.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,12 @@ async function run() {
206206

207207
// Fail on exit code.
208208
if (exitCode !== 0) {
209-
tl.error(tl.loc('JS_ExitCode', exitCode));
209+
if (exitCode == 137) {
210+
tl.error(tl.loc('JS_ExitCode_137'));
211+
}
212+
else {
213+
tl.error(tl.loc('JS_ExitCode', exitCode));
214+
}
210215
result = tl.TaskResult.Failed;
211216
}
212217

Tasks/BashV3/task.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"author": "Microsoft Corporation",
1818
"version": {
1919
"Major": 3,
20-
"Minor": 235,
20+
"Minor": 236,
2121
"Patch": 0
2222
},
2323
"releaseNotes": "Script task consistency. Added support for multiple lines and added support for Windows.",
@@ -116,6 +116,7 @@
116116
"messages": {
117117
"GeneratingScript": "Generating script.",
118118
"JS_ExitCode": "Bash exited with code '%s'.",
119+
"JS_ExitCode_137": "Bash exited with code 137, which means it ran out of memory. Make sure the agent (container) host has sufficient memory configured.",
119120
"JS_FormattedCommand": "Formatted command: %s",
120121
"JS_InvalidFilePath": "Invalid file path '%s'.",
121122
"JS_ScriptContents": "Script contents:",

Tasks/BashV3/task.loc.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"author": "Microsoft Corporation",
1818
"version": {
1919
"Major": 3,
20-
"Minor": 235,
20+
"Minor": 236,
2121
"Patch": 0
2222
},
2323
"releaseNotes": "ms-resource:loc.releaseNotes",
@@ -116,6 +116,7 @@
116116
"messages": {
117117
"GeneratingScript": "ms-resource:loc.messages.GeneratingScript",
118118
"JS_ExitCode": "ms-resource:loc.messages.JS_ExitCode",
119+
"JS_ExitCode_137": "ms-resource:loc.messages.JS_ExitCode_137",
119120
"JS_FormattedCommand": "ms-resource:loc.messages.JS_FormattedCommand",
120121
"JS_InvalidFilePath": "ms-resource:loc.messages.JS_InvalidFilePath",
121122
"JS_ScriptContents": "ms-resource:loc.messages.JS_ScriptContents",

_generated/BashV3.versionmap.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Default|3.235.0
2-
Node20-225|3.235.1
1+
Default|3.236.0
2+
Node20-225|3.236.1

_generated/BashV3/Strings/resources.resjson/en-US/resources.resjson

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"loc.input.help.bashEnvValue": "If input is specified, it's value is expanded and used as the path of a startup file to execute before running the script. If the environment variable `BASH_ENV` has already been defined, the task will override this variable only for the current task. You can find more details by [link](https://www.gnu.org/software/bash/manual/html_node/Bash-Startup-Files.html).",
2020
"loc.messages.GeneratingScript": "Generating script.",
2121
"loc.messages.JS_ExitCode": "Bash exited with code '%s'.",
22+
"loc.messages.JS_ExitCode_137": "Bash exited with code 137, which means it ran out of memory. Make sure the agent (container) host has sufficient memory configured.",
2223
"loc.messages.JS_FormattedCommand": "Formatted command: %s",
2324
"loc.messages.JS_InvalidFilePath": "Invalid file path '%s'.",
2425
"loc.messages.JS_ScriptContents": "Script contents:",

_generated/BashV3/bash.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,12 @@ async function run() {
206206

207207
// Fail on exit code.
208208
if (exitCode !== 0) {
209-
tl.error(tl.loc('JS_ExitCode', exitCode));
209+
if (exitCode == 137) {
210+
tl.error(tl.loc('JS_ExitCode_137'));
211+
}
212+
else {
213+
tl.error(tl.loc('JS_ExitCode', exitCode));
214+
}
210215
result = tl.TaskResult.Failed;
211216
}
212217

_generated/BashV3/task.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"author": "Microsoft Corporation",
1818
"version": {
1919
"Major": 3,
20-
"Minor": 235,
20+
"Minor": 236,
2121
"Patch": 0
2222
},
2323
"releaseNotes": "Script task consistency. Added support for multiple lines and added support for Windows.",
@@ -116,6 +116,7 @@
116116
"messages": {
117117
"GeneratingScript": "Generating script.",
118118
"JS_ExitCode": "Bash exited with code '%s'.",
119+
"JS_ExitCode_137": "Bash exited with code 137, which means it ran out of memory. Make sure the agent (container) host has sufficient memory configured.",
119120
"JS_FormattedCommand": "Formatted command: %s",
120121
"JS_InvalidFilePath": "Invalid file path '%s'.",
121122
"JS_ScriptContents": "Script contents:",
@@ -125,7 +126,7 @@
125126
"ScriptArgsSanitized": "Detected characters in arguments that may not be executed correctly by the shell. Please escape special characters using backslash (\\). More information is available here: https://aka.ms/ado/75787"
126127
},
127128
"_buildConfigMapping": {
128-
"Default": "3.235.0",
129-
"Node20-225": "3.235.1"
129+
"Default": "3.236.0",
130+
"Node20-225": "3.236.1"
130131
}
131132
}

_generated/BashV3/task.loc.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"author": "Microsoft Corporation",
1818
"version": {
1919
"Major": 3,
20-
"Minor": 235,
20+
"Minor": 236,
2121
"Patch": 0
2222
},
2323
"releaseNotes": "ms-resource:loc.releaseNotes",
@@ -116,6 +116,7 @@
116116
"messages": {
117117
"GeneratingScript": "ms-resource:loc.messages.GeneratingScript",
118118
"JS_ExitCode": "ms-resource:loc.messages.JS_ExitCode",
119+
"JS_ExitCode_137": "ms-resource:loc.messages.JS_ExitCode_137",
119120
"JS_FormattedCommand": "ms-resource:loc.messages.JS_FormattedCommand",
120121
"JS_InvalidFilePath": "ms-resource:loc.messages.JS_InvalidFilePath",
121122
"JS_ScriptContents": "ms-resource:loc.messages.JS_ScriptContents",
@@ -125,7 +126,7 @@
125126
"ScriptArgsSanitized": "ms-resource:loc.messages.ScriptArgsSanitized"
126127
},
127128
"_buildConfigMapping": {
128-
"Default": "3.235.0",
129-
"Node20-225": "3.235.1"
129+
"Default": "3.236.0",
130+
"Node20-225": "3.236.1"
130131
}
131132
}

_generated/BashV3_Node20/Strings/resources.resjson/en-US/resources.resjson

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"loc.input.help.bashEnvValue": "If input is specified, it's value is expanded and used as the path of a startup file to execute before running the script. If the environment variable `BASH_ENV` has already been defined, the task will override this variable only for the current task. You can find more details by [link](https://www.gnu.org/software/bash/manual/html_node/Bash-Startup-Files.html).",
2020
"loc.messages.GeneratingScript": "Generating script.",
2121
"loc.messages.JS_ExitCode": "Bash exited with code '%s'.",
22+
"loc.messages.JS_ExitCode_137": "Bash exited with code 137, which means it ran out of memory. Make sure the agent (container) host has sufficient memory configured.",
2223
"loc.messages.JS_FormattedCommand": "Formatted command: %s",
2324
"loc.messages.JS_InvalidFilePath": "Invalid file path '%s'.",
2425
"loc.messages.JS_ScriptContents": "Script contents:",

_generated/BashV3_Node20/bash.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,12 @@ async function run() {
206206

207207
// Fail on exit code.
208208
if (exitCode !== 0) {
209-
tl.error(tl.loc('JS_ExitCode', exitCode));
209+
if (exitCode == 137) {
210+
tl.error(tl.loc('JS_ExitCode_137'));
211+
}
212+
else {
213+
tl.error(tl.loc('JS_ExitCode', exitCode));
214+
}
210215
result = tl.TaskResult.Failed;
211216
}
212217

_generated/BashV3_Node20/task.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"author": "Microsoft Corporation",
1818
"version": {
1919
"Major": 3,
20-
"Minor": 235,
20+
"Minor": 236,
2121
"Patch": 1
2222
},
2323
"releaseNotes": "Script task consistency. Added support for multiple lines and added support for Windows.",
@@ -120,6 +120,7 @@
120120
"messages": {
121121
"GeneratingScript": "Generating script.",
122122
"JS_ExitCode": "Bash exited with code '%s'.",
123+
"JS_ExitCode_137": "Bash exited with code 137, which means it ran out of memory. Make sure the agent (container) host has sufficient memory configured.",
123124
"JS_FormattedCommand": "Formatted command: %s",
124125
"JS_InvalidFilePath": "Invalid file path '%s'.",
125126
"JS_ScriptContents": "Script contents:",
@@ -129,7 +130,7 @@
129130
"ScriptArgsSanitized": "Detected characters in arguments that may not be executed correctly by the shell. Please escape special characters using backslash (\\). More information is available here: https://aka.ms/ado/75787"
130131
},
131132
"_buildConfigMapping": {
132-
"Default": "3.235.0",
133-
"Node20-225": "3.235.1"
133+
"Default": "3.236.0",
134+
"Node20-225": "3.236.1"
134135
}
135136
}

_generated/BashV3_Node20/task.loc.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"author": "Microsoft Corporation",
1818
"version": {
1919
"Major": 3,
20-
"Minor": 235,
20+
"Minor": 236,
2121
"Patch": 1
2222
},
2323
"releaseNotes": "ms-resource:loc.releaseNotes",
@@ -120,6 +120,7 @@
120120
"messages": {
121121
"GeneratingScript": "ms-resource:loc.messages.GeneratingScript",
122122
"JS_ExitCode": "ms-resource:loc.messages.JS_ExitCode",
123+
"JS_ExitCode_137": "ms-resource:loc.messages.JS_ExitCode_137",
123124
"JS_FormattedCommand": "ms-resource:loc.messages.JS_FormattedCommand",
124125
"JS_InvalidFilePath": "ms-resource:loc.messages.JS_InvalidFilePath",
125126
"JS_ScriptContents": "ms-resource:loc.messages.JS_ScriptContents",
@@ -129,7 +130,7 @@
129130
"ScriptArgsSanitized": "ms-resource:loc.messages.ScriptArgsSanitized"
130131
},
131132
"_buildConfigMapping": {
132-
"Default": "3.235.0",
133-
"Node20-225": "3.235.1"
133+
"Default": "3.236.0",
134+
"Node20-225": "3.236.1"
134135
}
135136
}

0 commit comments

Comments
 (0)