diff --git a/packages/core/src/awsService/sagemaker/commands.ts b/packages/core/src/awsService/sagemaker/commands.ts index ed7244c6b27..66ffe35fbee 100644 --- a/packages/core/src/awsService/sagemaker/commands.ts +++ b/packages/core/src/awsService/sagemaker/commands.ts @@ -171,7 +171,7 @@ export async function stopSpace( await client.deleteApp({ DomainId: node.spaceApp.DomainId!, SpaceName: spaceName, - AppType: node.spaceApp.App!.AppType!, + AppType: node.spaceApp.SpaceSettingsSummary!.AppType!, AppName: node.spaceApp.App?.AppName, }) } catch (err) { @@ -319,7 +319,7 @@ async function handleRunningSpaceWithDisabledAccess( await client.deleteApp({ DomainId: node.spaceApp.DomainId!, SpaceName: spaceName, - AppType: node.spaceApp.App!.AppType!, + AppType: node.spaceApp.SpaceSettingsSummary!.AppType!, AppName: node.spaceApp.App?.AppName, }) @@ -329,7 +329,11 @@ async function handleRunningSpaceWithDisabledAccess( // Start the space with remote access enabled (skip prompts since user already consented) await client.startSpace(spaceName, node.spaceApp.DomainId!, true) await tryRefreshNode(node) - await client.waitForAppInService(node.spaceApp.DomainId!, spaceName, node.spaceApp.App!.AppType!) + await client.waitForAppInService( + node.spaceApp.DomainId!, + spaceName, + node.spaceApp.SpaceSettingsSummary!.AppType! + ) await tryRemoteConnection(node, ctx, progress) } catch (err: any) { // Handle user declining instance type upgrade @@ -369,7 +373,11 @@ async function handleStoppedSpace( }, async (progress) => { progress.report({ message: 'Starting the space' }) - await client.waitForAppInService(node.spaceApp.DomainId!, spaceName, node.spaceApp.App!.AppType!) + await client.waitForAppInService( + node.spaceApp.DomainId!, + spaceName, + node.spaceApp.SpaceSettingsSummary!.AppType! + ) await tryRemoteConnection(node, ctx, progress) } ) diff --git a/packages/core/src/test/awsService/sagemaker/commands.test.ts b/packages/core/src/test/awsService/sagemaker/commands.test.ts index 756fa671e06..fd835cfe79e 100644 --- a/packages/core/src/test/awsService/sagemaker/commands.test.ts +++ b/packages/core/src/test/awsService/sagemaker/commands.test.ts @@ -59,6 +59,7 @@ describe('SageMaker Commands', () => { AppName: 'default', }, SpaceSettingsSummary: { + AppType: 'JupyterLab', RemoteAccess: 'DISABLED', }, },