NextCloud: Heroku: Install: Patching NextCloud

From Gratiel's Wiki
Revision as of 23:00, 31 August 2019 by Ewanchic (talk | contribs) (Created page with " === Errors === * <span style="color:#e9322d">Some files have not passed the integrity check. Further information on how to resolve this issue can be found in the documentatio...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Errors

  • Some files have not passed the integrity check. Further information on how to resolve this issue can be found in the documentation. (List of invalid files… / Rescan…)

Click the list of Invalid files. My example:

Technical information
=====================
The following list covers which files have failed the integrity check. Please read
the previous linked documentation to learn more about the errors and how to fix
them.

Results
=======
- gallery
	- FILE_MISSING
		- .gitmodules
- files_external
	- INVALID_HASH
		- lib/Lib/Storage/AmazonS3.php

Raw output
==========
Array
(
    [gallery] => Array
        (
            [FILE_MISSING] => Array
                (
                    [.gitmodules] => Array
                        (
                            [expected] => 2ff42782d6cd17d3d172f3c367c7c9b14737242bd2a07ac08fd38ec00e2ec0e5abd12fd6d7dc822c226ffa2500b610c4468cbd96793bc8a3fe54744a1f7259e9
                            [current] => 
                        )

                )

        )

    [files_external] => Array
        (
            [INVALID_HASH] => Array
                (
                    [lib/Lib/Storage/AmazonS3.php] => Array
                        (
                            [expected] => 730faa8c9d4212f6940ae68c3cbf95297d7875ba753e5ea7d6103481e3eb6327058ba4efd5134a0a21e0f1727d2d88b6acd62ea20a50f6ecdb56ca5fe14a13c1
                            [current] => 4fc677f9e6586f856a58b48f31bb1fb8022383990875379ef68dc502967440cfefd13a611e7993fab2294108f6a6ab35033f708902d7f9fd344e01f10e729af2
                        )

                )

        )

)

HTTPS

  • Accessing site insecurely via HTTP. You are strongly adviced to set up your server to require HTTPS instead, as described in the security tips ↗.

WebDAVs

  • Your web server is not properly set up to resolve "/.well-known/caldav". Further information can be found in the documentation.
  • Your web server is not properly set up to resolve "/.well-known/carddav". Further information can be found in the documentation.

Database Fix

  • Some columns in the database are missing a conversion to big int. Due to the fact that changing column types on big tables could take some time they were not changed automatically. By running 'occ db:convert-filecache-bigint' those pending changes could be applied manually. This operation needs to be made while the instance is offline. For further details read the documentation page about this.
    • filecache.mtime
    • filecache.storage_mtime

Log into bash app

heroku ps:exec --app infinite-lowlands-38883

Navigate to code and run DB fix:

~ $ cd server/

Temporarily replace the config/config.php with al the environmental variable replaced.

<?php
$CONFIG = array (
  'instanceid' => 'oczm2c0yitlu',
  'objectstore' =>
  array (
    'class' => '\\OC\\Files\\ObjectStore\\S3',
    'arguments' =>
    array (
      'bucket' => $_SERVER['S3_BUCKET'],
      'autocreate' => true,
      'key' => $_SERVER['S3_KEY'],
      'secret' => $_SERVER['S3_SECRET'],
      'use_ssl' => true,
      'region' => $_SERVER['S3_REGION'],
      'use_path_style' => false,
    ),
  ),
  'memcache.local' => '\\OC\\Memcache\\APCu',  

  'passwordsalt' => $_SERVER['PASSWORD_SALT'],
  'secret' => $_SERVER['SECRET'],
  'trusted_domains' => 
  array (
    0 => 'infinite-lowlands-38883.herokuapp.com',
  ),
  'datadirectory' => $_SERVER['DATA_DIRECTORY'],
  'dbtype' => 'pgsql',
  'version' => '15.0.8.1',
  'overwrite.cli.url' => 'http://infinite-lowlands-38883.herokuapp.com',
  'dbname' => $_SERVER['DB_NAME'],
  'dbhost' => $_SERVER['DB_HOST'],
  'dbport' => '5432',
  'dbtableprefix' => 'oc_',
  'dbuser' => $_SERVER['DB_USER'],
  'dbpassword' => $_SERVER['DB_PASSWORD'],
  'installed' => true,  
  'log_type' => 'syslog',
  'logfile' => ,
  'loglevel' => '1',
  'logdateformat' => 'F d, Y H:i:s',  
  'twofactor_enforced' => 'true',
  'twofactor_enforced_groups' =>
  array (
  ),
  'twofactor_enforced_excluded_groups' =>
  array (
  ),  
);

Then it will run:

~/server $ php occ db:convert-filecache-bigint
The current PHP memory limit is below the recommended value of 512MB.
Following columns will be updated:

* filecache.mtime
* filecache.storage_mtime 

This can take up to hours, depending on the number of files in your instance!
Continue with the conversion (y/n)? [n] y
~/server $

Restart Heroku system.

heroku restart --app infinite-lowlands-38883

Return