Update to 30.0.4 login problem

Support intro

Sorry to hear you’re facing problems. :slightly_frowning_face:

The community help forum (help.nextcloud.com) is for home and non-enterprise users. Support is provided by other community members on a best effort / “as available” basis. All of those responding are volunteering their time to help you.

If you’re using Nextcloud in a business/critical setting, paid and SLA-based support services can be accessed via portal.nextcloud.com where Nextcloud engineers can help ensure your business keeps running smoothly.

Getting help

In order to help you as efficiently (and quickly!) as possible, please fill in as much of the below requested information as you can.

Before clicking submit: Please check if your query is already addressed via the following resources:

(Utilizing these existing resources is typically faster. It also helps reduce the load on our generous volunteers while elevating the signal to noise ratio of the forums otherwise arising from the same queries being posted repeatedly).

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can. :heart:

Server configuration detail

Operating system: Linux 5.15.0-126-generic #136-Ubuntu SMP Wed Nov 6 10:38:22 UTC 2024 x86_64

Webserver: Apache/2.4.52 (Ubuntu) (fpm-fcgi)

Database: mysql 10.6.18

PHP version: 8.2.24

Modules loaded: Core, date, libxml, openssl, pcre, zlib, filter, hash, json, random, Reflection, SPL, session, standard, sodium, cgi-fcgi, mysqlnd, PDO, xml, bcmath, calendar, ctype, curl, dom, mbstring, FFI, fileinfo, ftp, gd, gettext, gmp, iconv, igbinary, imagick, intl, exif, mysqli, pdo_mysql, Phar, posix, readline, shmop, SimpleXML, sockets, sysvmsg, sysvsem, sysvshm, tokenizer, xmlreader, xmlwriter, xsl, zip, redis, Zend OPcache

Nextcloud version: 30.0.4 - 30.0.4.1

Updated from an older Nextcloud/ownCloud or fresh install:

Where did you install Nextcloud from: unknown

Signing status

List of activated apps
Enabled:
 - activity: 3.0.0
 - admin_audit: 1.20.0
 - app_api: 4.0.3
 - bruteforcesettings: 3.0.0
 - calendar: 5.0.6
 - circles: 30.0.0
 - cloud_federation_api: 1.13.0
 - comments: 1.20.1
 - contacts: 6.1.1
 - contactsinteraction: 1.11.0
 - dashboard: 7.10.0
 - dav: 1.31.1
 - federatedfilesharing: 1.20.0
 - federation: 1.20.0
 - files: 2.2.0
 - files_downloadlimit: 3.0.0
 - files_pdfviewer: 3.0.0
 - files_reminders: 1.3.0
 - files_sharing: 1.22.0
 - files_trashbin: 1.20.1
 - files_versions: 1.23.0
 - fileslibreofficeedit: 2.0.1
 - firstrunwizard: 3.0.0
 - logreader: 3.0.0
 - lookup_server_connector: 1.18.0
 - nextcloud_announcements: 2.0.0
 - notifications: 3.0.0
 - oauth2: 1.18.1
 - password_policy: 2.0.0
 - photos: 3.0.2
 - privacy: 2.0.0
 - provisioning_api: 1.20.0
 - recommendations: 3.0.0
 - related_resources: 1.5.0
 - richdocuments: 8.5.3
 - richdocumentscode: 24.4.1002
 - serverinfo: 2.0.0
 - settings: 1.13.0
 - sharebymail: 1.20.0
 - support: 2.0.0
 - survey_client: 2.0.0
 - systemtags: 1.20.0
 - text: 4.1.0
 - theming: 2.5.0
 - twofactor_backupcodes: 1.19.0
 - updatenotification: 1.20.0
 - user_status: 1.10.0
 - viewer: 3.0.0
 - weather_status: 1.10.0
 - webhook_listeners: 1.1.0-dev
 - workflowengine: 2.12.0
Disabled:
 - camerarawpreviews: 0.8.6
 - custom_whitelist: 1.0.0
 - documents
 - encryption
 - files_external
 - files_rightclick: 1.6.0
 - music: 2.0.1
 - spreed: 20.0.2
 - suspicious_login
 - twofactor_nextcloud_notification
 - twofactor_totp
 - unsplash: 3.0.3
 - user_ldap
 - wopi: 3.5.11
