Repository update is not resilient to a failure of the module repo
I open this ticket to report a problem about repository updates.
Currently, before doing an update of the repositories, weboob deletes the local cache of the repositories (in the
repository folder) before performing an update of the repository (see here : https://git.weboob.org/weboob/devel/blob/master/weboob/core/repositories.py#L600-601).
In case the update process fails, for example due to the update server being "down" or for example because the TLS certificate is not renewed in due time (yes the problem raised these days ;)), the user cannot use the local version of modules (in the
modules folder), as weboob first looks in the repository cache to determine if it knows the module (and the cache was deleted). This results in raising an
ModuleLoadError and breaks the local use of weboob due to a remote problem (the cached modules could still be valid or at least partially functional).
I understand the intend to delete everything, if we are certain that there won't be any problem when updating, however these kind of problems can happen. In my opinion, the local repository cache should only be deleted if :
- we got an updated version of the repo locally
- OR the repository is not within the repositories listed in the
sources.listprovided to weboob.
The second clause could be discussed, as for testing purposes, a repo could be disabled temporarily, and the cache would be deleted for nothing (making it impossible to come back to a normal situation, in case this repo is down).
I open this ticket to open the discussion on what should be the behaviour in case the update process fails for any reason, and keep weboob usable anyway. I will propose an implementation once I have a good view on what should be expected.