Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CardDAV settings are not saved -> CardDAV sync broken #163

Closed
Mer0me opened this issue Nov 23, 2021 · 11 comments
Closed

CardDAV settings are not saved -> CardDAV sync broken #163

Mer0me opened this issue Nov 23, 2021 · 11 comments

Comments

@Mer0me
Copy link

Mer0me commented Nov 23, 2021

When I set my CardDAV configuration (URL, user, password), it disappears after logout/login
When I try to do a CardDAV sync, I get a sync error popup, the log file doesn't show any reference to the sync URL

v2.5.2 with same configuration worked fine.

Steps to reproduce the behavior:

  1. Set a CardDAV sync configuration
  2. Test sync => don't work
  3. Logout / login => the CardDAV configuration has not been set

Expected behavior
CardDAV configuration should be saved and sync should work.

Desktop (please complete the following information):

  • Firefox 91.3 ESR
  • SnappyMail Version 2.9.3

Additional context
I was thinking about config file permission but my "settings" file is modified when I change the number of messages per page (22 in this example) :
{"Language":"fr-FR","MPP":22}
However, when I go to General config, the message per page displayed is the default one (20)

@m-i-k-e-y
Copy link

I think this is a more general issue than just CardDav sync.

With the latest version of Snappymail I noticed that none of the settings that I change for an account is applied after login (for example: horizontal vs. vertical view mode, seconds after which a message is marked as read, should images be displayed, etc.). I have to change the settings every time I log in into an account.

Just as @Mer0me I can see that the settings file (in data/_data_/_default_/storage/<domain>/<account>) for the account is updated when I change a setting and the changed setting is applied, but only as long as as stay logged in. As soon as I log out and log in again, the settings are not applied although the settings file is still there with the changed values from the last time (timestamp of the file does not change until I change the values again).

@the-djmaze
Copy link
Owner

I will check carddav.
Settings lost is fixed in e614524

Issue is caused by new login system that doesn't need reload of all assets.
RainLoop did a forced reload/f5/refresh which caused additional server requests to ask everything again.
I was testing this until i discovered the security vulnerability.

Will do some more testing because next release also fully supports UTF8 IMAP servers like Courier.

@m-i-k-e-y
Copy link

I will check carddav. Settings lost is fixed in e614524

Issue is caused by new login system that doesn't need reload of all assets. RainLoop did a forced reload/f5/refresh which caused additional server requests to ask everything again. I was testing this until i discovered the security vulnerability.

Will do some more testing because next release also fully supports UTF8 IMAP servers like Courier.

Thanks for fixing the settings issue. I'll wait for a new release to test it (there are too many files involved in the changeset to manually apply it and I'm afraid I would make things worse if would try).

@phsc84
Copy link

phsc84 commented Nov 24, 2021

Would also be happy to test as soon as a new release is ready. :-)

@the-djmaze
Copy link
Owner

v2.9.4 released. you could test if it works

@m-i-k-e-y
Copy link

Thumbs up, settings are working again!

I will test card-dav sync later today.

Thanks a lot @the-djmaze

@m-i-k-e-y
Copy link

m-i-k-e-y commented Dec 2, 2021

CardDav sync doesn't work for me with v2.9.4. I get an error in the UI when I hit the synchronize button and I found these errors in the logfile of nginx:

