Kaggle / kaggle-api

Official Kaggle API
Apache License 2.0
6.29k stars 1.1k forks source link

Kaggle kernels push results in `Kernel push error: Notebook not found` #575

Closed m-thiede closed 5 months ago

m-thiede commented 6 months ago

I am using the CLI for the first time and maybe I am doing something wrong, but this seems to be an issue with the cli / api. Could be related to #574.

Steps to reproduce the result:

kaggle kernels pull mthiede/api-test -m

output:

Source code and metadata downloaded to /home/fawkes/tmp/kaggle

After that I execute

kaggle kernels push

in /home/fawkes/tmp/kaggle, which gives me

Kernel push error: Notebook not found

Directory structure and metadata

ls

ls -l /home/fawkes/tmp/kaggle
total 8
-rw-r--r-- 1 fawkes fawkes 2024 May  1 19:28 api-test.ipynb
-rw-r--r-- 1 fawkes fawkes  375 May  1 19:28 kernel-metadata.json

cat

cat kernel-metadata.json

yields

{
  "id": "mthiede/api-test",
  "id_no": 56005324,
  "title": "api-test",
  "code_file": "api-test.ipynb",
  "language": "python",
  "kernel_type": "notebook",
  "is_private": false,
  "enable_gpu": false,
  "enable_tpu": false,
  "enable_internet": true,
  "keywords": [],
  "dataset_sources": [],
  "kernel_sources": [],
  "competition_sources": [],
  "model_sources": []
}

Environment

$ kaggle -v
Kaggle API 1.6.12

$ lsb_release -a
...
Description:    Debian GNU/Linux 12 (bookworm)
...
stevemessick commented 5 months ago

I was able to repro your problem. After going back to the notebook and creating a version this issue no longer occurs; the notebook was found once it had been versioned. Unfortunately, that led to another problem:

Kernel push error: Object reference not set to an instance of an object.

I created an issue in our internal tracker: http://b/343728043

stevemessick commented 5 months ago

The new error I discovered does not apply.

Please make a version of your notebook and try to push again, then let us know what happened. It worked for me.

m-thiede commented 5 months ago

Yes! It works after creating a version of the notebook, thank you!

R4Ajeti commented 5 months ago

@m-thiede if you have created the notebook from kaggle UI right? So the kaggle API is not going to recognize it. You need to create a version to be able to use this new notebook then you can edit it on kaggle UI as you need it.

14790897 commented 4 months ago

Creating a version in web solve the problem. thank you