Erreur mise à jour Dolibarr 21.0.2 vers 22.0.1

What app is this about, and its version: Dolibarr 21.0.2
What YunoHost version are you running: 12.1.24
What type of hardware are you using: Old laptop or computer

Describe your issue

Hello everybody,
Trying to update may dolibarr apps but failed. With this message : Collecte des fichiers devant être sauvegardés pour dolibarr…
Declaring files to be backed up…
No main group set in syncyunohost_main_group, skipping group backup.
Backing up the MySQL database…
Backing up syncyunohost.sh script from /usr/local/bin/…
Source path ‘/usr/local/bin/syncyunohost.sh’ does not exist
Échec de la collecte des fichiers à sauvegarder pour dolibarr.

Thank you for your help

Share relevant logs or error messages

https://paste.yunohost.org/raw/tufoxitegu

Hello,

Can you check manually if the file exists in the folder “/usr/local/bin/” ?
Maybe it is somewhere else…

Before updating you have to fix this and make sure you have a full backup available.

Hello, I think you are with a version dolibarr version 21.0.1~ynh4 and there is a little step to correct, here the explanation

first correct this file on line 20

nano -l /etc/yunohost/apps/dolibarr/scripts/backup

line 20 to correct like this :

# Check if the group is set
if [ -z "${syncyunohost_main_group:-}" ]; then

To keep the edited changes Ctrl + O and Enter, then Ctlr + X to leave editor nano.

Then the upgrade should works, it needs first have a backup working.

Sorry for the inconvenience…

I have the same error here, try your suggestion but still same error:

args:
  apps:
  - dolibarr
  name: dolibarr-pre-upgrade2
  system: null
ended_at: 2025-09-29 22:59:05.146426
error: Failed to collect files to be backed up
interface: cli
operation: backup_create
parent: null
related_to:
- - app
  - dolibarr
started_at: 2025-09-29 22:59:03.220335
started_by: ******
success: false
yunohost_version: 12.1.26

============

2025-09-29 23:59:04,387: INFO - Collecting files to be backed up for dolibarr…
2025-09-29 23:59:04,441: DEBUG - Executing command '['sh', '-c', '/bin/bash -x "/var/cache/yunohost/app_tmp_work_dirs/app_gr4utep0/scripts/backup"  7>&1']'
2025-09-29 23:59:04,451: DEBUG - + source ../settings/scripts/_common.sh
2025-09-29 23:59:04,452: DEBUG - + source /usr/share/yunohost/helpers
2025-09-29 23:59:04,455: DEBUG - ++++ dirname -- /usr/share/yunohost/helpers
2025-09-29 23:59:04,458: DEBUG - +++ cd -- /usr/share/yunohost
2025-09-29 23:59:04,459: DEBUG - +++ pwd
2025-09-29 23:59:04,459: DEBUG - ++ SCRIPT_DIR=/usr/share/yunohost
2025-09-29 23:59:04,460: DEBUG - ++ YNH_HELPERS_VERSION=2
2025-09-29 23:59:04,466: DEBUG - ++ readonly 'XTRACE_ENABLE=set -o xtrace'
2025-09-29 23:59:04,466: DEBUG - ++ XTRACE_ENABLE='set -o xtrace'
2025-09-29 23:59:04,513: DEBUG - + ynh_print_info '--message=Declaring files to be backed up...'
2025-09-29 23:59:04,536: INFO - Declaring files to be backed up...
2025-09-29 23:59:04,544: WARNING - /var/cache/yunohost/app_tmp_work_dirs/app_gr4utep0/scripts/backup: line 20: syncyunohost_main_group: unbound variable
2025-09-29 23:59:04,545: DEBUG - ++ ynh_exit_properly
2025-09-29 23:59:04,545: DEBUG - ++ [[ backup =~ ^install$|^upgrade$|^restore$ ]]
2025-09-29 23:59:05,039: DEBUG - ++ exit 1
2025-09-29 23:59:05,141: DEBUG - Could not run script: /var/cache/yunohost/app_tmp_work_dirs/app_gr4utep0/scripts/backup
2025-09-29 23:59:05,143: ERROR - Failed to collect files to backed up for dolibarr.

Are you sure ? what’s return this command ?

grep z /etc/yunohost/apps/dolibarr/scripts/backup
$ sudo grep z /etc/yunohost/apps/dolibarr/scripts/backup
if [ -z "$syncyunohost_main_group" ]; then

But with the suggest modification i got the same output, then I return it to the way it was previously.

No, you must change first change this line

The correct line must be :

if [ -z "${syncyunohost_main_group:-}" ]; then

With this line it will do the backup without errors. you can first try do a backup after have changed this line to be sure : yunohost backup create --apps dolibarr

1 Like

Indeed maybe I wrote something wrong when making it by hand today I paste and copy it the backup works but the upgrade still fails:

Perhaps a specific module not available in this version ??

I see errors in migration databases… seems specific

