BNP synchro en erreur 404

Bonjour la communauté,

J’utilise Kresus v0.21.2~ynh2 sur Yunohost v11.2.27 dans une VM 64Bits sous Proxmox.
Mais depuis quelque temps Kresus ne se synchronise plus avec la BNP avec comme erreur :

Unknown error: 404 Client Error: Not Found.
Erreur inconnue de Kresus : essayez de mettre à jour Weboob, et si cela ne règle pas votre problème, merci de signaler l’erreur aux auteurs de Kresus. Veuillez vous référer à la console développeurs pour plus d’informations.

Voici les logs de l’application :

[2024-08-20T22:16:42.077] [INFO] HTTP - DELETE /***sus/api/logs - 200 (1 ms)
[2024-08-20T22:16:47.735] [INFO] accounts-manager - Retrieve all accounts from access bnp with login 123789456
[2024-08-20T22:16:47.737] [INFO] providers/woob - Calling woob: command accounts...
[2024-08-20T22:16:51.799] [INFO] providers/woob - exited with code 0.
[2024-08-20T22:16:51.799] [WARN] providers/woob - stderr: 2024-08-20 22:16:51,434:WARNING:woob.bnp.browser:browser.py:367:iter_accounts Could not retrieve "Comptes Titres" accounts
[2024-08-20T22:16:51.800] [INFO] providers/woob - Saving session for access from bank bnp with login 123789456
[2024-08-20T22:16:51.811] [INFO] providers/woob - OK: woob exited normally with non-empty JSON content.
[2024-08-20T22:16:51.811] [INFO] accounts-manager - -> 4 bank account(s) found
[2024-08-20T22:16:51.812] [INFO] accounts-manager - Account 5 already known and in Kresus's database
[2024-08-20T22:16:51.814] [INFO] accounts-manager - Account 3 already known and in Kresus's database
[2024-08-20T22:16:51.815] [INFO] accounts-manager - Account 1 already known and in Kresus's database
[2024-08-20T22:16:51.818] [INFO] accounts-manager - Account 4 already known and in Kresus's database
[2024-08-20T22:16:51.819] [INFO] providers/woob - Calling woob: command transactions...
[2024-08-20T22:16:58.033] [INFO] providers/woob - exited with code 1.
[2024-08-20T22:16:58.033] [WARN] providers/woob - stderr: 2024-08-20 22:16:54,906:WARNING:woob.bnp.browser:browser.py:367:iter_accounts Could not retrieve "Comptes Titres" accounts
[2024-08-20T22:16:58.033] [INFO] providers/woob - Command returned an error code.
[2024-08-20T22:16:58.033] [INFO] providers/woob - Checking that woob is installed and can actually be called…
[2024-08-20T22:16:58.033] [INFO] providers/woob - Calling woob: command test...
[2024-08-20T22:16:58.225] [INFO] providers/woob - exited with code 0.
[2024-08-20T22:16:58.225] [INFO] providers/woob - OK: woob exited normally with non-empty JSON content.
[2024-08-20T22:16:58.225] [ERROR] providers/woob - Got error while running command "2": Unknown error: 404 Client Error: Not Found.
Traceback (most recent call last):
  File "/var/www/***sus/build/server/providers/woob/py/main.py", line 704, in fetch
    results['values'] = self.get_transactions(from_date)
  File "/var/www/***sus/build/server/providers/woob/py/main.py", line 593, in get_transactions
    for hist_tr in self.backend.iter_history(account):
  File "/home/yunohost.app/***sus/woob-data/modules/3.6/woob_modules/bnp/module.py", line 105, in iter_history
    return self.browser.iter_history(account)
  File "/var/www/***sus/venv/lib/python3.9/site-packages/woob/browser/browsers.py", line 1121, in inner
    return func(browser, *args, **kwargs)
  File "/home/yunohost.app/***sus/woob-data/modules/3.6/woob_modules/bnp/pp/browser.py", line 452, in iter_history
    self.market_list.go(json={})
  File "/var/www/***sus/venv/lib/python3.9/site-packages/woob/browser/url.py", line 139, in go
    r = self.browser.location(self.build(**kwargs), params=params, data=data, json=json, method=method,
  File "/var/www/***sus/venv/lib/python3.9/site-packages/woob/browser/browsers.py", line 1035, in location
    response = self.open(*args, **kwargs)
  File "/var/www/***sus/venv/lib/python3.9/site-packages/woob/tools/decorators.py", line 37, in f_retry
    return f(*args, **kwargs)
  File "/home/yunohost.app/***sus/woob-data/modules/3.6/woob_modules/bnp/pp/browser.py", line 178, in open
    return super(BNPParibasBrowser, self).open(*args, **kwargs)
  File "/var/www/***sus/venv/lib/python3.9/site-packages/woob/browser/browsers.py", line 1022, in open
    return super(PagesBrowser, self).open(callback=internal_callback, *args, **kwargs)
  File "/var/www/***sus/venv/lib/python3.9/site-packages/woob/browser/browsers.py", line 879, in open
    return super().open(url, *args, **kwargs)
  File "/var/www/***sus/venv/lib/python3.9/site-packages/woob/browser/browsers.py", line 530, in open
    response = self.session.send(preq,
  File "/var/www/***sus/venv/lib/python3.9/site-packages/woob/browser/sessions.py", line 161, in send
    return func(*args, **kwargs)
  File "/var/www/***sus/venv/lib/python3.9/site-packages/woob/browser/sessions.py", line 154, in func
    return callback(self, resp)
  File "/var/www/***sus/venv/lib/python3.9/site-packages/woob/browser/browsers.py", line 525, in inner_callback
    self.raise_for_status(response)
  File "/var/www/***sus/venv/lib/python3.9/site-packages/woob/browser/browsers.py", line 589, in raise_for_status
    raise HTTPNotFound(http_error_msg, response=response)
woob.browser.exceptions.HTTPNotFound: 404 Client Error: Not Found

[2024-08-20T22:16:58.225] [ERROR] providers/woob - 	(error code: GENERIC_EXCEPTION)
[2024-08-20T22:16:58.237] [ERROR] helpers - when fetching accounts: Unknown error: 404 Client Error: Not Found.
Traceback (most recent call last):
  File "/var/www/***sus/build/server/providers/woob/py/main.py", line 704, in fetch
    results['values'] = self.get_transactions(from_date)
  File "/var/www/***sus/build/server/providers/woob/py/main.py", line 593, in get_transactions
    for hist_tr in self.backend.iter_history(account):
  File "/home/yunohost.app/***sus/woob-data/modules/3.6/woob_modules/bnp/module.py", line 105, in iter_history
    return self.browser.iter_history(account)
  File "/var/www/***sus/venv/lib/python3.9/site-packages/woob/browser/browsers.py", line 1121, in inner
    return func(browser, *args, **kwargs)
  File "/home/yunohost.app/***sus/woob-data/modules/3.6/woob_modules/bnp/pp/browser.py", line 452, in iter_history
    self.market_list.go(json={})
  File "/var/www/***sus/venv/lib/python3.9/site-packages/woob/browser/url.py", line 139, in go
    r = self.browser.location(self.build(**kwargs), params=params, data=data, json=json, method=method,
  File "/var/www/***sus/venv/lib/python3.9/site-packages/woob/browser/browsers.py", line 1035, in location
    response = self.open(*args, **kwargs)
  File "/var/www/***sus/venv/lib/python3.9/site-packages/woob/tools/decorators.py", line 37, in f_retry
    return f(*args, **kwargs)
  File "/home/yunohost.app/***sus/woob-data/modules/3.6/woob_modules/bnp/pp/browser.py", line 178, in open
    return super(BNPParibasBrowser, self).open(*args, **kwargs)
  File "/var/www/***sus/venv/lib/python3.9/site-packages/woob/browser/browsers.py", line 1022, in open
    return super(PagesBrowser, self).open(callback=internal_callback, *args, **kwargs)
  File "/var/www/***sus/venv/lib/python3.9/site-packages/woob/browser/browsers.py", line 879, in open
    return super().open(url, *args, **kwargs)
  File "/var/www/***sus/venv/lib/python3.9/site-packages/woob/browser/browsers.py", line 530, in open
    response = self.session.send(preq,
  File "/var/www/***sus/venv/lib/python3.9/site-packages/woob/browser/sessions.py", line 161, in send
    return func(*args, **kwargs)
  File "/var/www/***sus/venv/lib/python3.9/site-packages/woob/browser/sessions.py", line 154, in func
    return callback(self, resp)
  File "/var/www/***sus/venv/lib/python3.9/site-packages/woob/browser/browsers.py", line 525, in inner_callback
    self.raise_for_status(response)
  File "/var/www/***sus/venv/lib/python3.9/site-packages/woob/browser/browsers.py", line 589, in raise_for_status
    raise HTTPNotFound(http_error_msg, response=response)
woob.browser.exceptions.HTTPNotFound: 404 Client Error: Not Found

[2024-08-20T22:16:58.237] [INFO] helpers - Error
    at new KError (/var/www/***sus/build/server/helpers.js:62:22)
    at callWoob (/var/www/***sus/build/server/providers/woob/index.js:234:15)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async _fetchHelper (/var/www/***sus/build/server/providers/woob/index.js:291:16)
    at async Object.fetchTransactions (/var/www/***sus/build/server/providers/woob/index.js:315:12)
    at async /var/www/***sus/build/server/lib/accounts-manager.js:258:20
    at async retryCallProvider (/var/www/***sus/build/server/lib/accounts-manager.js:95:20)
    at async pollTransactions (/var/www/***sus/build/server/lib/accounts-manager.js:257:34)
    at async AccountManager.syncTransactions (/var/www/***sus/build/server/lib/accounts-manager.js:393:24)
    at async fetchAccounts (/var/www/***sus/build/server/controllers/accesses.js:250:37)
[2024-08-20T22:16:58.237] [ERROR] HTTP - POST /***sus/api/accesses/2/fetch/accounts - 500 (10505 ms)

Merci à vous pour la résolution du bug.

Bonjour,

comment as-tu installé woob ?

Cela ressemble à [bnp] 404 Client Error: Not Found (#704) · Issues · woob / woob · GitLab, qui est réglé sur la branche master de woob (mais ne récupère plus les comptes titres).

Bonjour,

@nicofrand, merci pour ta réponse.

Kresus a été installé via les commandes d’installation de Yunohost.

J’ai édité le fichier :

/var/www/kresus/data/woob-data/modules/3.6/woob_modules/bnp/pp/browser.py

Et j’ai modifié les lignes 362 à 364 comme ceci :

#self.market_syn.go(json={})
#market_accounts = self.page.get_list()  # get the list of 'Comptes Titres'
market_accounts = []

Puis j’ai redémarré le service kresus, mais toujours pas de synchro.

La même modification a été faite dans :

/home/yunohost.app/kresus/woob-data/modules/3.6/woob_modules/bnp/pp/browser.py

Toujours sans effet sur la synchro.

Bonjour la communauté,

Depuis les modifications faites dans les fichiers de configurations, le solde du compte est synchronisé, mais pas les dernières opérations effectuées sur celui-ci.

On avance doucement, mais on avance. :wink:

Bonjour,

Il faudrait fournir des logs pour qu’on comprenne, a minima.

Et de quels fichiers de configuration parles-tu ?

Pour les fichiers :

/home/yunohost.app/kresus/woob-data/modules/3.6/woob_modules/bnp/pp/browser.py

Et :

/home/yunohost.app/kresus/woob-data/modules/3.6/woob_modules/bnp/pp/browser.py

Les logs de Kresus :

[2024-08-23T14:14:16.151] [INFO] HTTP - DELETE /***sus/api/logs - 200 (0 ms)
[2024-08-23T14:14:27.893] [INFO] accounts-manager - Retrieve all accounts from access bnp with login 123789456
[2024-08-23T14:14:27.895] [INFO] providers/woob - Calling woob: command accounts...
[2024-08-23T14:14:31.266] [INFO] providers/woob - exited with code 0.
[2024-08-23T14:14:31.266] [INFO] providers/woob - Saving session for access from bank bnp with login 123789456
[2024-08-23T14:14:31.278] [INFO] providers/woob - OK: woob exited normally with non-empty JSON content.
[2024-08-23T14:14:31.278] [INFO] accounts-manager - -> 4 bank account(s) found
[2024-08-23T14:14:31.278] [INFO] accounts-manager - Account 6 already known and in Kresus's database
[2024-08-23T14:14:31.279] [INFO] accounts-manager - Account 1 already known and in Kresus's database
[2024-08-23T14:14:31.287] [INFO] accounts-manager - Account 3 already known and in Kresus's database
[2024-08-23T14:14:31.288] [INFO] accounts-manager - Account 5 already known and in Kresus's database
[2024-08-23T14:14:31.291] [INFO] providers/woob - Calling woob: command transactions...
[2024-08-23T14:14:35.450] [INFO] providers/woob - exited with code 1.
[2024-08-23T14:14:35.451] [INFO] providers/woob - Command returned an error code.
[2024-08-23T14:14:35.451] [INFO] providers/woob - Checking that woob is installed and can actually be called…
[2024-08-23T14:14:35.451] [INFO] providers/woob - Calling woob: command test...
[2024-08-23T14:14:35.641] [INFO] providers/woob - exited with code 0.
[2024-08-23T14:14:35.641] [INFO] providers/woob - OK: woob exited normally with non-empty JSON content.
[2024-08-23T14:14:35.641] [ERROR] providers/woob - Got error while running command "2": Unknown error: 404 Client Error: Not Found.
Traceback (most recent call last):
  File "/var/www/***sus/build/server/providers/woob/py/main.py", line 704, in fetch
    results['values'] = self.get_transactions(from_date)
  File "/var/www/***sus/build/server/providers/woob/py/main.py", line 593, in get_transactions
    for hist_tr in self.backend.iter_history(account):
  File "/home/yunohost.app/***sus/woob-data/modules/3.6/woob_modules/bnp/module.py", line 105, in iter_history
    return self.browser.iter_history(account)
  File "/var/www/***sus/venv/lib/python3.9/site-packages/woob/browser/browsers.py", line 1121, in inner
    return func(browser, *args, **kwargs)
  File "/home/yunohost.app/***sus/woob-data/modules/3.6/woob_modules/bnp/pp/browser.py", line 453, in iter_history
    self.market_list.go(json={})
  File "/var/www/***sus/venv/lib/python3.9/site-packages/woob/browser/url.py", line 139, in go
    r = self.browser.location(self.build(**kwargs), params=params, data=data, json=json, method=method,
  File "/var/www/***sus/venv/lib/python3.9/site-packages/woob/browser/browsers.py", line 1035, in location
    response = self.open(*args, **kwargs)
  File "/var/www/***sus/venv/lib/python3.9/site-packages/woob/tools/decorators.py", line 37, in f_retry
    return f(*args, **kwargs)
  File "/home/yunohost.app/***sus/woob-data/modules/3.6/woob_modules/bnp/pp/browser.py", line 178, in open
    return super(BNPParibasBrowser, self).open(*args, **kwargs)
  File "/var/www/***sus/venv/lib/python3.9/site-packages/woob/browser/browsers.py", line 1022, in open
    return super(PagesBrowser, self).open(callback=internal_callback, *args, **kwargs)
  File "/var/www/***sus/venv/lib/python3.9/site-packages/woob/browser/browsers.py", line 879, in open
    return super().open(url, *args, **kwargs)
  File "/var/www/***sus/venv/lib/python3.9/site-packages/woob/browser/browsers.py", line 530, in open
    response = self.session.send(preq,
  File "/var/www/***sus/venv/lib/python3.9/site-packages/woob/browser/sessions.py", line 161, in send
    return func(*args, **kwargs)
  File "/var/www/***sus/venv/lib/python3.9/site-packages/woob/browser/sessions.py", line 154, in func
    return callback(self, resp)
  File "/var/www/***sus/venv/lib/python3.9/site-packages/woob/browser/browsers.py", line 525, in inner_callback
    self.raise_for_status(response)
  File "/var/www/***sus/venv/lib/python3.9/site-packages/woob/browser/browsers.py", line 589, in raise_for_status
    raise HTTPNotFound(http_error_msg, response=response)
woob.browser.exceptions.HTTPNotFound: 404 Client Error: Not Found

[2024-08-23T14:14:35.641] [ERROR] providers/woob - 	(error code: GENERIC_EXCEPTION)
[2024-08-23T14:14:35.653] [ERROR] helpers - when fetching accounts: Unknown error: 404 Client Error: Not Found.
Traceback (most recent call last):
  File "/var/www/***sus/build/server/providers/woob/py/main.py", line 704, in fetch
    results['values'] = self.get_transactions(from_date)
  File "/var/www/***sus/build/server/providers/woob/py/main.py", line 593, in get_transactions
    for hist_tr in self.backend.iter_history(account):
  File "/home/yunohost.app/***sus/woob-data/modules/3.6/woob_modules/bnp/module.py", line 105, in iter_history
    return self.browser.iter_history(account)
  File "/var/www/***sus/venv/lib/python3.9/site-packages/woob/browser/browsers.py", line 1121, in inner
    return func(browser, *args, **kwargs)
  File "/home/yunohost.app/***sus/woob-data/modules/3.6/woob_modules/bnp/pp/browser.py", line 453, in iter_history
    self.market_list.go(json={})
  File "/var/www/***sus/venv/lib/python3.9/site-packages/woob/browser/url.py", line 139, in go
    r = self.browser.location(self.build(**kwargs), params=params, data=data, json=json, method=method,
  File "/var/www/***sus/venv/lib/python3.9/site-packages/woob/browser/browsers.py", line 1035, in location
    response = self.open(*args, **kwargs)
  File "/var/www/***sus/venv/lib/python3.9/site-packages/woob/tools/decorators.py", line 37, in f_retry
    return f(*args, **kwargs)
  File "/home/yunohost.app/***sus/woob-data/modules/3.6/woob_modules/bnp/pp/browser.py", line 178, in open
    return super(BNPParibasBrowser, self).open(*args, **kwargs)
  File "/var/www/***sus/venv/lib/python3.9/site-packages/woob/browser/browsers.py", line 1022, in open
    return super(PagesBrowser, self).open(callback=internal_callback, *args, **kwargs)
  File "/var/www/***sus/venv/lib/python3.9/site-packages/woob/browser/browsers.py", line 879, in open
    return super().open(url, *args, **kwargs)
  File "/var/www/***sus/venv/lib/python3.9/site-packages/woob/browser/browsers.py", line 530, in open
    response = self.session.send(preq,
  File "/var/www/***sus/venv/lib/python3.9/site-packages/woob/browser/sessions.py", line 161, in send
    return func(*args, **kwargs)
  File "/var/www/***sus/venv/lib/python3.9/site-packages/woob/browser/sessions.py", line 154, in func
    return callback(self, resp)
  File "/var/www/***sus/venv/lib/python3.9/site-packages/woob/browser/browsers.py", line 525, in inner_callback
    self.raise_for_status(response)
  File "/var/www/***sus/venv/lib/python3.9/site-packages/woob/browser/browsers.py", line 589, in raise_for_status
    raise HTTPNotFound(http_error_msg, response=response)
woob.browser.exceptions.HTTPNotFound: 404 Client Error: Not Found

[2024-08-23T14:14:35.653] [INFO] helpers - Error
    at new KError (/var/www/***sus/build/server/helpers.js:62:22)
    at callWoob (/var/www/***sus/build/server/providers/woob/index.js:234:15)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async _fetchHelper (/var/www/***sus/build/server/providers/woob/index.js:291:16)
    at async Object.fetchTransactions (/var/www/***sus/build/server/providers/woob/index.js:315:12)
    at async /var/www/***sus/build/server/lib/accounts-manager.js:258:20
    at async retryCallProvider (/var/www/***sus/build/server/lib/accounts-manager.js:95:20)
    at async pollTransactions (/var/www/***sus/build/server/lib/accounts-manager.js:257:34)
    at async AccountManager.syncTransactions (/var/www/***sus/build/server/lib/accounts-manager.js:393:24)
    at async fetchAccounts (/var/www/***sus/build/server/controllers/accesses.js:250:37)
[2024-08-23T14:14:35.653] [ERROR] HTTP - POST /***sus/api/accesses/2/fetch/accounts - 500 (7763 ms)

OK donc ce sont les fichiers de code des modules, pas de configuration, et le problème reste le problème initial.

Est-ce que tu peux essayer directement avec woob stp ? Voici comment :

Ensuite pour chaque compte essaie de récupérer un historique et voir si le même souci arrive.

Ou doit être placé le script woob-debug.sh dans le système de fichiers de Yunohost et avec quel utilisateur le lancer ?

Merci pour ta réponse.

Ton log ressemble à l’erreur que j’avais encore sur Hello Bank.

Actives le mode debug et regarde si tu as une 404 sur ce service : /pe-war/rpc/SAVaccountDetails/get.
Si oui, il faut ouvrir le fichier browser.py du module bnp/pp et rattraper l’exception HTTPNotFound sur toutes les occurrences de market_list dans le fichier.

try:
    self.market_list.go(json={})
except ServerError:
    self.logger.warning("An Internal Server Error occurred")
    return []
except HTTPNotFound:
    self.logger.warn('Could not retrieve "Comptes Titres" accounts')
    return []

C’est un correctif temporaire. J’ai désactivé la mise à jour automatique des modules, le temps qu’une correction sur le module soit réalisée.