nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
27.19k stars 4.04k forks source link

NC21 RC2 AND stable, NGINX, PHP8.0.2 causes regression and internal server error because session already active #25627

Closed squid-f closed 3 years ago

squid-f commented 3 years ago

How to use GitHub

Steps to reproduce

1.Install nginx and php-fpm (php8.0.2) 2.Configure php and nginx 3.Download NC21 RC1 4.Go to localhost/nextcloud 5.Get the installation wizard 6.Create admin user and enter database credentials 7.Internal server error

Expected behaviour

Get the apps installed and get NC user welcome page EDIT: I forgot to say I got it to work with NC21 Beta6 and PHP8.0.1 - same server, same configuration files

Actual behaviour

Internal Server Error The server was unable to complete your request. If this happens again, please send the technical details below to the server administrator. More details can be found in the server log. Technical details Remote Address: ::1 Request ID: JWgqlSa3sArAHCLqZ6IO error_mageia8rc1_nc21rc1

Server configuration

Operating system: Mageia 8 RC1 x86_64

Web server: nginx/1.18.0

Database: mysql Ver 15.1 Distrib 10.5.8-MariaDB, for Linux (x86_64) using readline 5.1 (same issue with postgresql)

PHP version: PHP 8.0.2 (cli) (built: Feb 3 2021 22:24:23) ( ZTS ) Copyright (c) The PHP Group Zend Engine v4.0.2, Copyright (c) Zend Technologies with Zend OPcache v8.0.2, Copyright (c), by Zend Technologies

Nextcloud version: NC21 RC2

Updated from an older Nextcloud/ownCloud or fresh install: fresh install

Where did you install Nextcloud from: https://download.nextcloud.com/server/prereleases/

Signing status: not possible to pass the installation wizard

List of activated apps: not possible to pass the installation wizard

Nextcloud configuration: not possible to pass the installation wizard

Are you using external storage, if yes which one: none

Are you using encryption: no

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

Client configuration

Browser:78.7.0esr (64-bit)

Operating system:Mageia 8 RC1 x86_64

Logs

Web server error log

Web server error log ``` 2021/02/13 17:35:21 [error] 5181#5181: *6 FastCGI sent in stderr: "PHP message: {"reqId":"aFmsnGYkYRrAYJPWu5Tu","level":3,"time":"2021-02-13T16:35:21+00:00","remoteAddr":"::1","user":"--","app":"PHP","method":"GET","url":"/nextcloud/","message":{"Exception":"Error","Message":"session_start(): Ignoring session_start() because a session is already active at /var/www/nextcloud/lib/private/Session/Internal.php#207","Code":0,"Trace":[{"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::"},{"function":"session_start"},{"file":"/var/www/nextcloud/lib/private/Session/Internal.php","line":207,"function":"call_user_func_array"},{"file":"/var/www/nextcloud/lib/private/Session/Internal.php","line":217,"function":"invoke","class":"OC\\Session\\Internal","type":"->"},{"file":"/var/www/nextcloud/lib/private/Session/Internal.php","line":107,"function":"startSession","class":"OC\\Session\\Internal","type":"->"},{"file":"/var/www/nextcloud/lib/private/Session/CryptoSessionData.php","line":150,"function":"clear","class":"OC\\Session\\Internal","type":"->"},{"file":"/var/" while reading response header from upstream, client: ::1, server: localhost, request: "GET /nextcloud/ HTTP/1.1", upstream: "fastcgi://unix:/var/lib/php-fpm/php-fpm.sock:", host: "localhost" ```

Nextcloud log (data/nextcloud.log)

Nextcloud log ``` No nextcloud.log created at this point ```

Browser log

Browser log ``` n/a ```
steadybright commented 3 years ago

I have numerous instances of this error in my Nextcloud log file since updating to NC21.

Although it appears multiple times in my Nextcloud 21.00-7 logfile, everything appears to be working normally.

PHP Error: session_start(): Ignoring session_start() because a session is already active at /usr/share/webapps/nextcloud/lib/private/Session/Internal.php#207

Full error text:

{"reqId":"BXIoruabrumQCYa4bK7s","level":3,"time":"2021-02-22T20:29:26-07:00","remoteAddr":"192.168.1.1","user":"--","app":"PHP","method":"GET","url":"/logout?requesttoken=ejiPIZtP02%2BSudw1NntYLc%2FriKh5KM8MhZmh2KXo6%2FA%3D%3AI0L8aP4XkSj6%2FasGbwspe4GMzPI9Tq1N%2F6mSjO%2Bjmbo%3D","message":{"Exception":**"Error","Message":"session_start(): Ignoring session_start() because a session is already active at /usr/share/webapps/nextcloud/lib/private/Session/Internal.php#207"**,"Code":0,"Trace":[{"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::"},{"function":"session_start"},{"file":"/usr/share/webapps/nextcloud/lib/private/Session/Internal.php","line":207,"function":"call_user_func_array"},{"file":"/usr/share/webapps/nextcloud/lib/private/Session/Internal.php","line":217,"function":"invoke","class":"OC\\Session\\Internal","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/Session/Internal.php","line":107,"function":"startSession","class":"OC\\Session\\Internal","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/Session/CryptoSessionData.php","line":150,"function":"clear","class":"OC\\Session\\Internal","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/User/Session.php","line":932,"function":"clear","class":"OC\\Session\\CryptoSessionData","type":"->"},{"file":"/usr/share/webapps/nextcloud/core/Controller/LoginController.php","line":125,"function":"logout","class":"OC\\User\\Session","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":218,"function":"logout","class":"OC\\Core\\Controller\\LoginController","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":127,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/AppFramework/App.php","line":157,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/Route/Router.php","line":302,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/usr/share/webapps/nextcloud/lib/base.php","line":993,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/usr/share/webapps/nextcloud/index.php","line":37,"function":"handleRequest","class":"OC","type":"::"}],"File":"/usr/share/webapps/nextcloud/lib/private/Log/ErrorHandler.php","Line":92,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:85.0) Gecko/20100101 Firefox/85.0","version":"21.0.0.18","id":"60351008c0c8e"}

squid-f commented 3 years ago

Hi Without doing anything else, I got a nextcloud.log file later on. It is here attached. nextcloud.log-NC21php802.txt

It is now mentioned one more thing which is : Host localhost was not connected to because it violates local access rules

squid-f commented 3 years ago

Hi To try to get more info, I just got the idea to use CLI installation. Indeed, I get some more but I am not able to interpret it.

`$ sudo -u apache php occ maintenance:install --database="pgsql" --data-dir="/data/ncdata" --database-name="nextcloud" --database-host="localhost" --database-user="adminpgsql" --database-pass="pwd-nc" --admin-user="ncadim" --admin-pass="totovm" An unhandled exception has been thrown: Error: Call to undefined function OC\filter_var() in /var/www/nextcloud/lib/private/Setup.php:483 Stack trace:

0 /var/www/nextcloud/lib/private/Setup.php(504): OC\Setup::findWebRoot()

1 /var/www/nextcloud/lib/private/Setup.php(426): OC\Setup::updateHtaccess()

2 /var/www/nextcloud/core/Command/Maintenance/Install.php(108): OC\Setup->install()

3 /var/www/nextcloud/3rdparty/symfony/console/Command/Command.php(255): OC\Core\Command\Maintenance\Install->execute()

4 /var/www/nextcloud/3rdparty/symfony/console/Application.php(1009): Symfony\Component\Console\Command\Command->run()

5 /var/www/nextcloud/3rdparty/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand()

6 /var/www/nextcloud/3rdparty/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun()

7 /var/www/nextcloud/lib/private/Console/Application.php(215): Symfony\Component\Console\Application->run()

8 /var/www/nextcloud/console.php(100): OC\Console\Application->run()

9 /var/www/nextcloud/occ(11): require_once('/var/www/nextcl...')

10 {main}`

This time, I used the latest released version of NC21 : $OC_Version = array(21,0,0,18); but it exhibits the same behavior than the RC.

squid-f commented 3 years ago

I have numerous instances of this error in my Nextcloud log file since updating to NC21.

Although it appears multiple times in my Nextcloud 21.00-7 logfile, everything appears to be working normally.

  • OS: Arch linux 5.10.16.arch1-1
  • Firefox 85.0.2 (64-bit) and Opera 74.0.3911.107
  • PHP 8.0.2-1
  • MariaDB 10.5.8-1
  • Nextcloud 21.0.0-7 `

Hi Steadybright Does it mean you have been able to pass the installation wizard step without issue to create the admin user and to initialize the database? I keep having the same issue even with 21.0.0 official release. It might be linked to my PHP8.0.2 installation or Nginx version (1.18.0) but I don't know where to look at anymore.

Any hint is welcome.

Thanks

squid-f commented 3 years ago

Hi again Well, I just got an idea which is to search the web for nextcloud Call to undefined function OC\filter_var I found a post mentioning php-filter should be installed. I installed php-filter and, now, it works. The strange thing is that it has not been necessary so far to install it explicitely. Is it because of the php 8.0.2 settings with my distro??

Anyway, I close this bug now thanks to the explicit installation of php-filter

eisengrau commented 3 years ago

Sorry to resurrect this thread, but I'm unable to find such package named php-filter, nor in the Debian repos, nor in Alpine. I actually noticed that "filter" module is enabled by default, at least in Alpine Linux, with PHP8. However Nextcloud still behaves the same as mentioned in this issue...

Not sure if I missed something. "Filter" definately shows up if I do a phpsysinfo.