Configuration (config/config.php)
{
    "instanceid": "***REMOVED SENSITIVE VALUE***",
    "passwordsalt": "***REMOVED SENSITIVE VALUE***",
    "secret": "***REMOVED SENSITIVE VALUE***",
    "trusted_domains": [
        "192.168.0.12",
        "mycloud.cloudns.ph",
        "localhost",
        "127.0.0.1",
        "79.107.132.159",
        "10.245.30.8",
        "10.229.189.125",
        "91.140.28.187",
        "10.228.100.162",
        "www.mycloud.cloudns.ph",
        "localhost"
    ],
    "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
    "forwarded_for_headers": [
        "HTTP_X_FORWARDED_FOR",
        "HTTP_FORWARDED"
    ],
    "tempdirectory": "\/var\/www\/html\/nextcloud\/tmp",
    "default_locale": "en_US",
    "default_timezone": "Europe\/Athens",
    "overwritehost": "mycloud.cloudns.ph",
    "overwriteprotocol": "https",
    "datadirectory": "***REMOVED SENSITIVE VALUE***",
    "dbtype": "mysql",
    "version": "30.0.4.1",
    "overwrite.cli.url": "https:\/\/mycloud.cloudns.ph\/",
    "htaccess.RewriteBase": "\/",
    "memory_limit": "4096M",
    "allow_local_remote_servers": true,
    "dbname": "***REMOVED SENSITIVE VALUE***",
    "dbhost": "***REMOVED SENSITIVE VALUE***",
    "dbport": "",
    "dbtableprefix": "oc_",
    "mysql.utf8mb4": true,
    "dbuser": "***REMOVED SENSITIVE VALUE***",
    "dbpassword": "***REMOVED SENSITIVE VALUE***",
    "installed": true,
    "default_phone_region": "GR",
    "maintenance": false,
    "theme": "",
    "loglevel": 1,
    "enable_previews": false,
    "memcache.local": "\\OC\\Memcache\\Redis",
    "filelocking.enabled": "true",
    "memcache.distributed": "\\OC\\Memcache\\Redis",
    "memcache.locking": "\\OC\\Memcache\\Redis",
    "redis": {
        "host": "***REMOVED SENSITIVE VALUE***",
        "port": 6379,
        "timeout": 0,
        "dbindex": 0
    },
    "0": [
        "documentserver_community"
    ],
    "mail_from_address": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpmode": "smtp",
    "mail_sendmailmode": "smtp",
    "mail_domain": "***REMOVED SENSITIVE VALUE***",
    "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpport": "465",
    "updater.release.channel": "stable",
    "maintenance_window_start": 1,
    "mail_smtpauth": 1,
    "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
    "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpstreamoptions": {
        "ssl": {
            "allow_self_signed": true,
            "verify_peer": false,
            "verify_peer_name": false
        }
    },
    "mail_smtpsecure": "ssl",
    "app_install_overwrite": [
        "documents",
        "wopi"
    ]
}

Cron Configuration: Array ( [backgroundjobs_mode] => cron [lastcron] => 1734089403 )

External storages: files_external is disabled

Encryption: no

User-backends:

  • OC\User\Database

Subscription:

  • No valid subscription key set

Browser: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36

Summary of the issue you are facing:

During update the installer stopped because there was a tmp folder in the insatallation path. So I moved it to other place. But I can’t login. The credentials are correct and the page just refreshes and askes again for the credentials.

When I move the folder back into the installation path then login is possible. Is that normal?

[PHP] Error: session_start(): Failed to read session data: files (path: /var/www/html/nextcloud/tmp) at /var/www/html/nextcloud/lib/private/Session/Internal.php#198
GET /index.php/apps/files/preview-service-worker.js
from 37.6.162.39 by – at 13 Δεκ 2024, 1:31:53 μ.μ.

[PHP] Error: session_start(): open(/var/www/html/nextcloud/tmp/sess_j07rs9v0h5pf4q3g1jbv3hb3i3, O_RDWR) failed: No such file or directory (2) at /var/www/html/nextcloud/lib/private/Session/Internal.php#198
GET /index.php/apps/files/preview-service-worker.js
from 37.6.162.39 by – at 13 Δεκ 2024, 1:31:53 μ.μ.

Based on the above, it sounds like your PHP environment is setup to use file-based session storage and, in turn, that you’ve configured it to use this extra tmp/ directory that was created in the Nextcloud installation folder.

Two things:

  • You’re already using Redis so switch your PHP to use the Redis session handler. See Using the Redis session handler in the Admin Manual.
  • If you want to stick with file-based session storage, simply use a folder outside of your Nextcloud installation directory and adjust PHP’s config to use that folder.

