@@ -172,7 +172,9 @@ export const getStackContainersByAppName = async (
172172 try {
173173 let result : string [ ] = [ ] ;
174174
175- const command = `docker stack ps ${ appName } --format 'CONTAINER ID : {{.ID}} | Name: {{.Name}} | State: {{.DesiredState}} | Node: {{.Node}} | CurrentState: {{.CurrentState}}'` ;
175+ const command = `docker stack ps ${ appName } --no-trunc --format 'CONTAINER ID : {{.ID}} | Name: {{.Name}} | State: {{.DesiredState}} | Node: {{.Node}} | CurrentState: {{.CurrentState}} | Error: {{.Error}}'` ;
176+
177+ console . log ( "command " , command ) ;
176178 if ( serverId ) {
177179 const { stdout, stderr } = await execAsyncRemote ( serverId , command ) ;
178180
@@ -212,12 +214,14 @@ export const getStackContainersByAppName = async (
212214 const currentState = parts [ 4 ]
213215 ? parts [ 4 ] . replace ( "CurrentState: " , "" ) . trim ( )
214216 : "" ;
217+ const error = parts [ 5 ] ? parts [ 5 ] . replace ( "Error: " , "" ) . trim ( ) : "" ;
215218 return {
216219 containerId,
217220 name,
218221 state,
219222 node,
220223 currentState,
224+ error,
221225 } ;
222226 } ) ;
223227
@@ -234,7 +238,7 @@ export const getServiceContainersByAppName = async (
234238 try {
235239 let result : string [ ] = [ ] ;
236240
237- const command = `docker service ps ${ appName } --format 'CONTAINER ID : {{.ID}} | Name: {{.Name}} | State: {{.DesiredState}} | Node: {{.Node}} | CurrentState: {{.CurrentState}}'` ;
241+ const command = `docker service ps ${ appName } --no-trunc -- format 'CONTAINER ID : {{.ID}} | Name: {{.Name}} | State: {{.DesiredState}} | Node: {{.Node}} | CurrentState: {{.CurrentState}} | Error: {{.Error }}'` ;
238242 if ( serverId ) {
239243 const { stdout, stderr } = await execAsyncRemote ( serverId , command ) ;
240244
@@ -276,12 +280,14 @@ export const getServiceContainersByAppName = async (
276280 const currentState = parts [ 4 ]
277281 ? parts [ 4 ] . replace ( "CurrentState: " , "" ) . trim ( )
278282 : "" ;
283+ const error = parts [ 5 ] ? parts [ 5 ] . replace ( "Error: " , "" ) . trim ( ) : "" ;
279284 return {
280285 containerId,
281286 name,
282287 state,
283288 currentState,
284289 node,
290+ error,
285291 } ;
286292 } ) ;
287293
0 commit comments