Skip to content

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

Closed

Description

@apg1980

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) ...

Activity

  1. added
    0. Needs triage
    on Feb 26, 2021
  2. Grotax commented on Feb 28, 2021

    @Grotax
    Member

    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.

  3. 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[/+] on Mar 9, 2021
  4. kiv57 commented on Apr 12, 2021

    @kiv57

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

    Debian 10
    NC 21.0.1
    PHP 8.0.3

  5. kingul commented on Apr 26, 2021

    @kingul

    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"}

  6. kiv57 commented on May 20, 2021

    @kiv57

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

  7. cRUSHr2012 commented on May 26, 2021

    @cRUSHr2012

    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.

  8. csware commented on May 27, 2021

    @csware
    Contributor

    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"}

  9. Subnet-Masked commented on May 27, 2021

    @Subnet-Masked

    #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.

  10. yan12125 commented on Jun 23, 2021

    @yan12125

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

  11. kiv57 commented on Jul 5, 2021

    @kiv57

    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 ?

  12. sosed213 commented on Jul 9, 2021

    @sosed213

    I have this problem.
    Nextcloud 22.0.0
    PHP 8.0.8

  13. yan12125 commented on Jul 9, 2021

    @yan12125

    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.

  14. apg1980 commented on Jul 14, 2021

    @apg1980
    Author

    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).

  15. yan12125 commented on Jul 14, 2021

    @yan12125

    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.

  16. ManySolutions commented on Dec 22, 2022

    @ManySolutions

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

  17. juliusknorr commented on Dec 28, 2022

    @juliusknorr
    Member

    #31286 could also help, with this one.

  18. daffydock commented on Dec 28, 2022

    @daffydock

    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.

  19. ManySolutions commented on Dec 29, 2022

    @ManySolutions

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

  20. theonlytruth commented on May 31, 2023

    @theonlytruth

    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.

  21. rajeshhazari commented on Sep 21, 2023

    @rajeshhazari

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    0. Needs triagebug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions