Script error after letsencrypt renew

Support intro

When running letsencrypt through ncp-config the script terminates with an error from script.sh

What does this mean?

The issue you are facing:
Error at the end of this log
Running letsencrypt
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator webroot, Installer None
Renewing an existing certificate
Running deploy-hook command: /etc/letsencrypt/renewal-hooks/deploy/ncp
IMPORTANT NOTES:

  • Congratulations! Your certificate and chain have been saved at:
    /etc/letsencrypt/live/xxx.com/fullchain.pem
    Your key file has been saved at:
    /etc/letsencrypt/live/xxx.com/privkey.pem
    Your cert will expire on 2022-03-12. To obtain a new or tweaked
    version of this certificate in the future, simply run certbot
    again. To non-interactively renew all of your certificates, run
    “certbot renew”

  • If you like Certbot, please consider supporting our work by:

    Donating to ISRG / Let’s Encrypt:
    Donating to EFF:

INFO: Letsencrypt domain is xx.com
INFO: Metrics enabled: no
System config value trusted_domains => set to string xx.com
/usr/local/etc/library.sh: line 130: xxx.com: syntax error: invalid arithmetic operator (error token is “.com”)
Done. Press any key…

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

Steps to replicate it:

  1. ncp-config
  2. run letsencrypt

The output of ncp-report:

NextCloudPi diagnostics

NextCloudPi version  v1.44.5
NextCloudPi image    NextCloudPi_11-27-20
OS                   Debian GNU/Linux 10. 5.10.63-v8+ (aarch64)
automount            yes
USB devices          sda sdb
datadir              /media/1c2e55ef-caf9-4713-a9f0-9082082ed80c/ncdata
data in SD           no
data filesystem      btrfs
data disk usage      1.1T/3.7T
rootfs usage         7.7G/29G
swapfile             none
dbdir                /var/lib/mysql
Nextcloud check      ok
Nextcloud version    22.2.2.0
HTTPD service        up
PHP service          up
MariaDB service      up
Redis service        up
HPB service          up
Postfix service      up
internet check       ok
port check 80        open
port check 443       open
IP                   ***REMOVED SENSITIVE VALUE***
gateway              ***REMOVED SENSITIVE VALUE***
interface            eth0
certificates         ***REMOVED SENSITIVE VALUE***
NAT loopback         no
uptime               8:56

Nextcloud configuration

{
    "system": {
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": {
            "0": "localhost",
            "11": "xx",
            "1": "1xx",
            "5": "nextcloudpi.local",
            "7": "nextcloudpi",
            "8": "nextcloudpi.lan",
            "12": "xx.com",
            "2": "xx.com",
            "3": "xx.com",
            "22": "xx.com",
            "": "xx.com",
            "14": "nextcloudpi"
        },
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "22.2.2.0",
        "overwrite.cli.url": "https:\/\/nextcloudpi\/",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "memcache.local": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 0,
            "timeout": 0,
            "password": "***REMOVED SENSITIVE VALUE***"
        },
        "tempdirectory": "\/media\/1c2e55ef-caf9-4713-a9f0-9082082ed80c\/ncdata\/tmp",
        "mail_smtpmode": "sendmail",
        "mail_smtpauthtype": "LOGIN",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "preview_max_x": "2048",
        "preview_max_y": "2048",
        "jpeg_quality": "60",
        "overwriteprotocol": "https",
        "maintenance": false,
        "data-fingerprint": "fb86b35226458542a1c0cfe928182b10",
        "theme": "",
        "logfile": "\/media\/1c2e55ef-caf9-4713-a9f0-9082082ed80c\/ncdata\/nextcloud.log",
        "loglevel": 4,
        "log_type": "file",
        "app_install_overwrite": [
            "gallery"
        ],
        "mail_sendmailmode": "smtp",
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***"
    }
}

HTTPd logs