2021/12/02 15:18:24 [error] 1196901#1196901: *10655 FastCGI sent in stderr: "PHP message: Argument 1 passed to RainLoop\Actions::setContactsSyncData() must be an instance of RainLoop\Model\Account, array given, called in /var/www/snappymail/snappymail/v/2.9.4/app/libraries/RainLoop/Actions/Contacts.php on line 30" while reading response header from upstream, client: [redacted], server: [redacted], request: "POST /?/Json/&q[]=/0/ HTTP/2.0", upstream: "fastcgi://unix:/var/run/php/php7.4-fpm.sock:", host: "[redacted]" 2021/12/02 15:18:32 [error] 1196901#1196901: *10655 FastCGI sent in stderr: "PHP message: Argument 1 passed to RainLoop\Actions::setContactsSyncData() must be an instance of RainLoop\Model\Account, array given, called in /var/www/snappymail/snappymail/v/2.9.4/app/libraries/RainLoop/Actions/Contacts.php on line 30" while reading response header from upstream, client: [redacted], server: [redacted], request: "POST /?/Json/&q[]=/0/ HTTP/2.0", upstream: "fastcgi://unix:/var/run/php/php7.4-fpm.sock:", host: "[redacted]" 2021/12/02 15:18:36 [error] 1196901#1196901: *10655 FastCGI sent in stderr: "PHP message: Argument 1 passed to RainLoop\Actions::setContactsSyncData() must be an instance of RainLoop\Model\Account, array given, called in /var/www/snappymail/snappymail/v/2.9.4/app/libraries/RainLoop/Actions/Contacts.php on line 30" while reading response header from upstream, client: [redacted], server: [redacted], request: "POST /?/Json/&q[]=/0/ HTTP/2.0", upstream: "fastcgi://unix:/var/run/php/php7.4-fpm.sock:", host: "[redacted]" 2021/12/02 15:18:47 [error] 1196901#1196901: *10655 FastCGI sent in stderr: "PHP message: Argument 1 passed to RainLoop\Actions::setContactsSyncData() must be an instance of RainLoop\Model\Account, array given, called in /var/www/snappymail/snappymail/v/2.9.4/app/libraries/RainLoop/Actions/Contacts.php on line 30" while reading response header from upstream, client: [redacted], server: [redacted], request: "POST /?/Json/&q[]=/0/ HTTP/2.0", upstream: "fastcgi://unix:/var/run/php/php7.4-fpm.sock:", host: "[redacted]" 2021/12/02 15:19:25 [error] 1196901#1196901: *10655 FastCGI sent in stderr: "PHP message: ContactsSyncError[140]" while reading response header from upstream, client: [redacted], server: [redacted], request: "POST /?/Json/&q[]=/0/ HTTP/2.0", upstream: "fastcgi://unix:/var/run/php/php7.4-fpm.sock:", host: "[redacted]"

the-djmaze pushed a commit that referenced this issue Dec 2, 2021
@m-i-k-e-y
Copy link

@the-djmaze:

I applied your latest commit, the error messages I posted previously are gone but I have these now in the nginx logs:

2021/12/05 12:04:58 [error] 1677434#1677434: *1 FastCGI sent in stderr: "PHP message: Cannot use object of type stdClass as array" while reading response header from upstream, client: [redacted], server: [redacted], request: "POST /?/Json/&q[]=/0/ HTTP/2.0", upstream: "fastcgi://unix:/var/run/php/php7.4-fpm.sock:", host: "[redacted]" 2021/12/05 12:05:02 [error] 1677434#1677434: *1 FastCGI sent in stderr: "PHP message: Cannot use object of type stdClass as array" while reading response header from upstream, client: [redacted], server: [redacted], request: "POST /?/Json/&q[]=/0/ HTTP/2.0", upstream: "fastcgi://unix:/var/run/php/php7.4-fpm.sock:", host: "[redacted]" 2021/12/05 12:05:05 [error] 1677434#1677434: *1 FastCGI sent in stderr: "PHP message: Cannot use object of type stdClass as array" while reading response header from upstream, client: [redacted], server: [redacted], request: "POST /?/Json/&q[]=/0/ HTTP/2.0", upstream: "fastcgi://unix:/var/run/php/php7.4-fpm.sock:", host: "[redacted]"

Server is running Debian 11 (Bullseye) with nginx 1.18.0 and php(-fpm) 7.4 if that makes any difference.

the-djmaze pushed a commit that referenced this issue Dec 6, 2021
@the-djmaze
Copy link
Owner

Could you try with v2.9.6?
https://github.com/the-djmaze/snappymail/releases/tag/v2.9.6

@m-i-k-e-y
Copy link

I tried v2.9.6 and CardDav sync seems to be working again, no errors found in the logfile on nginx.

Thanks @the-djmaze

@Mer0me
Copy link
Author

Mer0me commented Dec 17, 2021

CardDav sync works here too with 2.9.6. I close this one too. Thanks !

@Mer0me Mer0me closed this as completed Dec 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants