Dependency Graph

Dependency Graph
related to related to child of child of duplicate of duplicate of

View Issue Details

IDProjectCategoryView StatusLast Update
0004385SOGosogo-toolpublic2018-04-27 16:37
ReporterASolana Assigned Tofrancis  
PriorityimmediateSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.2.10 
Fixed in Version4.0.1 
Summary0004385: Sogo-tool deletes sogo_acl table when it restores folders from a user backup
Description

I have a Sogo 3.2.10 server using a MYSQL sogo database

sogo-tool deletes sogo_acl table when it's restoring folders from a user backup file generated with sogo-tool.

Executed command: "sogo-tool -f ALL folder user"

I followed steps explained in page https://sogo.nu/support/faq/how-can-i-backuprestore-my-user-data.html

I've activated "MySQL4DebugEnabled = YES;" in /etc/sogo/sogo.conf

sogo-tool -f ALL folder user > user.folder.restore.log 2>&1

Steps To Reproduce
  1. Activate Mysql debug in /etc/sogo/sogo.conf adding this line:
    "MySQL4DebugEnabled = YES;"

then restart sogo service:

service sogo restart

  1. Create a user backup file with sogo-tool

sogo-tool -f ALL folder user

  1. Create a Mysql sogo_acl table backup
    mysqldump sogo sogo_acl > 1.sogo.sogo_acl.sql

  2. Remove user
    sogo-tool remove user

  3. Restore user folders:
    sogo-tool restore -f ALL folder user > user.folder.restore.log 2>&1

At this point all sogo_acl table contents are deleted.

user.folder.restore.log file contents shows how sogo-tool executes an "UPDATE" and a "DELETE FROM sogo_acl;" commands for every object folder in "user" backup file.

"DELETE FROM sogo_acl" command it has no sense, it deletes everything.

  1. Create a Mysql sogo_acl table backup post restore:
    mysqldump sogo sogo_acl > 2.sogo.sogo_acl.sql

You can see 2.sogo.sogo_acl.sql file is empty.

Additional Information

Execute this command:

cat sogo-tool.user.folder.restore.log | egrep "UPDATE|DELETE"

in order to see how "DELETE FROM sogo_acl;" is executed for each of 6 folders in the "usuari.elena2" backup file:

$ cat sogo-tool.user.folder.restore.log | egrep "UPDATE|DELETE"
2018-02-05 17:52:09.858 sogo-tool[37559] <MySQL4Channel[0x0x2726f40] connection=0x0x26e24f0> SQL: UPDATE sogo_folder_info SET c_foldername = 'Calendari personal' WHERE c_path = '/Users/usuari.elena2/Calendar/personal';
2018-02-05 17:52:09.861 sogo-tool[37559] <MySQL4Channel[0x0x2726f40] connection=0x0x26e24f0> SQL: DELETE FROM sogo_acl;
2018-02-05 17:52:10.030 sogo-tool[37559] <MySQL4Channel[0x0x2726f40] connection=0x0x26e24f0> SQL: UPDATE sogo_folder_info SET c_foldername = 'Llibreta d''adreces de usuari.elena2' WHERE c_path = '/Users/usuari.elena2/Contacts/CB76-5A761500-1-56127A00';
2018-02-05 17:52:10.034 sogo-tool[37559] <MySQL4Channel[0x0x2726f40] connection=0x0x26e24f0> SQL: DELETE FROM sogo_acl;
2018-02-05 17:52:10.056 sogo-tool[37559] <MySQL4Channel[0x0x2726f40] connection=0x0x26e24f0> SQL: UPDATE sogo_folder_info SET c_foldername = 'Agenda de usuari.elena2' WHERE c_path = '/Users/usuari.elena2/Calendar/CC1E-5A761580-1-452BAD80';
2018-02-05 17:52:10.059 sogo-tool[37559] <MySQL4Channel[0x0x27ff6a0] connection=0x0x2a6abe0> SQL: DELETE FROM sogo_acl;
2018-02-05 17:52:10.179 sogo-tool[37559] <MySQL4Channel[0x0x27ff6a0] connection=0x0x2a6abe0> SQL: UPDATE sogo_folder_info SET c_foldername = 'Copia ASF' WHERE c_path = '/Users/usuari.elena2/Contacts/CB99-5A761500-1-5B8A7700';
2018-02-05 17:52:10.183 sogo-tool[37559] <MySQL4Channel[0x0x2726f40] connection=0x0x26e24f0> SQL: DELETE FROM sogo_acl;
2018-02-05 17:52:16.634 sogo-tool[37559] <MySQL4Channel[0x0x27ff6a0] connection=0x0x2a6abe0> SQL: UPDATE sogo_folder_info SET c_foldername = 'Personal Address Book' WHERE c_path = '/Users/usuari.elena2/Contacts/personal';
2018-02-05 17:52:16.639 sogo-tool[37559] <MySQL4Channel[0x0x2726f40] connection=0x0x26e24f0> SQL: DELETE FROM sogo_acl;
2018-02-05 17:52:16.650 sogo-tool[37559] <MySQL4Channel[0x0x27ff6a0] connection=0x0x2a6abe0> SQL: UPDATE sogo_folder_info SET c_foldername = '2on. calendari usuari.elena2' WHERE c_path = '/Users/usuari.elena2/Calendar/CC3F-5A761580-1-6EE7C600';
2018-02-05 17:52:16.654 sogo-tool[37559] <MySQL4Channel[0x0x2726f40] connection=0x0x26e24f0> SQL: DELETE FROM sogo_acl;

TagsNo tags attached.

Relationships

duplicate of 0004256 resolvedfrancis sogo-tool (SOGo-3.2.10) cannot fully restore backup generated by SOGo-2.3.22 
has duplicate 0004390 closedfrancis Sogo-tool deletes sogo_acl table when it restores folders from a user backup 

Activities

ASolana

ASolana

2018-02-05 19:07

reporter  

ASolana

ASolana

2018-02-05 19:11

reporter   ~0012562

The Reproducibility is ALWAYS (not sometimes).

ASolana

ASolana

2018-02-07 16:30

reporter   ~0012582

I cannot change Reproducibility contents to "Always", so I've opened other bug

https://sogo.nu/bugs/view.php?id=4390 with maximum priority and "Reproducibility=Always"

Related Changesets

sogo: master f3189204

2018-04-27 12:34

francis


Details Diff
(sogo-tool) Fix ACLs restore in single store mode

Fixes 0004256
Fixes 0004385
Fixes 0004390
Affected Issues
0004256, 0004385, 0004390
mod - NEWS Diff File
mod - SOPE/GDLContentStore/GCSFolder.m Diff File
mod - Tools/SOGoToolRestore.m Diff File

Issue History

Date Modified Username Field Change
2018-02-05 19:07 ASolana New Issue
2018-02-05 19:07 ASolana File Added: sogo-tool.user.folder.restore.log
2018-02-05 19:11 ASolana Note Added: 0012562
2018-02-07 16:25 francis Relationship added has duplicate 0004390
2018-02-07 16:30 ASolana Note Added: 0012582
2018-02-07 16:45 francis Severity major => minor
2018-02-07 16:45 francis Reproducibility sometimes => always
2018-02-07 16:45 francis Relationship added duplicate of 0004256
2018-04-27 16:36 francis Changeset attached => sogo master f3189204
2018-04-27 16:36 francis Assigned To => francis
2018-04-27 16:36 francis Resolution open => fixed
2018-04-27 16:37 francis Status new => resolved
2018-04-27 16:37 francis Fixed in Version => 4.0.1