View Issue Details

IDProjectCategoryView StatusLast Update
0005006SOGosogo-toolpublic2020-04-17 16:14
ReporterChristian Mack Assigned Tofrancis  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Platformx86_64OSDebianOS Version10 Buster
Product Version4.3.0 
Fixed in Version4.3.1 
Summary0005006: faulty sogo-tool restore results in white screen error 501 on login
Description

We switched from SOGo version 2.3.23 to version 4.3.0.
For that we made a complete backup with sogo-tool on the 2.3.23 machine, copied that backup to the new 4.3.0 machine and made a sogo-tool restore.

This was processed without errors.
Afterwards some users can log in successfully, but can only see a white screen or error 501 (depending on used browser).
In sogo.log we see an 501 error about PreventInvitationsWhitelist.
When checking that for "affectedUser" with
/usr/sbin/sogo-tool user-preferences get settings affectedUser Calendar
we get
Calendar: {"PreventInvitationsWhitelist": "", "PreventInvitations": 0, "View": "weekview"}

As you can see PreventInvitationsWhitelist is stored as empty String, but is defined as array.
Fix is to set it to an array with:
/usr/sbin/sogo-tool user-preferences set settings affectedUser Calendar '{"Calendar":{"PreventInvitations":0,"PreventInvitationsWhitelist":{},"View":"weekview"}}'

I checked all affected users.
They all are very old, which means they were migrated from SOGo version 1 to SOGo version 2 to SOGo version 4.
In their backup file that wrong setting was stored as empty String.
And sogo-tool V4 imported it as empty String without giving any error.
But it also did backup it again without error as empty String!

sogo-tool should either convert that empty String to an empty array on restore, or should give an error on setting, backup and restore.

Steps To Reproduce

1) change setting PreventInvitationsWhitelist to empty String with
/usr/sbin/sogo-tool user-preferences set settings affectedUser Calendar '{"Calendar":{"PreventInvitations":0,"PreventInvitationsWhitelist":"","View":"weekview"}}'
=> You do not get an error!!!

2) make a backup with sogo-tool
/usr/sbin/sogo-tool backup /tmp affectedUser
=> You do not get an error!!!
In that backup PreventInvitationsWhitelist is set to "".

3) restore that affectedUser
/usr/sbin/sogo-tool restore -p /tmp affectedUser
=> You do not get an error!!!
And the setting is not corrected either.

Additional Information

SOGo 4.3.0 stable

TagsNo tags attached.

Activities

There are no notes attached to this issue.

Related Changesets

sogo: master 824b3833

2020-04-17 12:11

francis


Details Diff
fix(preferences): avoid exception when parsing PreventInvitationsWhitelist

Fixes 0005006
Affected Issues
0005006
mod - UI/PreferencesUI/UIxJSONPreferences.m Diff File

Issue History

Date Modified Username Field Change
2020-04-15 10:50 Christian Mack New Issue
2020-04-17 16:14 francis Changeset attached => sogo master 824b3833
2020-04-17 16:14 francis Assigned To => francis
2020-04-17 16:14 francis Resolution open => fixed
2020-04-17 16:14 francis Status new => resolved
2020-04-17 16:14 francis Fixed in Version => 4.3.1