External storage - died with error

I upgrade through a few versions of NC (sorry I do not remember exactly I was behind - but am now on 23.x). I was systematic - testing all was working and run the GUI check (and running checks on Maria to fix errors) after each upgrade. Once completed my external storage stopped responding and throws logging errors. If I look in the database my settings are still there.
NC version: 23.0.6
OS version: Ubuntu 20.04.4 LTS
Nginx: 1.23.0
PHP: 8.0.21
Maria: 10.5.16

The issue you are facing:

When I enable the external storage I can see it in the GUI but it throws error and is not configurable.
Is this the first time you’ve seen this error? (Y/N): I set it up and then it stopped working after upgrade from Ubuntu 18 to 20 and to the current versions of the build (as above). Screenshots to show error:


Admin logging (this repeats)

Error	PHP	Error: pack(): Type H: illegal hex digit - at /var/www/nextcloud/3rdparty/phpseclib/phpseclib/phpseclib/Crypt/RSA.php#1147

    <<closure>>

    OC\Log\ErrorHandler::onError()

    /var/www/nextcloud/3rdparty/phpseclib/phpseclib/phpseclib/Crypt/RSA.php - line 1147:

    pack()

    /var/www/nextcloud/3rdparty/phpseclib/phpseclib/phpseclib/Crypt/RSA.php - line 1710:

    phpseclib\Crypt\RSA->_parseKey()

    /var/www/nextcloud/apps/files_external/lib/Lib/Auth/PublicKey/RSAPrivateKey.php - line 60:

    phpseclib\Crypt\RSA->loadKey()

    /var/www/nextcloud/apps/files_external/lib/Config/ConfigAdapter.php - line 94:

    OCA\Files_External\Lib\Auth\PublicKey\RSAPrivateKey->manipulateStorageConfig()

    /var/www/nextcloud/apps/files_external/lib/Config/ConfigAdapter.php - line 132:

    OCA\Files_External\Config\ConfigAdapter->prepareStorageConfig()

    <<closure>>

    OCA\Files_External\Config\ConfigAdapter->OCA\Files_External\Config\{closure}("*** sensiti ... *")

    /var/www/nextcloud/apps/files_external/lib/Config/ConfigAdapter.php - line 130:

    array_map()

    /var/www/nextcloud/lib/private/Files/Config/MountProviderCollection.php - line 108:

    OCA\Files_External\Config\ConfigAdapter->getMountsForUser()

    /var/www/nextcloud/lib/private/Files/Filesystem.php - line 424:

    OC\Files\Config\MountProviderCollection->addMountForUser()

    /var/www/nextcloud/apps/files_sharing/lib/SharedStorage.php - line 132:

    OC\Files\Filesystem::initMountPoints()

    /var/www/nextcloud/apps/files_sharing/lib/SharedStorage.php - line 503:

    OCA\Files_Sharing\SharedStorage->init()

    /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php - line 567:

    OCA\Files_Sharing\SharedStorage->getWrapperStorage()

    /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php - line 567:

    OC\Files\Storage\Wrapper\Wrapper->verifyPath()

    /var/www/nextcloud/lib/private/Files/View.php - line 1866:

    OC\Files\Storage\Wrapper\Wrapper->verifyPath()

    /var/www/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php - line 221:

    OC\Files\View->verifyPath()

    /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php - line 78:

    OCA\DAV\Connector\Sabre\Directory->getChild()

    /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php - line 73:

    Sabre\DAV\Tree->getNodeForPath()

    /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 971:

    Sabre\DAV\Tree->getNodeForPath()

    /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 1661:

    Sabre\DAV\Server->getPropertiesIteratorForPath()

    /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 1646:

    Sabre\DAV\Server->writeMultiStatus()

    /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php - line 346:

    Sabre\DAV\Server->generateMultiStatus()

    /var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php - line 89:

    Sabre\DAV\CorePlugin->httpPropFind()

    /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 472:

    Sabre\DAV\Server->emit()

    /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 253:

    Sabre\DAV\Server->invokeMethod()

    /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 321:

    Sabre\DAV\Server->start()

    /var/www/nextcloud/apps/dav/lib/Server.php - line 339:

    Sabre\DAV\Server->exec()

    /var/www/nextcloud/apps/dav/appinfo/v2/remote.php - line 35:

    OCA\DAV\Server->exec()

    /var/www/nextcloud/remote.php - line 166:

    require_once("/var/www/ne ... p")

