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

Snappymail in Nextcloud 25.0.2 on php 8.1 #813

Closed
cmflouis opened this issue Dec 30, 2022 · 10 comments
Closed

Snappymail in Nextcloud 25.0.2 on php 8.1 #813

cmflouis opened this issue Dec 30, 2022 · 10 comments
Labels
external Issue is outside our code Nextcloud

Comments

@cmflouis
Copy link

cmflouis commented Dec 30, 2022

Hello,
Just a small drop to let you know that it seems to have an anomaly with snappymail app in nextcloud. It seem related with php 8.1. I don't have this behavior in php 8.0.26
Thank you for your hard work.

Describe the bug
Avery minute on so this line appear in the log when snappymail is active.
session_start(): Ignoring session_start() because a session is already active at /var/www/html/nextcloud/lib/private/Session/Internal.php#219

To Reproduce
Steps to reproduce the behavior:

  1. Install almalinux v8.7
  2. Install php 8.1
  3. Install Nextcloud 25.0.2
  4. Install 2.24.3

Expected behavior
No logs errors.

Screenshots
snappymail error

Please complete the following information:

  • Browser: Firefox 108.0.1
  • IMAP daemon: postfix v3.7.2, dovecot 2.3.19.1
  • PHP version: 8.1
  • SnappyMail Version: 2.24.3

Debug/logging information
session_start(): Ignoring session_start() because a session is already active at /var/www/html/nextcloud/lib/private/Session/Internal.php#219

Additional context
None

@the-djmaze
Copy link
Owner

SnappyMail does not use PHP sessions.
However, it could be possible that SnappyMail triggers a certain Nextcloud function that behaves the wrong way.
Somewhere Nextcloud calls session_start where it should not.

I only have PHP 7.4 and 8.2 setups and Nextcloud fails on 8.2, so if you have more details it would be great.

@cmflouis
Copy link
Author

First thing first. Thank you for your fast reply.
Second I would like to which you a happy new year because it’s pretty soon.

Now about this case you won’t be able to test this with php 8.2. Nextcloud is not compatible with that version yet.
From your explanation maybe nextcloud is the problem but what I observe is that fact that the logs begin to trigger errors at the moment I activate it and that’s not happening with rainloop. With rainloop I have another type of problem but I don’t want to troubleshoot it because it is deprecated.
I made some research and it seems that snappymail is not the only application that causes this error and it’s not only from v25 of nextcloud. Since v21 some app cause this type of wrong behaviour. I will continue my search because I use your app on a daily basis.
Let me know on what direction you want me to put my attention to try to help you. I am thinking to open a ticket on nextcloud also.
Again, thank you for your good work.
Regards

@the-djmaze
Copy link
Owner

You can start with:

  1. Open browser developer tools
  2. Look at the Network tab/section

There you will see all network requests.
Now open the Nextcloud log and match a datetime entry with one of the browser network tab and you will notice which request causes the issue.

From there you need to dive in the PHP code and trace the route that causes the issue.

@the-djmaze
Copy link
Owner

the-djmaze commented Jan 12, 2023

I get it that you are thrown from one project to the other.
But SnappyMail does not call OC::initSession() that creates the session, nor does it include lib/base.php

Your problem is that lib/base.php is included twice.
And to find out why that is, you must modify the bottom of the lib/base.php file into:

if (OC::$SERVERROOT) {
	error_log('base.php loaded twice: '.print_r(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS), true));
} else {
	OC::init();
}

It would have been better that Nextcloud has these checks, but it doesn't...

@the-djmaze the-djmaze added external Issue is outside our code needs feedback Further information is requested labels Jan 18, 2023
@the-djmaze
Copy link
Owner

Any luck finding the issue?

@cmflouis
Copy link
Author

Hi the-djmaze ,
I did not put to much time on it but it seems to be how nextcloud manage the apps internally. There is a new version of nextcloud that is out and I will update that during the week-end and let you know. I have 2 applications that trigger this error and I use both on a daily basis. So it is not and option to disable one of the to stop this error. More over that does not flood the logs as I though it was at the beginning of our conversation. It is bad but not dramatic. We can let this case open but if you prefer to close it without resolution we can also. If you want to close it I suggest that you do it next week to let me the time to upgrade nextcloud and give you feedback after that.
Regards,
cmflouis

@the-djmaze
Copy link
Owner

Ok. Don't forget you can use above mentioned change in lib/base.php to find the problem.
The change will not interfere with how Nextcloud works and writes the problem to the php error log.

@the-djmaze
Copy link
Owner

I found the problem and it is Nextcloud internals.

So i will close and they need to fix it.
nextcloud/server#36083 (comment)

@the-djmaze the-djmaze removed the needs feedback Further information is requested label Jan 18, 2023
the-djmaze pushed a commit that referenced this issue Jan 18, 2023
@the-djmaze
Copy link
Owner

nextcloud/server#36239

@daffydock
Copy link

Thanks @the-djmaze

Just for others who may somehow come to this issue. On the User end, this also seems to happen when Snappymail is working in conjunction with other apps. I noticed that it may happen when Snappymail is enabled along with the Notes App and/or the Password app. If I disable the Notes app or Snappymail, the error goes away.

Clearly a Nextcloud Server issue, thanks for including your findings in nextcloud/server#36239

Since I also get the same error when I am trying to use NC's new Notes app editor while Snappymail is activated. It has been months and the PR does not seem to be addressed. Thought it would be added by NC 26.0.1. Apparently not, plus the Notes editor is still not fully functional for me. Snappymail active or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external Issue is outside our code Nextcloud
Projects
None yet
Development

No branches or pull requests

3 participants