[Sun Dec 12 00:00:04.358088 2021] [ssl:warn] [pid 940:tid 548019438976] AH01909: localhost:4443:0 server certificate does NOT include an ID which matches the server name
[Sun Dec 12 00:00:04.365112 2021] [mpm_event:notice] [pid 940:tid 548019438976] AH00489: Apache/2.4.38 (Debian) OpenSSL/1.1.1d configured -- resuming normal operations
[Sun Dec 12 00:00:04.365160 2021] [core:notice] [pid 940:tid 548019438976] AH00094: Command line: '/usr/sbin/apache2'
[Sun Dec 12 07:05:02.092641 2021] [mpm_event:notice] [pid 940:tid 548019438976] AH00491: caught SIGTERM, shutting down
[Sun Dec 12 07:05:29.474541 2021] [ssl:warn] [pid 734:tid 548289934720] AH01909: localhost:4443:0 server certificate does NOT include an ID which matches the server name
[Sun Dec 12 07:05:29.555938 2021] [ssl:warn] [pid 936:tid 548289934720] AH01909: localhost:4443:0 server certificate does NOT include an ID which matches the server name
[Sun Dec 12 07:05:29.559641 2021] [mpm_event:notice] [pid 936:tid 548289934720] AH00489: Apache/2.4.38 (Debian) OpenSSL/1.1.1d configured -- resuming normal operations
[Sun Dec 12 07:05:29.559738 2021] [core:notice] [pid 936:tid 548289934720] AH00094: Command line: '/usr/sbin/apache2'

Database logs

2021-12-12  7:06:03 0 [Note] InnoDB: Uses event mutexes
2021-12-12  7:06:03 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2021-12-12  7:06:03 0 [Note] InnoDB: Number of pools: 1
2021-12-12  7:06:03 0 [Note] InnoDB: Using generic crc32 instructions
2021-12-12  7:06:03 0 [Note] InnoDB: Initializing buffer pool, total size = 1.875G, instances = 1, chunk size = 128M
2021-12-12  7:06:04 0 [Note] InnoDB: Completed initialization of buffer pool
2021-12-12  7:06:04 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2021-12-12  7:06:04 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2021-12-12  7:06:04 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2021-12-12  7:06:04 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2021-12-12  7:06:04 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2021-12-12  7:06:04 0 [Note] InnoDB: 10.3.31 started; log sequence number 51719656584; transaction id 37513191
2021-12-12  7:06:04 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2021-12-12  7:06:04 0 [Note] Plugin 'FEEDBACK' is disabled.
2021-12-12  7:06:04 0 [Note] Server socket created on IP: '127.0.0.1'.
2021-12-12  7:06:04 0 [Note] Reading of all Master_info entries succeeded
2021-12-12  7:06:04 0 [Note] Added new Master_info '' to hash table
2021-12-12  7:06:04 0 [Note] /usr/sbin/mysqld: ready for connections.
Version: '10.3.31-MariaDB-0+deb10u1'  socket: '/run/mysqld/mysqld.sock'  port: 3306  Debian 10
2021-12-12  7:06:17 0 [Note] InnoDB: Buffer pool(s) load completed at 211212  7:06:17