The output of your config.php file (this largely follows Carsten Reiger’s guide - though any errors / issues are my own:

<?php
$CONFIG = array (
  'instanceid' => 'xxxxxxxxxx',
  'passwordsalt' => 'xxxxxxxxxx',
  'secret' => xxxxxxxxxx',
  'trusted_domains' =>
  array (
    0 => 'stanworth.cloud',
  ),
  'datadirectory' => '/var/nc_data',
  'dbtype' => 'mysql',
  'version' => '23.0.6.1',
  'overwrite.cli.url' => 'https://stanworth.cloud',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'xxxxxxxxxx',
  'dbpassword' => 'xxxxxxxxxx',
  'installed' => true,
  'activity_expire_days' => 14,
  'auth.bruteforce.protection.enabled' => true,
  'blacklisted_files' =>
  array (
    0 => '.htaccess',
    1 => 'Thumbs.db',
    2 => 'thumbs.db',
  ),
  'cron_log' => true,
  'default_phone_region' => 'TW',
  'enable_previews' => true,
  'enabledPreviewProviders' =>
  array (
    0 => 'OC\\Preview\\PNG',
    1 => 'OC\\Preview\\JPEG',
    2 => 'OC\\Preview\\GIF',
    3 => 'OC\\Preview\\BMP',
    4 => 'OC\\Preview\\XBitmap',
    5 => 'OC\\Preview\\Movie',
    6 => 'OC\\Preview\\PDF',
    7 => 'OC\\Preview\\MP3',
    8 => 'OC\\Preview\\TXT',
    9 => 'OC\\Preview\\MarkDown',
),
  'filesystem_check_changes' => 0,
  'filelocking.enabled' => 'true',
  'htaccess.RewriteBase' => '/',
  'integrity.check.disabled' => false,
  'knowledgebaseenabled' => false,
  'logfile' => '/var/nc_data/nextcloud.log',
  'loglevel' => 2,
  'logtimezone' => 'Asia/Taipei',
  'log_rotate_size' => 104857600,
  'maintenance' => false,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'overwriteprotocol' => 'https',
  'preview_max_x' => 1024,
  'preview_max_y' => 768,
  'preview_max_scale_factor' => 1,
  'redis' =>
  array (
    'host' => '/var/run/redis/redis-server.sock',
    'port' => 0,
    'timeout' => 0.0,
  ),
  'quota_include_external_storage' => false,
  'share_folder' => '/Shares',
  'skeletondirectory' => '',
  'theme' => '',
  'trashbin_retention_obligation' => 'auto, 7',
  'updater.release.channel' => 'stable',
  'data-fingerprint' => 'xxxxxxxxxxxx',
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'ssl',
  'mail_sendmailmode' => 'smtp',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_smtpport' => '465',
  'mail_smtphost' => 'smtp.gmail.com',
  'mail_from_address' => 'xxxxxxxx',
  'mail_domain' => 'gmail.com',
  'mail_smtpname' => 'xxxxxxxx',
  'mail_smtppassword' => 'xxxxxxxxxxxxx',
);

The output of your Apache/nginx/system log in /var/log/____: I’m assuming this is the error.log

2022/07/22 07:34:28 [crit] 192256#192256: *1326 SSL_do_handshake() failed (SSL: error:141CF06C:SSL routines:tls_parse_ctos_key_share:bad key share) while SSL handshaking, client: 8.142.118.136, server: 0.0.0.0:443
2022/07/22 16:48:41 [warn] 192256#192256: *4133 an upstream response is buffered to a temporary file /var/cache/nginx/fastcgi_temp/1/00/0000000001 while reading upstream, client: 122.117.185.116, server: stanworth.cloud, request: "GET /settings/apps/list HTTP/2.0", upstream: "fastcgi://unix:/run/php/php8.0-fpm.sock:", host: "stanworth.cloud"
2022/07/22 16:52:21 [warn] 192256#192256: *4133 an upstream response is buffered to a temporary file /var/cache/nginx/fastcgi_temp/2/00/0000000002 while reading upstream, client: 122.117.185.116, server: stanworth.cloud, request: "GET /settings/apps/list HTTP/2.0", upstream: "fastcgi://unix:/run/php/php8.0-fpm.sock:", host: "stanworth.cloud"

This error has been hanging around for a while. Other users report similiar issues however I cannot find a workable solution.
Please help! I’m running out of space and need external storage :smiley: Thank you!

Is the above mentioned file ok?