I can't login to Nextcloud and upgrade raspberry pi

I have an instance on raspberry pi 4, and I have two problems.

  1. I can’t log in to nextcloud. The server works, but I can’t get into my files. Logging site just refreshes.
  2. I can’t upgrade raspberry pi. I attached output of command lower.

Nextcloud version (eg, 20.0.5): 23.0.0
Operating system and version (eg, Ubuntu 20.04): Raspbian GNU/Linux 10 (buster)
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.38-3+deb10u7
PHP version (eg, 7.4): 7.3

The issue you are facing:

Is this the first time you’ve seen this error? (Y/N): Y

The output of your Nextcloud log in Admin > Logging:

  Debug    no app in context  OC\AppFramework\Middleware\Security\Exceptions\NotLoggedInException: Current user is not logged in at                                        2022-02-08T08:45:33+00:00 
                              .../Middleware/Security/SecurityMiddleware.php line 153                                                                                                                
                              0. .../AppFramework/Middleware/MiddlewareDispatcher.php line 97                                                                                                        
                                 OC\AppFramework\Middleware\Security\SecurityMiddleware->beforeController(OCA\Files\Controller\ViewController {}, "index")                                           
                              1. lib/private/AppFramework/Http/Dispatcher.php line 118                                                                                                               
                                 OC\AppFramework\Middleware\MiddlewareDispatcher->beforeController(OCA\Files\Controller\ViewController {}, "index")                                                  
                              2. lib/private/AppFramework/App.php line 157                                                                                                                           
                                 OC\AppFramework\Http\Dispatcher->dispatch(OCA\Files\Controller\ViewController {}, "index")                                                                          
                              3. lib/private/Route/Router.php line 302                                                                                                                               
                                   OC\AppFramework\DependencyInjection\DIContainer {},                                                                                                               
                              4. lib/base.php line 1006                                                                                                                                              
                              5. index.php line 36                                                                                                                                                   

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

$CONFIG = array (
  'instanceid' => '',
  'passwordsalt' => '',
  'secret' => '',
  'trusted_domains' => 
  array (
    0 => '',
  'datadirectory' => '/var/www/html/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '',
  'overwrite.cli.url' => '',
  'dbname' => 'nextcloudd',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => '',
  'dbpassword' => '',
  'installed' => true,
  'updater.secret' => ',
  'theme' => '',
  'loglevel' => 0,
  'updater.release.channel' => 'stable',
  'app_install_overwrite' => 
  array (
    0 => 'whiteboard',
  'maintenance' => false,
  'data-fingerprint' => '7cec5200c21be3db80b2c4092445f104',

I removed passwords etc.
The output of your Apache/nginx/system log in /var/log/____: - - [08/Feb/2022:09:45:19 +0100] "GET /nextcloud/index.php/login?redirect_url=/nextcloud/index.php/apps/files/?dir%3D/ HTTP/1.1" 200 7711 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:95.0) Gecko/20100101 Firefox/95.0" - - [08/Feb/2022:09:45:33 +0100] "POST /nextcloud/index.php/login HTTP/1.1" 303 1303 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:95.0) Gecko/20100101 Firefox/95.0" - - [08/Feb/2022:09:45:33 +0100] "GET /nextcloud/index.php/apps/files/?dir=/ HTTP/1.1" 303 812 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:95.0) Gecko/20100101 Firefox/95.0" - - [08/Feb/2022:09:45:33 +0100] "GET /nextcloud/index.php/login?redirect_url=/nextcloud/index.php/apps/files/?dir%3D/ HTTP/1.1" 200 7707 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:95.0) Gecko/20100101 Firefox/95.0"

Sys info:

PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION="10 (buster)"

When I try to upgrade raspi, I get this:

root@raspberrypi:/home/pi# sudo apt full-upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] 
Setting up libpam-systemd:armhf (241-7~deb10u8+rpi1) ...
open(/var/lib/pam/seen) failed: No such file or directory at /usr/sbin/pam-auth-update line 232, <STDIN> line 16.
dpkg: error processing package libpam-systemd:armhf (--configure):
 installed libpam-systemd:armhf package post-installation script subprocess returned error exit status 2
dpkg: dependency problems prevent configuration of policykit-1:
 policykit-1 depends on libpam-systemd; however:
  Package libpam-systemd:armhf is not configured yet.

dpkg: error processing package policykit-1 (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)

There are sources:

root@raspberrypi:/home/pi# cat /etc/apt/sources.list
deb http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi

So, what should I do to log in to instance? I tried occ commands, like maintenance:repair. I checked disk, and there weren’t any problems. Nothing helped. :frowning:

hello @worek and welcome to the communityforum of NC

have you tried to either just f5 the tab/window in your browser or to clean cache of browser and try it again?

as for your other problem… that’s something I’d rather ask at a raspberry pi-forum

But there is, I think, no problem of browser. I tried log in in private tab and other computer, mobile app hasa problems to log in, too.
I removed cashe again and I can’t get to Nextcloud.

well all the things you posted about the login-problem only tell that the current user wasn’t logged in.
I see that you are able to login to your admin-account. so this problem refers apparently only to this one other account. maybe password is wrong? I dunno. You could set the password anew from admin-account under “users”. Don’t forget to click the “save”-button after changing stuff there.

Any user can’t log in. Passwords are both correct. (I checked 2 accounts on private mode).
Data comes from occ, I got from logging by ssh to raspberry pi, where instance is installed.

  Debug    no app in context  OC\AppFramework\Middleware\Security\Exceptions\NotLoggedInException: 2022-02-08T09:35:04+00:00 
                              Current user is not                              
                              logged in at                                     
                              line 153                                         
                              0. .../MiddlewareDispatcher.php line 97                           
                                   ... {},                                     
                                   ... x"                                      
                              1. .../Dispatcher.php line 118                           
                                   ... {},                                     
                                   ... x"                                      
                              2. .../App.php line 157                           
                                   OCA\F ... {},                               
                                   ... x"                                      
                              3. .../Router.php line 302                           
                                   "OCA\\Files\\Controller ... r",                           
                                   ... x",                                     
                                   OC\AppFramework\DependencyInjecti ... {},                           
                                   {_route:"f ... "}                           
                              4. .../base.php line 1006                           
                                   "\/ ... /"                                  
                              5. index.php line 36                             

There are logs from second account

when did login work for the last time? what did you do between then and now with/on your servers?

It works a week ago, I had 23 version and I did nothing. There was reboot, but it is hard to say if there was a cause of this.

well the reboot shouldn’t be the inital problem. Only if you changed (major?) things before rebooting.
it’s not clear to me: you installed NC23 newly or it was an upgrade from a previous version?

do you have backups from a working version?

I really can’t tell if it’s not related to the raspi OS problem you described…

It was upgrade, but I did it, a few weeks ago, so upgrade weren’t a cause, I think