Tried to switch to redis seesion handler by adding to my php.ini file
[redis]
session.save_handler = redis
session.save_path = “tcp://127.0.0.1:6379”
redis.session.locking_enabled=1
redis.session.lock_retries=-1
redis.session.lock_wait_time=1000

and i commented out ; session.save_path = “/var/lib/php/sessions”

restarted php, apache2

but still cant login and I get back
{“reqId”:“Z10g13QTE-XH8Yer5QkYUgAAUwQ”,“level”:3,“time”:“2024-12-14T06:08:23+00:00”,“remoteAddr”:“79.107.132.159”,“user”:“–”,“app”:“PHP”,“method”:“GET”,“url”:“/index.php/apps/files/preview-service-worker.js”,“message”:“session_start(): Failed to read session data: redis (path: /var/www/html/nextcloud/tmp) at /var/www/html/nextcloud/lib/private/Session/Internal.php#198”,“userAgent”:“Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36”,“version”:“30.0.4.1”,“data”:{“app”:“PHP”}}

Cant get it! redis is looking at the /tmp path?

You appear to be using PHP-FPM.

There are different php configs for each mode of PHP. Look for a folder that has fpm in its name and change that ini file.

You’ll know when you’ve found the right one because it’ll currently have a reference to /var/www/html/nextcloud/tmp in it.

1 Like

first of all let me thank you for your assistance on this matter.

run some commands to locate the reference to the folder

Blockquote
sudo grep -r “/var/www/html/nextcloud/tmp” /etc/php

it seems that there is a configuration file for a specific PHP-FPM pool in PHP 8.2 named 1732254003346549
/etc/php/8.2/fpm/pool.d/1732254003346549.conf:php_value[upload_tmp_dir] = /var/www/html/nextcloud/tmp
/etc/php/8.2/fpm/pool.d/1732254003346549.conf:php_value[session.save_path] = /var/www/html/nextcloud/tmp

i guess that this “pool” overrides the settings in the php.ini file

The “big” question is now if I shall modify the pool configuration file to use redis, or disable pooling and use the global php.ini settings to setup redis.

One more thing is that this .conf file specifies a Unix socket for communication between my web server (Apache) and PHP-FPM, which I think performs faster, but I dont know how to see which port it uses to make the necessary changes in nextcloud’s config.php file.

Generally, do you think if it would be better in terms of performance to connect redis via TCP over TLS or switch to APCu ?

That’s my “redis” part in nextcloud config file

  'redis' => 
  array (
    'host' => '/run/redis/redis-server.sock',
    'port' => 0,
    'timeout' => 0.0,
  ),

and this is my php.ini part for redis (session parameters using unix socket) in /etc/php/8.3/fpm dir (!)

[Session]
; Handler used to store/retrieve data.
; https://php.net/session.save-handler
#-> see: https://www.c-rieger.de/nextcloud-unix-socket-kommunikation/
#session.save_handler = files
session.save_handler = redis
#-> see: https://www.c-rieger.de/redis-als-sessionhandler-fuer-php/
session.save_path = "unix:///var/run/redis/redis-server.sock?persistent=1&weight=1&database=0"
redis.session.locking_enabled = 1
redis.session.lock_retries = -1
redis.session.lock_wait_time = 10000

Hope it helps a bit :+1:

…and yes, it’s awfully fast! :upside_down_face:

I found the proper php.ini file and the default tmp directory is commented out.

Tried to specify the dir to be out of the nextcloud www folder both in php.ini, in config.php and did the redis adjustments. Restarted the respective services php8.2-fpm, apche2 and redis-server. But the problem persisted. Rebooted and still the same. Some how nextcloud keeps looking for the sme path for session tmp files!

Decided to switch to unix socket session handling made all the necessary adjustments as per book and still in the error log I get that there is no access to the /var/www/html/nextcloud/tmp directory during login attempts that are failing.

I switced to APcu double checking settings that can affect file locking, cache and session handling, the result was the same.

In all occasions I disabled fail2ban and modsecure, deleted all history and cleared the browsers cache, rebooted server. Nothing at all - same result.

Lastly I restored all previous settings, made the /etc/php/8.2/fpm/pool.d/1732254003346549.conf file and moved back the tmp foledr in nextcloud installation which resulted to have a working instance running without any problems or errors.

Last resort is to backup all my files do a new ubuntu server and nextcloud installation and start over the tuning. :frowning:

Should have named the thread “stuck with file session handling”!

Did you also make sure to remove this from your Nextcloud config/config.php?

1 Like

yes I did!
ceteris paribus, the setup works with without it.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.