Nextcloud logs
{"reqId":"1SDhVGansvsLBZNaUaKQ","level":4,"time":"2021-12-12T06:06:16+00:00","remoteAddr":"","user":"--","app":"oauth2","method":"","url":"--","message":"Error during app loading: NOAUTH Authentication required.","userAgent":"--","version":"22.2.2.0","exception":{"Exception":"RedisException","Message":"NOAUTH Authentication required.","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/Memcache/Redis.php","line":55,"function":"get","class":"Redis","type":"->","args":["9425a47dc324fb72fbe536923ab98dea/AutoloaderOCA\\OAuth2\\AppInfo\\Application"]},{"file":"/var/www/nextcloud/lib/autoloader.php","line":153,"function":"get","class":"OC\\Memcache\\Redis","type":"->","args":["OCA\\OAuth2\\AppInfo\\Application"]},{"function":"load","class":"OC\\Autoloader","type":"->","args":["OCA\\OAuth2\\AppInfo\\Application"]},{"function":"spl_autoload_call","args":["OCA\\OAuth2\\AppInfo\\Application"]},{"file":"/var/www/nextcloud/lib/private/AppFramework/Bootstrap/Coordinator.php","line":194,"function":"class_exists","args":["OCA\\OAuth2\\AppInfo\\Application"]},{"file":"/var/www/nextcloud/lib/private/legacy/OC_App.php","line":171,"function":"isBootable","class":"OC\\AppFramework\\Bootstrap\\Coordinator","type":"->","args":["oauth2"]},{"file":"/var/www/nextcloud/lib/private/legacy/OC_App.php","line":139,"function":"loadApp","class":"OC_App","type":"::","args":["oauth2"]},{"file":"/var/www/nextcloud/lib/private/Console/Application.php","line":119,"function":"loadApps","class":"OC_App","type":"::","args":[]},{"file":"/var/www/nextcloud/console.php","line":98,"function":"loadCommands","class":"OC\\Console\\Application","type":"->","args":[{"__class__":"Symfony\\Component\\Console\\Input\\ArgvInput"},{"__class__":"Symfony\\Component\\Console\\Output\\ConsoleOutput"}]},{"file":"/var/www/nextcloud/occ","line":11,"args":["/var/www/nextcloud/console.php"],"function":"require_once"}],"File":"/var/www/nextcloud/lib/private/Memcache/Redis.php","Line":55,"CustomMessage":"Error during app loading: NOAUTH Authentication required."}}
{"reqId":"1SDhVGansvsLBZNaUaKQ","level":4,"time":"2021-12-12T06:06:16+00:00","remoteAddr":"","user":"--","app":"privacy","method":"","url":"--","message":"Error during app loading: NOAUTH Authentication required.","userAgent":"--","version":"22.2.2.0","exception":{"Exception":"RedisException","Message":"NOAUTH Authentication required.","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/Memcache/Redis.php","line":55,"function":"get","class":"Redis","type":"->","args":["9425a47dc324fb72fbe536923ab98dea/AutoloaderOCA\\Privacy\\AppInfo\\Application"]},{"file":"/var/www/nextcloud/lib/autoloader.php","line":153,"function":"get","class":"OC\\Memcache\\Redis","type":"->","args":["OCA\\Privacy\\AppInfo\\Application"]},{"function":"load","class":"OC\\Autoloader","type":"->","args":["OCA\\Privacy\\AppInfo\\Application"]},{"function":"spl_autoload_call","args":["OCA\\Privacy\\AppInfo\\Application"]},{"file":"/var/www/nextcloud/lib/private/AppFramework/Bootstrap/Coordinator.php","line":194,"function":"class_exists","args":["OCA\\Privacy\\AppInfo\\Application"]},{"file":"/var/www/nextcloud/lib/private/legacy/OC_App.php","line":171,"function":"isBootable","class":"OC\\AppFramework\\Bootstrap\\Coordinator","type":"->","args":["privacy"]},{"file":"/var/www/nextcloud/lib/private/legacy/OC_App.php","line":139,"function":"loadApp","class":"OC_App","type":"::","args":["privacy"]},{"file":"/var/www/nextcloud/lib/private/Console/Application.php","line":119,"function":"loadApps","class":"OC_App","type":"::","args":[]},{"file":"/var/www/nextcloud/console.php","line":98,"function":"loadCommands","class":"OC\\Console\\Application","type":"->","args":[{"__class__":"Symfony\\Component\\Console\\Input\\ArgvInput"},{"__class__":"Symfony\\Component\\Console\\Output\\ConsoleOutput"}]},{"file":"/var/www/nextcloud/occ","line":11,"args":["/var/www/nextcloud/console.php"],"function":"require_once"}],"File":"/var/www/nextcloud/lib/private/Memcache/Redis.php","Line":55,"CustomMessage":"Error during app loading: NOAUTH Authentication required."}}
{"reqId":"1SDhVGansvsLBZNaUaKQ","level":4,"time":"2021-12-12T06:06:16+00:00","remoteAddr":"","user":"--","app":"richdocumentscode_arm64","method":"","url":"--","message":"Error during app loading: NOAUTH Authentication required.","userAgent":"--","version":"22.2.2.0","exception":{"Exception":"RedisException","Message":"NOAUTH Authentication required.","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/Memcache/Redis.php","line":55,"function":"get","class":"Redis","type":"->","args":["9425a47dc324fb72fbe536923ab98dea/AutoloaderOCA\\RichDocumentsCODE\\AppInfo\\Application"]},{"file":"/var/www/nextcloud/lib/autoloader.php","line":153,"function":"get","class":"OC\\Memcache\\Redis","type":"->","args":["OCA\\RichDocumentsCODE\\AppInfo\\Application"]},{"function":"load","class":"OC\\Autoloader","type":"->","args":["OCA\\RichDocumentsCODE\\AppInfo\\Application"]},{"function":"spl_autoload_call","args":["OCA\\RichDocumentsCODE\\AppInfo\\Application"]},{"file":"/var/www/nextcloud/lib/private/AppFramework/Bootstrap/Coordinator.php","line":194,"function":"class_exists","args":["OCA\\RichDocumentsCODE\\AppInfo\\Application"]},{"file":"/var/www/nextcloud/lib/private/legacy/OC_App.php","line":171,"function":"isBootable","class":"OC\\AppFramework\\Bootstrap\\Coordinator","type":"->","args":["richdocumentscode_arm64"]},{"file":"/var/www/nextcloud/lib/private/legacy/OC_App.php","line":139,"function":"loadApp","class":"OC_App","type":"::","args":["richdocumentscode_arm64"]},{"file":"/var/www/nextcloud/lib/private/Console/Application.php","line":119,"function":"loadApps","class":"OC_App","type":"::","args":[]},{"file":"/var/www/nextcloud/console.php","line":98,"function":"loadCommands","class":"OC\\Console\\Application","type":"->","args":[{"__class__":"Symfony\\Component\\Console\\Input\\ArgvInput"},{"__class__":"Symfony\\Component\\Console\\Output\\ConsoleOutput"}]},{"file":"/var/www/nextcloud/occ","line":11,"args":["/var/www/nextcloud/console.php"],"function":"require_once"}],"File":"/var/www/nextcloud/lib/private/Memcache/Redis.php","Line":55,"CustomMessage":"Error during app loading: NOAUTH Authentication required."}}
{"reqId":"1SDhVGansvsLBZNaUaKQ","level":4,"time":"2021-12-12T06:06:16+00:00","remoteAddr":"","user":"--","app":"serverinfo","method":"","url":"--","message":"Error during app loading: NOAUTH Authentication required.","userAgent":"--","version":"22.2.2.0","exception":{"Exception":"RedisException","Message":"NOAUTH Authentication required.","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/Memcache/Redis.php","line":55,"function":"get","class":"Redis","type":"->","args":["9425a47dc324fb72fbe536923ab98dea/AutoloaderOCA\\ServerInfo\\AppInfo\\Application"]},{"file":"/var/www/nextcloud/lib/autoloader.php","line":153,"function":"get","class":"OC\\Memcache\\Redis","type":"->","args":["OCA\\ServerInfo\\AppInfo\\Application"]},{"function":"load","class":"OC\\Autoloader","type":"->","args":["OCA\\ServerInfo\\AppInfo\\Application"]},{"function":"spl_autoload_call","args":["OCA\\ServerInfo\\AppInfo\\Application"]},{"file":"/var/www/nextcloud/lib/private/AppFramework/Bootstrap/Coordinator.php","line":194,"function":"class_exists","args":["OCA\\ServerInfo\\AppInfo\\Application"]},{"file":"/var/www/nextcloud/lib/private/legacy/OC_App.php","line":171,"function":"isBootable","class":"OC\\AppFramework\\Bootstrap\\Coordinator","type":"->","args":["serverinfo"]},{"file":"/var/www/nextcloud/lib/private/legacy/OC_App.php","line":139,"function":"loadApp","class":"OC_App","type":"::","args":["serverinfo"]},{"file":"/var/www/nextcloud/lib/private/Console/Application.php","line":119,"function":"loadApps","class":"OC_App","type":"::","args":[]},{"file":"/var/www/nextcloud/console.php","line":98,"function":"loadCommands","class":"OC\\Console\\Application","type":"->","args":[{"__class__":"Symfony\\Component\\Console\\Input\\ArgvInput"},{"__class__":"Symfony\\Component\\Console\\Output\\ConsoleOutput"}]},{"file":"/var/www/nextcloud/occ","line":11,"args":["/var/www/nextcloud/console.php"],"function":"require_once"}],"File":"/var/www/nextcloud/lib/private/Memcache/Redis.php","Line":55,"CustomMessage":"Error during app loading: NOAUTH Authentication required."}}

this should be fixed now on the latest version