2025-09-30 16:10:27,116: DEBUG - 2025-09-30 15:10:25 ERR      189113       0 DoliDBMysqli::query Exception in query instead of returning an error: Can't DROP INDEX `uk_societe_account_login_website_soc`; check that it exists<br>
2025-09-30 16:10:27,116: DEBUG - 2025-09-30 15:10:25 ERR      189113       0 DoliDBMysqli::query SQL Error message: DB_ERROR_NOSUCHFIELD Can't DROP INDEX `uk_societe_account_login_website_soc`; check that it exists From /var/www/dolibarr/htdocs/core/lib/admin.lib.php:477.<br>

2025-09-30 16:10:27,116: DEBUG - 2025-09-30 15:10:25 DEBUG    189113       0 sql=ALTER TABLE llx_societe_account ADD UNIQUE INDEX uk_societe_account_login_website(entity, login, site, fk_website);<br>
2025-09-30 16:10:27,116: DEBUG - 2025-09-30 15:10:25 ERR      189113       0 DoliDBMysqli::query Exception in query instead of returning an error: Duplicate key name 'uk_societe_account_login_website'<br>
2025-09-30 16:10:27,116: DEBUG - 2025-09-30 15:10:25 ERR      189113       0 DoliDBMysqli::query SQL Error message: DB_ERROR_KEY_NAME_ALREADY_EXISTS Duplicate key name 

2025-09-30 16:10:27,118: DEBUG - 2025-09-30 15:10:25 ERR      189113       0 DoliDBMysqli::query Exception in query instead of returning an error: Duplicate entry 'shipping-external-SHIPPING' for key 'uk_c_type_contact_id'<br>
2025-09-30 16:10:27,119: DEBUG - 2025-09-30 15:10:25 ERR      189113       0 DoliDBMysqli::query SQL Error message: DB_ERROR_RECORD_ALREADY_EXISTS Duplicate entry 'shipping-external-SHIPPING' for key 'uk_c_type_contact_id' From /var/www/dolibarr/htdocs/core/lib/admin.lib.php:477.<br>

2025-09-30 16:10:27,130: DEBUG - 2025-09-30 15:10:25 ERR      189113       0 DoliDBMysqli::query Exception in query instead of returning an error: Table 'llx_bank_import' already exists<br>
2025-09-30 16:10:27,130: DEBUG - 2025-09-30 15:10:25 ERR      189113       0 DoliDBMysqli::query SQL Error message: DB_ERROR_TABLE_ALREADY_EXISTS Table 'llx_bank_import' already exists From /var/www/dolibarr/htdocs/core/lib/admin.lib.php:477.<br>

2025-09-30 16:10:27,137: DEBUG - 2025-09-30 15:10:26 ERR      189113       0 DoliDBMysqli::query Exception in query instead of returning an error: Can't DROP FOREIGN KEY `fk_customer_price_fk_product`; check that it exists<br>
2025-09-30 16:10:27,137: DEBUG - 2025-09-30 15:10:26 ERR      189113       0 DoliDBMysqli::query SQL Error message: DB_ERROR_NOSUCHFIELD Can't DROP FOREIGN KEY `fk_customer_price_fk_product`; check that it exists From /var/www/dolibarr/htdocs/core/lib/admin.lib.php:477.<br>

2025-09-30 16:10:27,138: DEBUG - 2025-09-30 15:10:26 ERR      189113       0 DoliDBMysqli::query Exception in query instead of returning an error: Can't DROP FOREIGN KEY `fk_customer_price_fk_soc`; check that it exists<br>
2025-09-30 16:10:27,138: DEBUG - 2025-09-30 15:10:26 ERR      189113       0 DoliDBMysqli::query SQL Error message: DB_ERROR_NOSUCHFIELD Can't DROP FOREIGN KEY `fk_customer_price_fk_soc`; check that it exists From /var/www/dolibarr/htdocs/core/lib/admin.lib.php:477.<br>

