Truenas Plugin Nextcloud Upgrade Fail 21 to 22

Hi,
Can anybody assist with the error below. After doing the following commends below in TrueNas

  1. iocage fetch (choose 12.2-RELEASE)
  2. iocage upgrade -r 12.2-RELEASE nextcloud
  3. pkg update
  4. pkg upgrade
    I get the following error below…I used the TrueNAS Nextcloud Plugin.
    Type:
    pluginv2
    NextCloud22-Err

[/details]

Nextcloud version (eg 22.0.0_1): ‘22.0.0_1’
Operating system and version (eg TRUENAS): TRUENAS
nginx version (eg, seperate jail): nginx 1.50
PHP version (eg, 7.4): 7.4

The issue you are facing:

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

Steps to replicate it:

  1. iocage fetch (choose 12.2-RELEASE)
  2. iocage upgrade -r 12.2-RELEASE nextcloud
  3. pkg update
  4. pkg upgrade

The output of your Nextcloud log in Admin > Logging:

MySQL is running logging to '**/var/db/mysql/nextcloud.err**'.
------------------------
2021-07-29T04:24:25.6NZ mysqld_safe Logging to '**/var/db/mysql/nextcloud.err**'.
2021-07-29T04:24:25.6NZ mysqld_safe Starting mysqld daemon with databases from /var/db/mysql
2021-07-29T04:24:25.294990Z 0 [Warning] [MY-011069] [Server] The syntax '--master-info-repository' is deprecated and will be removed in a future release.
2021-07-29T04:24:25.294998Z 0 [Warning] [MY-011069] [Server] The syntax '--relay-log-info-repository' is deprecated and will be removed in a future release.
2021-07-29T04:24:25.295025Z 0 [Warning] [MY-011068] [Server] The syntax 'expire-logs-days' is deprecated and will be removed in a future release. Please use binlog_expire_logs_seconds instead.
2021-07-29T04:24:25.295154Z 0 [Warning] [MY-011070] [Server] 'Disabling symbolic links using --skip-symbolic-links (or equivalent) is the default. Consider not using this option as it' is deprecated and will be removed in a future release.
2021-07-29T04:24:25.295165Z 0 [Warning] [MY-011069] [Server] The syntax '--master-info-repository' is deprecated and will be removed in a future release.
2021-07-29T04:24:25.295169Z 0 [Warning] [MY-011069] [Server] The syntax '--relay-log-info-repository' is deprecated and will be removed in a future release.
2021-07-29T04:24:25.295178Z 0 [Warning] [MY-011068] [Server] The syntax 'expire-logs-days' is deprecated and will be removed in a future release. Please use binlog_expire_logs_seconds instead.
2021-07-29T04:24:25.295197Z 0 [Warning] [MY-011070] [Server] 'Disabling symbolic links using --skip-symbolic-links (or equivalent) is the default. Consider not using this option as it' is deprecated and will be removed in a future release.
2021-07-29T04:24:25.296197Z 0 [System] [MY-010116] [Server] /usr/local/libexec/mysqld (mysqld 8.0.25) starting as process 28361
2021-07-29T04:24:25.391541Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-07-29T04:24:27.445582Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2021-07-29T04:24:27.703876Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /tmp/mysqlx.sock
2021-07-29T04:24:28.434739Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2021-07-29T04:24:28.434885Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2021-07-29T04:24:28.817287Z 0 [System] [MY-010931] [Server] /usr/local/libexec/mysqld: ready for connections. Version: '8.0.25' socket: '/tmp/mysql.sock' port: 3306 Source distribution.
---------------------

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

<?php
$CONFIG = array (
  'trusted_proxies' => 
  array (
    0 => '000.000.000.000',
  ),
  'overwritehost' => 'nextcloud.xxxxx.com',
  'overwriteprotocol' => 'https',
  'overwritecondaddr' => '^000\\.000\\.000\\.000$',
  'apps_paths' => 
  array (
    0 => 
    array (
      'path' => '/usr/local/www/nextcloud/apps',
      'url' => '/apps',
      'writable' => true,
    ),
    1 => 
    array (
      'path' => '/usr/local/www/nextcloud/apps-pkg',
      'url' => '/apps-pkg',
      'writable' => true,
    ),
  ),
  'logfile' => '/var/log/nextcloud/nextcloud.log',
  'passwordsalt' => 'xxxxxxx',
  'secret' => 'xxxxxxxx',
  'trusted_domains' => 
  array (
    0 => 'localhost',
    1 => '000.000.000.00',
    2 => 'nextcloud.xxxxx.com',
  ),
  'datadirectory' => '/xxxx/xxxx/xxxx/xxxxx/data',
  'dbtype' => 'mysql',
  'version' => '21.0.1.1',
  'overwrite.cli.url' => 'http://localhost',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'xxxxxxxx',
  'dbpassword' => 'xxxxxxxx',
  'installed' => true,
  'instanceid' => 'xxxxxxx',
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'ssl',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => 'xxxxxx',
  'mail_domain' => 'xxxxx.com',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_smtphost' => 'smtp.xxxx.com',
  'mail_smtpport' => '000',
  'mail_smtpname' => 'xxxxxx.com',
  'mail_smtppassword' => 'xxxxxxxxx',
  'updater.release.channel' => 'stable',
  'htaccess.RewriteBase' => '/',
  'default_phone_region' => 'AU',
  'maintenance' => false,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'redis' => 
  array (
    'host' => '/tmp/redis.sock',
    'port' => 0,
  ),
  'theme' => '',
  'loglevel' => 2,
);

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

2021/07/28 18:09:37 [error] 19293#100422: *11 connect() to unix:/var/run/nextcloud-php-fpm.sock failed (61: Connection refused) while connecting to upstream, client: 192.168.3.4, server: _, request: "GET /index.php/apps/passwords/api/1.0/session/keepalive HTTP/1.1", upstream: "fastcgi://unix:/var/run/nextcloud-php-fpm.sock:", host: "nextcloud.xxxx.com"

I’m not really sure what is done during the package updates, perhaps the occ upgrade command is not executed at all. I’d try to run from command line within the nextcloud folder:

su -m www -c 'php occ upgrade'

This command runs Nextcloud’s upgrade procedure (run updates on the database) as well as updating the code of all related apps. `

www` is the default webserver user on FreeBSD/TrueNAS, in case you have a different one, you might change it.

I suppose this was from before or during an update, because if this is not running, you wouldn’t have got the error message above.