microsoft / vscode-jupyter

VS Code Jupyter extension
https://marketplace.visualstudio.com/items?itemName=ms-toolsai.jupyter
MIT License
1.3k stars 292 forks source link

VSCode does not create .ipynb_checkpoints folder and checkpoints #15960

Closed kvas7andy closed 3 months ago

kvas7andy commented 3 months ago

Applies To

What happened?

Would like to repopen this issue or start new one with more details form my side.

Issue occured when I deleted file and only then I found that VSCODE does not create any checkpoints in folders, including .ipynb_checkpoint folder. The latter is even not created, whenever I am inside VSCode Editor working with jupyter notebooks. However, opening browser version of jupyter notebook instantly creates the folder and checkpoint itself.

Could that be the issue why .ipynb_checkpoint folder and checkpoints are not created, or is that VSCode functionality as it is? that VSCode jupyter extension to be fixed? What can be a workaround which does not involve working through browser?

Steps to reproduce:

Open VSCode and creat .ipynb file

Run jupyter notebook from working folder (which includes yourr .ipynb file)

Either do or do not generate jupyter_notebook_config.py. Same way you can put option keys for command running new jupyter server with something like: jupyter notebook --notebook-dir=/ --ip=0.0.0.0 --port=8888 --allow-root --no-browser --NotebookApp.checkpoints_enabled=true --FileCheckpoints.checkpoint_dir=/tmp

Open ipynb file and run commands.

Check checkpoint_dir folder.

Do the same in browser adressing localhost:8888

Check checkpoint_dir folder you will find .ipynb checkpoint file.

Lastly, I am using container environment in docker and Dev Containers extension of VSCode to work completely inside container.

VS Code Version

1.92.2

Jupyter Extension Version

2024.7.0

Jupyter logs

Visual Studio Code (1.92.2, attached-container, desktop)
Jupyter Extension Version: 2024.7.0.
Python Extension Version: 2024.12.3.
Pylance Extension Version: 2024.8.1.
Platform: linux (x64).
22:44:12.486 [error] Error fetching kernels from http://localhost:8888/ (server_logo): [FetchError: request to http://localhost:8888/api/kernels?1724701452387 failed, reason: connect ECONNREFUSED 127.0.0.1:8888
    at ClientRequest.<anonymous> (/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-x64/dist/node_modules/node-fetch.js:1:306417)
    at ClientRequest.emit (node:events:519:28)
    at Socket.socketErrorListener (node:_http_client:500:9)
    at Socket.emit (node:events:519:28)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)]
22:44:12.487 [error] Jupyter Lab Helper:getKernelSpecs failure:  [Error: Poll (@jupyterlab/services:KernelSpecManager#specs) is disposed.
    at v.dispose (/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-x64/dist/node_modules/@jupyterlab/services.js:11:10935)
    at ni.dispose (/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-x64/dist/node_modules/@jupyterlab/services.js:11:29299)
    at /~/.vscode-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-x64/dist/extension.node.js:181:15205
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)]
22:44:12.487 [error] UniversalRemoteKernelFinder: Failed to get kernels without cache [FetchError: request to http://localhost:8888/api/kernels?1724701452387 failed, reason: connect ECONNREFUSED 127.0.0.1:8888
    at ClientRequest.<anonymous> (/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-x64/dist/node_modules/node-fetch.js:1:306417)
    at ClientRequest.emit (node:events:519:28)
    at Socket.socketErrorListener (node:_http_client:500:9)
    at Socket.emit (node:events:519:28)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)]
