Since the stored record ID does not contain the information that this ID exists within the sandbox environment only, the code will assume that the record should already exist and try to update it.
This leads to a 404 error:
Traceback (most recent call last):
File "upload.py", line 102, in <module>
main()
File "...zenodo-tools/venv/lib/python3.8/site-packages/click/core.py", line 1130, in __call__
return self.main(*args, **kwargs)
File "...zenodo-tools/venv/lib/python3.8/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
File "...zenodo-tools/venv/lib/python3.8/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "...zenodo-tools/venv/lib/python3.8/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "upload.py", line 92, in main
res = ensure_zenodo(
File "...zenodo-client/src/zenodo_client/api.py", line 48, in ensure_zenodo
return update_zenodo(deposition_id, paths, **kwargs)
File "...zenodo-client/src/zenodo_client/api.py", line 64, in update_zenodo
return Zenodo(**kwargs).update(deposition_id, paths)
File "...zenodo-client/src/zenodo_client/api.py", line 171, in update
res.raise_for_status()
File "...zenodo-tools/venv/lib/python3.8/site-packages/requests/models.py", line 1021, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: NOT FOUND for url: https://zenodo.org/api/deposit/depositions/1234567/actions/newversion?access_token=<SOME_TOKEN>
A hotfix is to manually remove the record ID again.
I first test creating an upload using
sandbox=True
Once this worked successfully, this will store the record ID into the config file located at
~/.config/zenodo.ini
:Now, I want to actually publish the record and thus switch to
sandbox=False
, i.e.,Since the stored record ID does not contain the information that this ID exists within the sandbox environment only, the code will assume that the record should already exist and try to update it. This leads to a 404 error:
A hotfix is to manually remove the record ID again.