YunoHost-Apps / kresus_ynh

Kresus (personal finance manager) for YunoHost
https://kresus.org/
GNU Affero General Public License v3.0
20 stars 20 forks source link

python-jose not installed during install #186

Open etieng opened 6 months ago

etieng commented 6 months ago

Describe the bug

When installing Kresus for the first time, Woob cannot fetch data due to missing python library python-jose

Context

Steps to reproduce

Expected behavior

python-jose should be installed during install of Kresus_ynh

Logs

[2024-04-25T11:31:34.162] [INFO] HTTP - POST /***sus/api/settings - 200 (17 ms)
[2024-04-25T11:31:34.459] [INFO] accounts-manager - Retrieve all accounts from access creditcooperatif with login **********
[2024-04-25T11:31:34.467] [INFO] providers/woob - Calling woob: command accounts...
[2024-04-25T11:31:40.586] [INFO] providers/woob - exited with code 1.
[2024-04-25T11:31:40.586] [INFO] providers/woob - Command returned an error code.
[2024-04-25T11:31:40.587] [INFO] providers/woob - Checking that woob is installed and can actually be called…
[2024-04-25T11:31:40.587] [INFO] providers/woob - Calling woob: command test...
[2024-04-25T11:31:41.029] [INFO] providers/woob - exited with code 0.
[2024-04-25T11:31:41.030] [INFO] providers/woob - OK: woob exited normally with non-empty JSON content.
[2024-04-25T11:31:41.030] [ERROR] providers/woob - Got error while running command "3": Unable to load module creditcooperatif.
Traceback (most recent call last):
  File "/var/www/***sus/venv/lib/python3.9/site-packages/woob/core/modules.py", line 281, in check_version
    pkg = pkg_resources.get_distribution(name)
  File "/var/www/***sus/venv/lib/python3.9/site-packages/pkg_resources/__init__.py", line 497, in get_distribution
    dist = get_provider(dist)
  File "/var/www/***sus/venv/lib/python3.9/site-packages/pkg_resources/__init__.py", line 384, in get_provider
    return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
  File "/var/www/***sus/venv/lib/python3.9/site-packages/pkg_resources/__init__.py", line 937, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/var/www/***sus/venv/lib/python3.9/site-packages/pkg_resources/__init__.py", line 798, in resolve
    dist = self._resolve_dist(
  File "/var/www/***sus/venv/lib/python3.9/site-packages/pkg_resources/__init__.py", line 839, in _resolve_dist
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'python-jose' distribution was not found and is required by the application

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/var/www/***sus/build/server/providers/woob/py/main.py", line 924, in main
    woob_connector.create_backend(bank_module, params, session)
  File "/var/www/***sus/build/server/providers/woob/py/main.py", line 525, in create_backend
    self.backend = self.woob.build_backend(
  File "/var/www/***sus/venv/lib/python3.9/site-packages/woob/core/woob.py", line 504, in build_backend
    return super().build_backend(module_name, params, storage, name, nofail, logger)
  File "/var/www/***sus/venv/lib/python3.9/site-packages/woob/core/woob.py", line 141, in build_backend
    module = self.modules_loader.get_or_load_module(module_name)
  File "/var/www/***sus/venv/lib/python3.9/site-packages/woob/core/modules.py", line 197, in get_or_load_module
    self.load_module(module_name)
  File "/var/www/***sus/venv/lib/python3.9/site-packages/woob/core/modules.py", line 239, in load_module
    self.check_version(module_name, module_spec)
  File "/var/www/***sus/venv/lib/python3.9/site-packages/woob/core/modules.py", line 283, in check_version
    raise ModuleLoadError(
woob.exceptions.ModuleLoadError: Module requires python package "python-jose" but not installed.
nicofrand commented 6 months ago

It should be installed already: https://github.com/YunoHost-Apps/kresus_ynh/blob/2016f08263ee6b4b0a7331bf843f84ff77c92ede/manifest.toml#L62

etieng commented 6 months ago

Well, definitely python3-josepy debian package was installed

2024-04-25 11:25:35,586: DEBUG - Selecting previously unselected package python3-josepy.
2024-04-25 11:25:35,593: DEBUG - Preparing to unpack .../64-python3-josepy_1.2.0-2_all.deb ...
2024-04-25 11:25:35,599: DEBUG - Unpacking python3-josepy (1.2.0-2) ...
>><<
2024-04-25 11:25:40,494: DEBUG - Setting up python3-josepy (1.2.0-2) ...

With no errors returned, but at some point python-jose was missing for Woob, as stated in logs of first publication.

How can I investigate further ?

nicofrand commented 6 months ago

I don't really know… I kind of remember of a similar issue in the other way (debian package was working, not the one from pip) so I am not eager to replace one by the other :/

etieng commented 6 months ago

Ok, if I'm the only one concerned... I posted to have a record somewhere.