2025-09-30 16:10:27,142: DEBUG - 2025-09-30 15:10:26 ERR      189113       0 DoliDBMysqli::query Exception in query instead of returning an error: Illegal mix of collations (utf8mb3_unicode_ci,IMPLICIT) and (utf8mb3_general_ci,IMPLICIT) for operation '='<br>
2025-09-30 16:10:27,142: DEBUG - 2025-09-30 15:10:26 ERR      189113       0 DoliDBMysqli::query SQL Error message: DB_ERROR_1267 Illegal mix of collations (utf8mb3_unicode_ci,IMPLICIT) and (utf8mb3_general_ci,IMPLICIT) for operation '=' From /var/www/dolibarr/htdocs/core/lib/admin.lib.php:477.<br>
2025-09-30 16:10:27,143: DEBUG - 2025-09-30 15:10:26 ERR      189113       0 Admin.lib::run_sql Request 90 Error DB_ERROR_1267 UPDATE llx_accounting_account as acc SET acc.centralized = 1 WHERE acc.account_number in (SELECT value  FROM llx_const WHERE name IN 

2025-09-30 16:10:27,145: DEBUG - 2025-09-30 15:10:26 ERR      189113       0 DoliDBMysqli::query Exception in query instead of returning an error: Table 'dolibarr.llx_webhook_target' doesn't exist<br>
2025-09-30 16:10:27,145: DEBUG - 2025-09-30 15:10:26 ERR      189113       0 DoliDBMysqli::query SQL Error message: DB_ERROR_NOSUCHTABLE Table 'dolibarr.llx_webhook_target' doesn't exist From /var/www/dolibarr/htdocs/core/lib/admin.lib.php:477.<br>

2025-09-30 16:10:27,146: DEBUG - 2025-09-30 15:10:26 ERR      189113       0 DoliDBMysqli::query Exception in query instead of returning an error: Table 'dolibarr.llx_webhook_target' doesn't exist<br>
2025-09-30 16:10:27,146: DEBUG - 2025-09-30 15:10:26 ERR      189113       0 DoliDBMysqli::query SQL Error message: DB_ERROR_NOSUCHTABLE Table 'dolibarr.llx_webhook_target' doesn't exist From /var/www/dolibarr/htdocs/core/lib/admin.lib.php:477.<br>

2025-09-30 16:10:27,147: DEBUG - 2025-09-30 15:10:26 ERR      189113       0 DoliDBMysqli::query Exception in query instead of returning an error: Table 'dolibarr.llx_webhook_target' doesn't exist<br>
2025-09-30 16:10:27,147: DEBUG - 2025-09-30 15:10:26 ERR      189113       0 DoliDBMysqli::query SQL Error message: DB_ERROR_NOSUCHTABLE Table 'dolibarr.llx_webhook_target' doesn't exist From /var/www/dolibarr/htdocs/core/lib/admin.lib.php:477.<br>

2025-09-30 16:10:27,148: DEBUG - 2025-09-30 15:10:26 ERR      189113       0 DoliDBMysqli::query Exception in query instead of returning an error: Table 'dolibarr.llx_website' doesn't exist<br>
2025-09-30 16:10:27,149: DEBUG - 2025-09-30 15:10:26 ERR      189113       0 DoliDBMysqli::query SQL Error message: DB_ERROR_NOSUCHTABLE Table 'dolibarr.llx_website' doesn't exist From /var/www/dolibarr/htdocs/core/lib/admin.lib.php:477.<br>

2025-09-30 16:10:27,153: DEBUG - 2025-09-30 15:10:26 ERR      189113       0 DoliDBMysqli::query Exception in query instead of returning an error: Table 'dolibarr.llx_asset' doesn't exist<br>
2025-09-30 16:10:27,153: DEBUG - 2025-09-30 15:10:26 ERR      189113       0 DoliDBMysqli::query SQL Error message: DB_ERROR_NOSUCHTABLE Table 'dolibarr.llx_asset' doesn't exist From /var/www/dolibarr/htdocs/core/lib/admin.lib.php:477.<br>

2025-09-30 16:10:27,154: DEBUG - 2025-09-30 15:10:26 ERR      189113       0 DoliDBMysqli::query Exception in query instead of returning an error: Table 'dolibarr.llx_asset' doesn't exist<br>
2025-09-30 16:10:27,154: DEBUG - 2025-09-30 15:10:26 ERR      189113       0 DoliDBMysqli::query SQL Error message: DB_ERROR_NOSUCHTABLE Table 'dolibarr.llx_asset' doesn't exist From /var/www/dolibarr/htdocs/core/lib/admin.lib.php:477.<br>

2025-09-30 16:10:27,156: DEBUG - 2025-09-30 15:10:26 ERR      189113       0 DoliDBMysqli::query Exception in query instead of returning an error: Table 'dolibarr.llx_don' doesn't exist<br>
2025-09-30 16:10:27,157: DEBUG - 2025-09-30 15:10:26 ERR      189113       0 DoliDBMysqli::query SQL Error message: DB_ERROR_NOSUCHTABLE Table 'dolibarr.llx_don' doesn't exist From /var/www/dolibarr/htdocs/core/lib/admin.lib.php:477.<br>



2025-09-30 16:10:27,156: DEBUG - 2025-09-30 15:10:26 ERR      189113       0 DoliDBMysqli::query Exception in query instead of returning an error: Table 'dolibarr.llx_don' doesn't exist<br>
2025-09-30 16:10:27,157: DEBUG - 2025-09-30 15:10:26 ERR      189113       0 DoliDBMysqli::query SQL Error message: DB_ERROR_NOSUCHTABLE Table 'dolibarr.llx_don' doesn't exist From /var/www/dolibarr/htdocs/core/lib/admin.lib.php:477.<br>

I think here you need help from dolibarr forum to understand what’s the matter…

Wait !! perhaps it is a another problem… Could you please try again upgrade on the testing branch ?

sudo yunohost app upgrade dolibarr -u https://github.com/YunoHost-Apps/dolibarr_ynh/tree/testing --debug

i tried, but failed again:

Ok, same problems in the database… I really think you need help in the dolibarr forum… Do you speak french ?

1 Like

un peu, I can understand almost everything, why?

just because there is a lot of french in the help forum…

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.