.htaccess hash mismatch blocking update [solved]

Nextcloud version : 20.0.5
Operating system and version : Debian 10
nginx version : 1.14.2
PHP version : 7.3.19~deb10u1

The issue you are facing:

I’m trying to update to 20.0.7, but the updater stops at integrity check because of .htaccess hash mismatch. The error started happening today, after some apps installations/deactivations.

Neither git last 15 versions, 20.0.5 zip release extracted file, nor occ maintenance:update:htaccess fixed the hash missmatch. When I first logged to my server today, the file was only a few lines long, but I’ve deleted the file since then, it’s now 20.0.5 release / occ update version (hash didn’t change between those two)
I found a backup I made on Jan 18, which, I’m almost certain, was working with no hash mismatch until today

  - INVALID_HASH:
    - .htaccess:
      - expected: 49b882eed84d95bc41965468746c9183a665b02a0a7e4814dd2c74930f8da878aa9d845a3735c0cbe472c01ded4005c3d46cf83fb5bf80bb351d226c7fa78ffe
      - current [release zip]: b67fa7814feef393101e26feafc5893fed4f04f4af9022c9fa5bbd109a37d464ed6fd1234896721dd99b26bdc152db8191ede7aebe545fde5c25d54676c45745
      - current [backup i had]: 2b83213cf19cbb2fb8da1aed2bfabbc4bb1f6e73d58df883615d08f74b9cfa5839776ed70e6efdd41992b8ed32076d62912d4e0bbd5d0031a9fa2bbff332acc9

Steps to replicate it: IDK, sorry. I installed, all was good, I had other integrity mismatch before but they’re solved now.

The output of your Nextcloud log in Admin > Logging:
Nothing worth mentioning, I believe. Almost only RouteNotFoundExceptions.

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

<?php
$CONFIG = array (
[...]
  ),
  'datadirectory' => '/var/www/[...server]/data',
  'dbtype' => 'pgsql',
  'version' => '20.0.5.2',
  'overwrite.cli.url' => 'http://[...server]',
  'dbname' => [...],
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'nextcloud',
  'dbpassword' => '[...]',
  'installed' => true,
  'log_type' => 'file',
  'logfile' => 'nextcloud.log',
  'loglevel' => 1,
  'mail_[...]
  'twofactor_enforced' => 'false',
  'twofactor_enforced_groups' =>
  array (
    0 => 'admin',
  ),
  'twofactor_enforced_excluded_groups' =>
  array (
  ),
  'updater.secret' => '[...]',
  'app_install_overwrite' => # those are disabled as of now
  array (
    0 => 'deck',
    1 => 'bookmarks',
    2 => 'mindmap_app',
  ),
  'maintenance' => true,
  'logtimezone' => 'Europe/Paris',
);

The output of your Apache/nginx/system log in /var/log/____:
I doubt it’s relevant here.

EDIT 1:

I thought I found a weird resolution by backing up signature.json, editing with my current .htaccess file hash, reloading Admin/Overview page, triggering manual integrity rescan, failing job, restoring backup, and reloading Admin/Overview page …
But then occ integrity:check-core and we’re back with both .htaccess mismatch (seems legit), AND ocs-provider/nextcloud.log empty file AND ocs/nextcloud.log of more than 1Gb AND ./nextcloud.log and ./nextcloud.log.1 with legit rotated size.
I’m really lost with all this mess.

EDIT 2:

I changed the title and removed most references to nextcloud.log as I solved this problem by changing the logfile path from relative nextcloud.log to absolute /var/log/nextcloud/nextcloud.log in config/config.php and giving nextcloud user write permission on this folder.
I still experience the invalid .htaccess hash blocking Nextcloud update nevertheless.

EDIT 3:

solved by going from stable to beta release channel … :sweat: