Can't update Nextcloud. Getting 412 error in browser console

Nextcloud version (eg, 20.0.5): 21.0.1
Operating system and version (eg, Ubuntu 20.04): Ubuntu 20.04
Apache or nginx version (eg, Apache 2.4.25): 2.4.41-4ubuntu3.1
PHP version (eg, 7.4): 7.4.3

The issue you are facing:
Can’t update Nextcloud from web. See steps how to replicate it. It always gives me 412 Precondition failed

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

Steps to replicate it:

  1. Login to admin account
  2. Go to settings → see that there is new version of nextcloud
  3. Click Open updater → nothing happens
  4. Check browser console
  5. Click again
  6. **myserverurl**/index.php/apps/updatenotification/credentials returns 412 Precondition failed
  7. there are repeating 412 Precondition failed even on **myserverurl**/index.php/apps/user_status/heartbeat

The output of your Nextcloud log in Admin > Logging: I dont’ think there is something there

Error	public	Exception: The requested uri(/.well-known/webfinger) cannot be processed by the script '/drop/public.php')	
2021-06-02T20:26:01+0200
Error	public	Exception: The requested uri(/.well-known/webfinger) cannot be processed by the script '/drop/public.php')	
2021-06-02T20:14:55+0200
Fatal	webdav	Error: Call to a member function getId() on array	
2021-05-31T14:26:09+0200
Error	PHP	Error: Trying to access array offset on value of type bool at /var/www/html/drop/lib/private/Files/Storage/Wrapper/Encryption.php#669	
2021-05-31T14:26:08+0200
Error	PHP	Error: Trying to access array offset on value of type bool at /var/www/html/drop/lib/private/Files/Storage/Wrapper/Encryption.php#441	
2021-05-31T14:25:03+0200
Error	PHP	Error: Trying to access array offset on value of type bool at /var/www/html/drop/lib/private/Files/Storage/Wrapper/Encryption.php#441	
2021-05-31T14:24:00+0200

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

<?php
$CONFIG = array (
  'instanceid' => '*****',
  'passwordsalt' => '*****',
  'secret' => '*****',
  'trusted_domains' => 
  array (
    0 => '*****',
  ),
  'datadirectory' => '*****',
  'dbtype' => 'mysql',
  'version' => '21.0.1.1',
  'overwrite.cli.url' => '*****',
  'dbname' => '*****',
  'dbhost' => '*****',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => '*****',
  'dbpassword' => '*****',
  'installed' => true,
  'mysql.utf8mb4' => true,
  'maintenance' => false,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'mail_smtpmode' => 'smtp',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_sendmailmode' => 'smtp',
  'mail_smtpauth' => 1,
  'mail_smtpsecure' => 'tls',
  'mail_from_address' => '*****',
  'mail_domain' => '*****',
  'mail_smtphost' => '*****',
  'mail_smtpport' => '587',
  'mail_smtpname' => '*****',
  'mail_smtppassword' => '*****',
  'twofactor_enforced' => 'false',
  'twofactor_enforced_groups' => 
  array (
  ),
  'twofactor_enforced_excluded_groups' => 
  array (
  ),
  'theme' => '',
  'loglevel' => 2,
  'encryption.legacy_format_support' => false,
  'encryption.key_storage_migrated' => false,
  'default_phone_region' => 'CZ',
);

The output of your Apache/nginx/system log in /var/log/____:

nothing relevant just apache restarts I did

bump
nobody?

I just came across this 412 error when trying to change a password through an email on a crDroid 11 mobile with chrome, I was trying to see what had happened but saw nothing but this report.

As I had previously seen problems when trying to generate the email from the app on the mobile phone and that worked Ok from the laptop (firefox there) I tried changing the pass also from the laptop and that worked Ok.

After doing the password change from the laptop the app could login Ok.

I wonder why was I having all these problems from the app, at least it worked ok from the laptop.

Maybe this is not the problem that was reported, but maybe it helps somebody else.

Regards.