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

Nextcloud 21 - Error: session_start(): Ignoring session_start() because a session is already active #25807

Closed
apg1980 opened this issue Feb 26, 2021 · 19 comments · Fixed by #27631
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug

Comments

@apg1980
Copy link

apg1980 commented Feb 26, 2021

Hello,

my Log is flooding with this message:

Error: session_start(): Ignoring session_start() because a session is already active at /var/www/nextcloud/lib/private/Session/Internal.php#207

Environment:
Nextcloud 21
Ubuntu 20.04
Apache
PHP 8.0

We saw a similar issue on #20490

Best regards

How to use GitHub

  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Expected behaviour

Tell us what should happen

Actual behaviour

Tell us what happens instead

Server configuration

Operating system:

Web server:

Database:

PHP version:

Nextcloud version: (see Nextcloud admin page)

Updated from an older Nextcloud/ownCloud or fresh install:

Where did you install Nextcloud from:

Signing status:

Signing status
Login as admin user into your Nextcloud and access 
http://example.com/index.php/settings/integrity/failed 
paste the results here.

List of activated apps:

App list
If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
from within your Nextcloud installation folder

Nextcloud configuration:

Config report
If you have access to your command line run e.g.:
sudo -u www-data php occ config:list system
from within your Nextcloud installation folder

or 

Insert your config.php content here. 
Make sure to remove all sensitive content such as passwords. (e.g. database password, passwordsalt, secret, smtp password, …)

Are you using external storage, if yes which one: local/smb/sftp/...

Are you using encryption: yes/no

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...

LDAP configuration (delete this part if not used)

LDAP config
With access to your command line run e.g.:
sudo -u www-data php occ ldap:show-config
from within your Nextcloud installation folder

Without access to your command line download the data/owncloud.db to your local
computer or access your SQL server remotely and run the select query:
SELECT * FROM `oc_appconfig` WHERE `appid` = 'user_ldap';


Eventually replace sensitive data as the name/IP-address of your LDAP server or groups.

Client configuration

Browser:

Operating system:

Logs

Web server error log

Web server error log
Insert your webserver log here

Nextcloud log (data/nextcloud.log)

Nextcloud log
Insert your Nextcloud log here

Browser log

Browser log
Insert your browser log here, this could for example include:

a) The javascript console log
b) The network log
c) ...
@apg1980 apg1980 added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Feb 26, 2021
@Grotax
Copy link
Member

Grotax commented Feb 28, 2021

I see these messages popping up when I trigger a sync in the News android app. fyi @David-Development
This was also mentioned in the linked issue.

@solracsf solracsf changed the title Nextcloud 21 - Error: session_start(): Ignoring session_start() because a session is already active at /var/www/nextcloud/lib/private/Session/Internal.php#207 Nextcloud 21 - Error: session_start(): Ignoring session_start() because a session is already active Mar 9, 2021
@kiv57
Copy link

kiv57 commented Apr 12, 2021

Same here since 20 to 21 upgrade, at least every minute.

Debian 10
NC 21.0.1
PHP 8.0.3

@kingul
Copy link

kingul commented Apr 26, 2021

Same here, with php8.0-fpm ( with php7.4-fpm there is no error)

{"reqId":"2Ffwzmkqf8kGGBWq66Wy","level":3,"time":"2021-04-26T16:40:45+03:00","remoteAddr":"...","user":"--","app":"PHP","method":"GET","url":"/nextcloud/index.php/apps/passwords/api/1.0/session/keepalive","message":{"Exception":"Error","Message":"session_start(): Ignoring session_start() because a session is already active at /home/./public_html/nextcloud/lib/private/Session/Internal.php#207","Code":0,"Trace":[{"function":"onError","class":"OC\Log\ErrorHandler","type":"::"},{"function":"session_start"},{"file":"/home/./public_html/nextcloud/lib/private/Session/Internal.php","line":207,"function":"call_user_func_array"},{"file":"/home/./public_html/nextcloud/lib/private/Session/Internal.php","line":217,"function":"invoke","class":"OC\Session\Internal","type":"->"},{"file":"/home/./public_html/nextcloud/lib/private/Session/Internal.php","line":107,"function":"startSession","class":"OC\Session\Internal","type":"->"},{"file":"/home/./public_html/nextcloud/lib/private/Session/CryptoSessionData.php","line":150,"function":"clear","class":"OC\Session\Internal","type":"->"},{"file":"/home/./public_html/nextcloud/lib/private/User/Session.php","line":932,"function":"clear","class":"OC\Session\CryptoSessionData","type":"->"},{"file":"/home/./public_html/nextcloud/lib/private/AppFramework/Middleware/Security/CORSMiddleware.php","line":91,"function":"logout","class":"OC\User\Session","type":"->"},{"file":"/home/./public_html/nextcloud/lib/private/AppFramework/Middleware/MiddlewareDispatcher.php","line":98,"function":"beforeController","class":"OC\AppFramework\Middleware\Security\CORSMiddleware","type":"->"},{"file":"/home/./public_html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":119,"function":"beforeController","class":"OC\AppFramework\Middleware\MiddlewareDispatcher","type":"->"},{"file":"/home/./public_html/nextcloud/lib/private/AppFramework/App.php","line":157,"function":"dispatch","class":"OC\AppFramework\Http\Dispatcher","type":"->"},{"file":"/home/./public_html/nextcloud/lib/private/Route/Router.php","line":302,"function":"main","class":"OC\AppFramework\App","type":"::"},{"file":"/home/./public_html/nextcloud/lib/base.php","line":993,"function":"match","class":"OC\Route\Router","type":"->"},{"file":"/home/./public_html/nextcloud/index.php","line":37,"function":"handleRequest","class":"OC","type":"::"}],"File":"/home/./public_html/nextcloud/lib/private/Log/ErrorHandler.php","Line":92,"CustomMessage":"--"},"userAgent":"Official Passwords Client for Firefox on Linux","version":"21.0.1.1"}

@kiv57
Copy link

kiv57 commented May 20, 2021

Still there after 21.0.2 upgrade... Really annoying as the log is flooded with hundreds of entries a day

@cRUSHr2012
Copy link

Hi, I had this problem after updating between PHP 7.3 minor versions and also updating from Nextclod 19 to Nextcloud 20.
It seems the permissions for /var/opt/remi/php73/lib/php where changed to apache user instead of my nginx:nginx setup.
The outcome was that i could not login using the web interface.
A chown -R nginx:nginx /var/opt/remi/php73/lib/php solved it.

@csware
Copy link
Contributor

csware commented May 27, 2021

I also experienced this error for normal WebDAV requests:
{"app":"PHP","method":"REPORT","url":"/remote.php/dav/principals/users/XXXXXXXX/","message":{"Exception":"Error","Message":"session_start(): Ignoring session_start() because a session is already active at /var/www/XXXXX.XXX.XX/lib/private/Session/Internal.php#207","Code":0,"Trace":[{"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::"},{"function":"session_start"},{"file":"/var/www/XXXXX.XXX.XX/lib/private/Session/Internal.php","line":207,"function":"call_user_func_array"},{"file":"/var/www/XXXXX.XXX.XX/lib/private/Session/Internal.php","line":217,"function":"invoke","class":"OC\\Session\\Internal","type":"->"},{"file":"/var/www/XXXXX.XXX.XX/lib/private/Session/Internal.php","line":107,"function":"startSession","class":"OC\\Session\\Internal","type":"->"},{"file":"/var/www/XXXXX.XXX.XX/lib/private/Session/CryptoSessionData.php","line":150,"function":"clear","class":"OC\\Session\\Internal","type":"->"},{"file":"/var/www/XXXXX.XXX.XX/lib/private/User/Session.php","line":932,"function":"clear","class":"OC\\Session\\CryptoSessionData","type":"->"},{"file":"/var/www/XXXXX.XXX.XX/lib/private/User/Session.php","line":271,"function":"logout","class":"OC\\User\\Session","type":"->"},{"file":"/var/www/XXXXX.XXX.XX/lib/private/User/Session.php","line":244,"function":"validateSession","class":"OC\\User\\Session","type":"->"},{"file":"/var/www/XXXXX.XXX.XX/lib/private/legacy/OC_App.php","line":380,"function":"getUser","class":"OC\\User\\Session","type":"->"},{"file":"/var/www/XXXXX.XXX.XX/lib/private/legacy/OC_App.php","line":120,"function":"getEnabledApps","class":"OC_App","type":"::"},{"file":"/var/www/XXXXX.XXX.XX/lib/private/legacy/OC_User.php","line":123,"function":"loadApps","class":"OC_App","type":"::"},{"file":"/var/www/XXXXX.XXX.XX/lib/base.php","line":707,"function":"setupBackends","class":"OC_User","type":"::"},{"file":"/var/www/XXXXX.XXX.XX/lib/base.php","line":1076,"function":"init","class":"OC","type":"::"},{"file":"/var/www/XXXXX.XXX.XX/remote.php","line":115,"args":["/var/www/XXXXX.XXX.XX/lib/base.php"],"function":"require_once"}],"File":"/var/www/XXXXX.XXX.XX/lib/private/Log/ErrorHandler.php","Line":92,"CustomMessage":"--"},"userAgent":"iOS/14.4.2 (18D70) dataaccessd/1.0","version":"21.0.1.1"}

{"app":"PHP","method":"PROPFIND","url":"/remote.php/dav/principals/groups/benutzer/","message":{"Exception":"Error","Message":"session_start(): Ignoring session_start() because a session is already active at /var/www/XXXXX.XXX.XX/lib/private/Session/Internal.php#207","Code":0,"Trace":[{"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::"},{"function":"session_start"},{"file":"/var/www/XXXXX.XXX.XX/lib/private/Session/Internal.php","line":207,"function":"call_user_func_array"},{"file":"/var/www/XXXXX.XXX.XX/lib/private/Session/Internal.php","line":217,"function":"invoke","class":"OC\\Session\\Internal","type":"->"},{"file":"/var/www/XXXXX.XXX.XX/lib/private/Session/Internal.php","line":107,"function":"startSession","class":"OC\\Session\\Internal","type":"->"},{"file":"/var/www/XXXXX.XXX.XX/lib/private/Session/CryptoSessionData.php","line":150,"function":"clear","class":"OC\\Session\\Internal","type":"->"},{"file":"/var/www/XXXXX.XXX.XX/lib/private/User/Session.php","line":932,"function":"clear","class":"OC\\Session\\CryptoSessionData","type":"->"},{"file":"/var/www/XXXXX.XXX.XX/lib/private/User/Session.php","line":271,"function":"logout","class":"OC\\User\\Session","type":"->"},{"file":"/var/www/XXXXX.XXX.XX/lib/private/User/Session.php","line":244,"function":"validateSession","class":"OC\\User\\Session","type":"->"},{"file":"/var/www/XXXXX.XXX.XX/lib/private/legacy/OC_App.php","line":380,"function":"getUser","class":"OC\\User\\Session","type":"->"},{"file":"/var/www/XXXXX.XXX.XX/lib/private/legacy/OC_App.php","line":120,"function":"getEnabledApps","class":"OC_App","type":"::"},{"file":"/var/www/XXXXX.XXX.XX/lib/private/legacy/OC_User.php","line":123,"function":"loadApps","class":"OC_App","type":"::"},{"file":"/var/www/XXXXX.XXX.XX/lib/base.php","line":707,"function":"setupBackends","class":"OC_User","type":"::"},{"file":"/var/www/XXXXX.XXX.XX/lib/base.php","line":1076,"function":"init","class":"OC","type":"::"},{"file":"/var/www/XXXXX.XXX.XX/remote.php","line":115,"args":["/var/www/XXXXX.XXX.XX/lib/base.php"],"function":"require_once"}],"File":"/var/www/XXXXX.XXX.XX/lib/private/Log/ErrorHandler.php","Line":92,"CustomMessage":"--"},"userAgent":"Thunderbird CalDAV/CardDAV","version":"21.0.1.1"}

@Subnet-Masked
Copy link

#25806 mentions this issue. Appears to be a compatibility issue with PHP 8.x.x

After downgrading to 7.4, no issues anymore. I would suggest if you can, downgrading to PHP 7.4 in the meantime.

@yan12125
Copy link
Contributor

This issue persists in Nextcloud 22.0.0 beta 5 on php 8.0.7.

@kiv57
Copy link

kiv57 commented Jul 5, 2021

Still there after 21.0.3 upgrade, PHP 8.0.8.

Edit : the above fix seems to do the job.
Is there any risk of "false negative", a regular error that would be hidden with this fix ?

@sosed213
Copy link

sosed213 commented Jul 9, 2021

I have this problem.
Nextcloud 22.0.0
PHP 8.0.8

@yan12125
Copy link
Contributor

yan12125 commented Jul 9, 2021

Is there any risk of "false negative", a regular error that would be hidden with this fix ?

I don't think so. The fix #27631 hides errors that are suppressed by the error control operator (@). Those are intended to be hidden. I just make the behavior on PHP 8 match that on PHP 7.

@apg1980
Copy link
Author

apg1980 commented Jul 14, 2021

Good morning, i got the Error: session_start(): Ignoring session_start() because a session is already active at /var/www/nextcloud/lib/private/Session/Internal.php#206 error in Nextcloud 22 as well (again).

@yan12125
Copy link
Contributor

Good afternoon :)

That's expected - the fix is in git master (Nextcloud 23) only. The same fixes for Nextcloud 21 and 22 are on the road - see [stable21] and [stable22] pull requests mentioned above.

@ManySolutions
Copy link

I am currently getting this issue, I don't see a esolution to this? I am using Nextcloud Hub 3 (25.0.2)

@juliushaertl
Copy link
Member

#31286 could also help, with this one.

@daffydock
Copy link

daffydock commented Dec 28, 2022

I am currently getting this issue, I don't see a esolution to this? I am using Nextcloud Hub 3 (25.0.2)

Same here. I am only posting since this one is already closed. But perhaps should be reopened. Since like many, this one is spamming my blogs. At least for me, it spams my logs into the hundreds of MBs a week.

Edit: Worth nothing that it will usually appear when doing a cron job. But not always. I read elsewhere that someone claimed they got this error with the News app, perhaps as it was running as part of the cron, but I disabled it days ago and it seemed to slow down but alas, just got it again. It looks like it might be the notes app.

@ManySolutions
Copy link

I am not running the notes app. This is continuing and the error is logging around once a minute.

@theonlytruth
Copy link

I am running Nextcloud 26.0.2 and still getting the same error messages about every 20 seconds. I also tried to uninstall the notes app but this didn't solve the problem. Please reopen this issue or help with a solution to fix the problem.

@rajeshhazari
Copy link

Dear All,
I'm still seeing this error even after applying the fix manually and unable to use nextcloud from my home,
after I've upgraded from 25.0.x to 27.1.0
PHP 8.2.10
OC_Build = 2023-09-15T14:37:10+00:00

If anyone have a fix for this please share.
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.