Not able to run OCC - what does this unhandled exception mean?

Steps to reproduce

Run a occ command

Expected behaviour

any output

Actual behaviour

An unhandled exception has been thrown:
Exception: Environment not properly prepared. in /httpdocs/CLOUD/lib/private/Console/Application.php:148
Stack trace:
#0 /httpdocs/CLOUD/console.php(89): OC\Console\Application->loadCommands(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#1 /httpdocs/CLOUD/occ(11): require_once(’/httpdocs/CLOUD…’)
#2 {main}

Server configuration detail

Operating system: Linux 3.10.0-862.9.1.el7.x86_64 #1 SMP Mon Jul 16 16:29:36 UTC 2018 x86_64

Webserver: Apache (fpm-fcgi)

Database: mysql 10.1.34

PHP version:

7.2.11
Modules loaded: Core, date, libxml, openssl, pcre, zlib, bz2, calendar, ctype, hash, filter, ftp, gettext, gmp, SPL, iconv, Reflection, session, standard, SimpleXML, sockets, sodium, mbstring, tokenizer, xml, cgi-fcgi, mysqlnd, bcmath, curl, dba, dom, fileinfo, gd, imagick, imap, intl, json, exif, mysqli, odbc, PDO, pdo_mysql, PDO_ODBC, pdo_sqlite, Phar, posix, pspell, soap, sqlite3, sysvmsg, sysvsem, sysvshm, xmlreader, xmlrpc, xmlwriter, xsl, zip, ionCube Loader, Zend OPcache

Nextcloud version: 13.0.6 - 13.0.6.1

Updated from an older Nextcloud/ownCloud or fresh install:

Where did you install Nextcloud from: downloading ZIP from nextcloud.com

Signing status
List of activated apps
Enabled:
 - apporder: 0.5.0
 - bruteforcesettings: 1.1.0
 - calendar: 1.6.1
 - comments: 1.3.0
 - contacts: 2.1.5
 - dav: 1.4.7
 - external: 3.0.4
 - federatedfilesharing: 1.3.1
 - federation: 1.3.0
 - files: 1.8.0
 - files_external: 1.4.1
 - files_pdfviewer: 1.2.1
 - files_sharing: 1.5.0
 - files_texteditor: 2.5.1
 - files_trashbin: 1.3.0
 - files_versions: 1.6.0
 - firstrunwizard: 2.2.1
 - gallery: 18.0.0
 - impersonate: 1.0.4
 - issuetemplate: 0.4.0
 - logreader: 2.0.0
 - lookup_server_connector: 1.1.0
 - mail: 0.8.3
 - metadata: 0.7.0
 - nextcloud_announcements: 1.2.0
 - notifications: 2.1.2
 - oauth2: 1.1.1
 - ownbackup: 18.8.1
 - password_policy: 1.3.0
 - piwik: 0.4.1
 - polls: 0.8.3
 - provisioning_api: 1.3.0
 - serverinfo: 1.3.0
 - sharebymail: 1.3.0
 - survey_client: 1.1.0
 - systemtags: 1.3.0
 - theming: 1.4.5
 - twofactor_backupcodes: 1.2.3
 - updatenotification: 1.3.0
 - user_external: 0.4
 - workflowengine: 1.3.0
Disabled:
 - activity
 - admin_audit
 - deck
 - documents
 - encryption
 - files_accesscontrol
 - files_automatedtagging
 - files_retention
 - files_videoplayer
 - maps
 - shorten
 - spreed
 - user_ldap
 - user_saml

Configuration (config/config.php)
{
    "datadirectory": "***REMOVED SENSITIVE VALUE***",
    "htaccess.RewriteBase": "\/",
    "dbtype": "mysql",
    "version": "13.0.6.1",
    "logtimezone": "Europe\/Berlin",
    "logdateformat": "Y.m.d, H:i:s",
    "log_query": false,
    "logfile": "\/files\/Owncloud-Daten\/data\/nextcloud.log",
    "loglevel": 3,
    "installed": true,
    "maintenance": false,
    "default_language": "de",
    "appstore.experimental.enabled": false,
    "mail_smtpmode": "smtp",
    "mail_from_address": "***REMOVED SENSITIVE VALUE***",
    "mail_domain": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpauth": 1,
    "mail_smtpauthtype": "LOGIN",
    "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
    "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
    "user_backends": [
        {
            "class": "OC_User_IMAP",
            "arguments": [
                "{localhost:599\/novalidate-cert\/imap\/readonly}"
            ]
        }
    ],
    "debug": false,
    "theme": "",
    "mail_smtpport": "598",
    "mail_smtpsecure": "ssl",
    "updater.release.channel": "stable"
}

Are you using external storage, if yes which one:

Are you using encryption: true

Are you using an external user-backend, if yes which one: imap

Client configuration

Browser: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:62.0) Gecko/20100101 Firefox/62.0

Operating system:

Logs

Browser log

Nextcloud log
occ do not give an entry in Nextcloud.log
Browser log

As Nextcloud App:

Use existing php.ini