22:44:12.941 [error] Failed to validate Password info [n [Error]: cancel
    at <static_initializer> (/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-x64/dist/extension.node.js:183:9189)
    at Object.<anonymous> (/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-x64/dist/extension.node.js:183:9133)
    at Module._compile (node:internal/modules/cjs/loader:1358:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
    at Module.load (node:internal/modules/cjs/loader:1208:32)
    at Module._load (node:internal/modules/cjs/loader:1024:12)
    at y._load (/~/.vscode-server/bin/fee1edb8d6d72a0ddff41e5f71a671c23ed924b9/out/vs/workbench/api/node/extensionHostProcess.js:177:6051)
    at i._load (/~/.vscode-server/bin/fee1edb8d6d72a0ddff41e5f71a671c23ed924b9/out/vs/workbench/api/node/extensionHostProcess.js:174:31787)
    at o._load (/~/.vscode-server/bin/fee1edb8d6d72a0ddff41e5f71a671c23ed924b9/out/vs/workbench/api/node/extensionHostProcess.js:139:34334)
    at Module.require (node:internal/modules/cjs/loader:1233:19)
    at require (node:internal/modules/helpers:179:18)
    at f (/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-x64/dist/extension.node.proxy.js:1:677)
    at B.kb (/~/.vscode-server/bin/fee1edb8d6d72a0ddff41e5f71a671c23ed924b9/out/vs/workbench/api/node/extensionHostProcess.js:160:13608)
    at B.jb (/~/.vscode-server/bin/fee1edb8d6d72a0ddff41e5f71a671c23ed924b9/out/vs/workbench/api/node/extensionHostProcess.js:160:13280)
    at /~/.vscode-server/bin/fee1edb8d6d72a0ddff41e5f71a671c23ed924b9/out/vs/workbench/api/node/extensionHostProcess.js:160:11267
    at async m.n (/~/.vscode-server/bin/fee1edb8d6d72a0ddff41e5f71a671c23ed924b9/out/vs/workbench/api/node/extensionHostProcess.js:144:6409)
    at async m (/~/.vscode-server/bin/fee1edb8d6d72a0ddff41e5f71a671c23ed924b9/out/vs/workbench/api/node/extensionHostProcess.js:144:6372)
    at async m.l (/~/.vscode-server/bin/fee1edb8d6d72a0ddff41e5f71a671c23ed924b9/out/vs/workbench/api/node/extensionHostProcess.js:144:5829)]
22:44:12.947 [error] Error fetching kernels from http://localhost:8088/ (antifraud-ng): [r [Error]: Forbidden
    at r.create (/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-x64/dist/node_modules/@jupyterlab/services.js:11:1006)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Object.Rl [as listRunning] (/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-x64/dist/node_modules/@jupyterlab/services.js:11:4507)
    at async n.getRunningKernels (/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-x64/dist/extension.node.js:181:15655)
    at async Promise.all (index 0)
    at async ND.listKernelsFromConnection (/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-x64/dist/extension.node.js:282:19430)
    at async /~/.vscode-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-x64/dist/extension.node.js:282:17683] {
  response: p [Response] {
    size: 0,
    timeout: 0,
    [Symbol(Body internals)]: { body: [PassThrough], disturbed: true, error: null },
    [Symbol(Response internals)]: {
      url: 'http://localhost:8088/api/kernels?1724701452942',
      status: 403,
      statusText: 'Forbidden',
      headers: [p [Headers]],
      counter: 0
    }
  },
  traceback: ''
}
22:44:12.949 [error] Jupyter Lab Helper:getKernelSpecs failure:  [Error: Poll (@jupyterlab/services:KernelSpecManager#specs) is disposed.
    at v.dispose (/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-x64/dist/node_modules/@jupyterlab/services.js:11:10935)
    at ni.dispose (/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-x64/dist/node_modules/@jupyterlab/services.js:11:29299)
    at /~/.vscode-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-x64/dist/extension.node.js:181:15205
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)]
22:44:13.945 [error] Failed to validate Password info [n [Error]: cancel
    at <static_initializer> (/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-x64/dist/extension.node.js:183:9189)
    at Object.<anonymous> (/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-x64/dist/extension.node.js:183:9133)
    at Module._compile (node:internal/modules/cjs/loader:1358:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
    at Module.load (node:internal/modules/cjs/loader:1208:32)
    at Module._load (node:internal/modules/cjs/loader:1024:12)
    at y._load (/~/.vscode-server/bin/fee1edb8d6d72a0ddff41e5f71a671c23ed924b9/out/vs/workbench/api/node/extensionHostProcess.js:177:6051)
    at i._load (/~/.vscode-server/bin/fee1edb8d6d72a0ddff41e5f71a671c23ed924b9/out/vs/workbench/api/node/extensionHostProcess.js:174:31787)
    at o._load (/~/.vscode-server/bin/fee1edb8d6d72a0ddff41e5f71a671c23ed924b9/out/vs/workbench/api/node/extensionHostProcess.js:139:34334)
    at Module.require (node:internal/modules/cjs/loader:1233:19)
    at require (node:internal/modules/helpers:179:18)
    at f (/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-x64/dist/extension.node.proxy.js:1:677)
    at B.kb (/~/.vscode-server/bin/fee1edb8d6d72a0ddff41e5f71a671c23ed924b9/out/vs/workbench/api/node/extensionHostProcess.js:160:13608)
    at B.jb (/~/.vscode-server/bin/fee1edb8d6d72a0ddff41e5f71a671c23ed924b9/out/vs/workbench/api/node/extensionHostProcess.js:160:13280)
    at /~/.vscode-server/bin/fee1edb8d6d72a0ddff41e5f71a671c23ed924b9/out/vs/workbench/api/node/extensionHostProcess.js:160:11267
    at async m.n (/~/.vscode-server/bin/fee1edb8d6d72a0ddff41e5f71a671c23ed924b9/out/vs/workbench/api/node/extensionHostProcess.js:144:6409)
    at async m (/~/.vscode-server/bin/fee1edb8d6d72a0ddff41e5f71a671c23ed924b9/out/vs/workbench/api/node/extensionHostProcess.js:144:6372)
    at async m.l (/~/.vscode-server/bin/fee1edb8d6d72a0ddff41e5f71a671c23ed924b9/out/vs/workbench/api/node/extensionHostProcess.js:144:5829)]
22:44:13.953 [error] Error fetching kernels from http://localhost:8088/ (localhost): [r [Error]: Forbidden
    at r.create (/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-x64/dist/node_modules/@jupyterlab/services.js:11:1006)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Object.Rl [as listRunning] (/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-x64/dist/node_modules/@jupyterlab/services.js:11:4507)
    at async n.getRunningKernels (/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-x64/dist/extension.node.js:181:15655)
    at async Promise.all (index 0)
    at async ND.listKernelsFromConnection (/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-x64/dist/extension.node.js:282:19430)
    at async /~/.vscode-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-x64/dist/extension.node.js:282:17683] {
  response: p [Response] {
    size: 0,
    timeout: 0,
    [Symbol(Body internals)]: { body: [PassThrough], disturbed: true, error: null },
    [Symbol(Response internals)]: {
      url: 'http://localhost:8088/api/kernels?1724701453946',
      status: 403,
      statusText: 'Forbidden',
      headers: [p [Headers]],
      counter: 0
    }
  },
  traceback: ''
}
22:44:13.955 [error] Jupyter Lab Helper:getKernelSpecs failure:  [Error: Poll (@jupyterlab/services:KernelSpecManager#specs) is disposed.
    at v.dispose (/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-x64/dist/node_modules/@jupyterlab/services.js:11:10935)
    at ni.dispose (/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-x64/dist/node_modules/@jupyterlab/services.js:11:29299)
    at /~/.vscode-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-x64/dist/extension.node.js:181:15205
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)]
22:44:14.261 [error] Failed to validate Password info [n [Error]: cancel
    at <static_initializer> (/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-x64/dist/extension.node.js:183:9189)
    at Object.<anonymous> (/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-x64/dist/extension.node.js:183:9133)
    at Module._compile (node:internal/modules/cjs/loader:1358:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
    at Module.load (node:internal/modules/cjs/loader:1208:32)
    at Module._load (node:internal/modules/cjs/loader:1024:12)
    at y._load (/~/.vscode-server/bin/fee1edb8d6d72a0ddff41e5f71a671c23ed924b9/out/vs/workbench/api/node/extensionHostProcess.js:177:6051)
    at i._load (/~/.vscode-server/bin/fee1edb8d6d72a0ddff41e5f71a671c23ed924b9/out/vs/workbench/api/node/extensionHostProcess.js:174:31787)
    at o._load (/~/.vscode-server/bin/fee1edb8d6d72a0ddff41e5f71a671c23ed924b9/out/vs/workbench/api/node/extensionHostProcess.js:139:34334)
    at Module.require (node:internal/modules/cjs/loader:1233:19)
    at require (node:internal/modules/helpers:179:18)
    at f (/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-x64/dist/extension.node.proxy.js:1:677)
    at B.kb (/~/.vscode-server/bin/fee1edb8d6d72a0ddff41e5f71a671c23ed924b9/out/vs/workbench/api/node/extensionHostProcess.js:160:13608)
    at B.jb (/~/.vscode-server/bin/fee1edb8d6d72a0ddff41e5f71a671c23ed924b9/out/vs/workbench/api/node/extensionHostProcess.js:160:13280)
    at /~/.vscode-server/bin/fee1edb8d6d72a0ddff41e5f71a671c23ed924b9/out/vs/workbench/api/node/extensionHostProcess.js:160:11267
    at async m.n (/~/.vscode-server/bin/fee1edb8d6d72a0ddff41e5f71a671c23ed924b9/out/vs/workbench/api/node/extensionHostProcess.js:144:6409)
    at async m (/~/.vscode-server/bin/fee1edb8d6d72a0ddff41e5f71a671c23ed924b9/out/vs/workbench/api/node/extensionHostProcess.js:144:6372)
    at async m.l (/~/.vscode-server/bin/fee1edb8d6d72a0ddff41e5f71a671c23ed924b9/out/vs/workbench/api/node/extensionHostProcess.js:144:5829)]
22:44:14.272 [error] Error fetching kernels from http://localhost:8088/ (antifraud-ng): [r [Error]: Forbidden
    at r.create (/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-x64/dist/node_modules/@jupyterlab/services.js:11:1006)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Object.Rl [as listRunning] (/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-x64/dist/node_modules/@jupyterlab/services.js:11:4507)
    at async n.getRunningKernels (/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-x64/dist/extension.node.js:181:15655)
    at async Promise.all (index 0)
    at async ND.listKernelsFromConnection (/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-x64/dist/extension.node.js:282:19430)
    at async /~/.vscode-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-x64/dist/extension.node.js:282:17683] {
  response: p [Response] {
    size: 0,
    timeout: 0,
    [Symbol(Body internals)]: { body: [PassThrough], disturbed: true, error: null },
    [Symbol(Response internals)]: {
      url: 'http://localhost:8088/api/kernels?1724701454261',
      status: 403,
      statusText: 'Forbidden',
      headers: [p [Headers]],
      counter: 0
    }
  },
  traceback: ''
}
22:44:14.273 [error] Jupyter Lab Helper:getKernelSpecs failure:  [Error: Poll (@jupyterlab/services:KernelSpecManager#specs) is disposed.
    at v.dispose (/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-x64/dist/node_modules/@jupyterlab/services.js:11:10935)
    at ni.dispose (/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-x64/dist/node_modules/@jupyterlab/services.js:11:29299)
    at /~/.vscode-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-x64/dist/extension.node.js:181:15205
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)]
22:44:14.273 [error] UniversalRemoteKernelFinder: Failed to get kernels without cache [r [Error]: Forbidden
    at r.create (/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-x64/dist/node_modules/@jupyterlab/services.js:11:1006)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Object.Rl [as listRunning] (/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-x64/dist/node_modules/@jupyterlab/services.js:11:4507)
    at async n.getRunningKernels (/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-x64/dist/extension.node.js:181:15655)
    at async Promise.all (index 0)
    at async ND.listKernelsFromConnection (/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-x64/dist/extension.node.js:282:19430)
    at async /~/.vscode-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-x64/dist/extension.node.js:282:17683] {
  response: p [Response] {
    size: 0,
    timeout: 0,
    [Symbol(Body internals)]: { body: [PassThrough], disturbed: true, error: null },
    [Symbol(Response internals)]: {
      url: 'http://localhost:8088/api/kernels?1724701454261',
      status: 403,
      statusText: 'Forbidden',
      headers: [p [Headers]],
      counter: 0
    }
  },
  traceback: ''
}

Coding Language and Runtime Version

Python 3.10

Language Extension Version (if applicable)

No response

Anaconda Version (if applicable)

No response

Running Jupyter locally or remotely?

Remote

DonJayamanne commented 3 months ago

Thank you for filing this issue, Check points is not a feature supported by VS Code, thats a feature specific to Jupyter Lab/Notebook.

You can use the Timeline view instead. Basically any changes saved to your notebook will be displayed here along with other SCM operations, https://code.visualstudio.com/updates/v1_44#_timeline-view https://code.visualstudio.com/docs/sourcecontrol/overview#_timeline-view

kvas7andy commented 3 months ago

Hi @DonJayamanne , thank you for the answer. Well the issue is that local history does no automatic versioning of file, I have to Create Entry separately for each file. Can I automate this process?