Fresh Install Server Error OCC Doesn't work inside Jailkit

I have fresh install of nc-22.2.1 inside of an ISPConfig jailkit user shell installed according to instructions found in the ispconfig forum:

https://www.howtoforge.com/community/threads/how-can-i-install-nextcloud-correctly-with-ispconfig.83650/

all of my user permissions are correct as well (as shown in the instructions linked above):

# ls -la /var/www/clients/client1/web17 
total 60
drwxr-xr-x 15 root  root    4096 Nov 12 15:12 .
drwxr-xr-x  9 root  root    4096 Nov 12 14:50 ..
lrwxrwxrwx  1 root  root       7 Nov 12 15:09 bin -> usr/bin
drwxr-xr-x  2 web17 client1 4096 Nov 12 14:50 cgi-bin
drwxr-xr-x  2 root  root    4096 Nov 12 17:36 dev
drwxr-xr-x  8 root  root    4096 Nov 12 15:12 etc
drwxr-xr-x  4 root  root    4096 Nov 12 15:12 home
lrwxrwxrwx  1 root  root       7 Nov 12 15:09 lib -> usr/lib
lrwxrwxrwx  1 root  root       9 Nov 12 15:09 lib64 -> usr/lib64
drwxr-xr-x  2 root  root    4096 Nov 12 19:58 log
drwx--x---  2 web17 client1 4096 Nov 12 20:05 private
drwx------  2 web17 client1 4096 Nov 12 15:09 .ssh
drwxr-xr-x  2 root  root    4096 Nov 12 14:55 ssl
drwxrwx---  2 web17 client1 4096 Nov 12 20:09 tmp
drwxr-xr-x  8 root  root    4096 Nov 12 15:09 usr
drwxr-xr-x  4 root  root    4096 Nov 12 15:12 var
drwx--x--x 14 web17 client1 4096 Nov 12 20:09 web
drwx--x---  2 web17 client1 4096 Nov 12 14:50 webdav

However, on a fresh install:

1.) I cannot use the nextcloud occ file

:/web$ ./occ  help maintenance:mode
Your data directory is invalid
Ensure there is a file called ".ocdata" in the root of the data directory.

Cannot create "data" directory
This can usually be fixed by giving the webserver write access to the root directory. See https://docs.nextcloud.com/server/22/go.php?to=admin-dir_permissions

Setting locale to en_US.UTF-8/fr_FR.UTF-8/es_ES.UTF-8/de_DE.UTF-8/ru_RU.UTF-8/pt_BR.UTF-8/it_IT.UTF-8/ja_JP.UTF-8/zh_CN.UTF-8 failed
Please install one of these locales on your system and restart your webserver.

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

The install is configured to use the /var/www/clients/client1/web17/private/data directory. Therefore the the above .ocdata does exist, NC just doesn’t recognize it from correct file path setting in config/config.php

`'datadirectory' => '/var/www/clients/client1/web17/private/data',`

This is a pastebin of my server configuration profile

https://pastebin.com/PsM9GyHU

you MUST have sudo. pkg install -y sudo

then you MUST run occ from within the Nextcloud folder /usr/local/www/nextcloud

command structure is sudo -u www php occ (and your desired command)

having su or sudo in your OS isn’t the same… took me a while to learn this.

https://docs.nextcloud.com/server/12/admin_manual/configuration_server/occ_command.html?highlight=occ#file-operations-label

Thanks for your response , but after reading and testing it seems my original was “nearly” correct…

you are correct nextcloud normally requires this type of structure to execute commands, but in different shell environments that structure can change.

For my ISPConfig jailkit environment where www-data is actually the name of the webroot “web17” and sudo is disallowed… my command to execute nextcloud occ should be:

$/bin/php7.3 ./occ integrity:check-core` Where php7.3 is the version of php run by server, which is different from php .

But I still get the following error with the correct command:


{"reqId":"Ykl9R7TRQ6T1TbaJjz1m","level":0,"time":"2021-11-17T14:40:05+00:00","remoteAddr":"","user":"--","app":"user_ispconfig","method":"","url":"--","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"--","version":"21.0.3.1"}
{"reqId":"Ykl9R7TRQ6T1TbaJjz1m","level":0,"time":"2021-11-17T14:40:05+00:00","remoteAddr":"","user":"--","app":"appointments","method":"","url":"--","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"--","version":"21.0.3.1"}
{"reqId":"Ykl9R7TRQ6T1TbaJjz1m","level":0,"time":"2021-11-17T14:40:05+00:00","remoteAddr":"","user":"--","app":"apporder","method":"","url":"--","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"--","version":"21.0.3.1"}
{"reqId":"Ykl9R7TRQ6T1TbaJjz1m","level":0,"time":"2021-11-17T14:40:05+00:00","remoteAddr":"","user":"--","app":"audioplayer_editor","method":"","url":"--","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"--","version":"21.0.3.1"}
{"reqId":"Ykl9R7TRQ6T1TbaJjz1m","level":0,"time":"2021-11-17T14:40:05+00:00","remoteAddr":"","user":"--","app":"audioplayer_sonos","method":"","url":"--","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"--","version":"21.0.3.1"}
{"reqId":"Ykl9R7TRQ6T1TbaJjz1m","level":0,"time":"2021-11-17T14:40:05+00:00","remoteAddr":"","user":"--","app":"camerarawpreviews","method":"","url":"--","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"--","version":"21.0.3.1"}
{"reqId":"Ykl9R7TRQ6T1TbaJjz1m","level":0,"time":"2021-11-17T14:40:05+00:00","remoteAddr":"","user":"--","app":"serverDI","method":"","url":"--","message":"The requested alias \"PreviewManager\" is deprecated. Please request \"OCP\\IPreview\" directly. This alias will be removed in a future Nextcloud version.","userAgent":"--","version":"21.0.3.1"}
{"reqId":"Ykl9R7TRQ6T1TbaJjz1m","level":0,"time":"2021-11-17T14:40:05+00:00","remoteAddr":"","user":"--","app":"contacts","method":"","url":"--","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"--","version":"21.0.3.1"}
{"reqId":"Ykl9R7TRQ6T1TbaJjz1m","level":0,"time":"2021-11-17T14:40:05+00:00","remoteAddr":"","user":"--","app":"files_antivirus","method":"","url":"--","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"--","version":"21.0.3.1"}
{"reqId":"Ykl9R7TRQ6T1TbaJjz1m","level":0,"time":"2021-11-17T14:40:05+00:00","remoteAddr":"","user":"--","app":"drawio","method":"","url":"--","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"--","version":"21.0.3.1"}
{"reqId":"Ykl9R7TRQ6T1TbaJjz1m","level":0,"time":"2021-11-17T14:40:05+00:00","remoteAddr":"","user":"--","app":"encryption","method":"","url":"--","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"--","version":"21.0.3.1"}
{"reqId":"Ykl9R7TRQ6T1TbaJjz1m","level":0,"time":"2021-11-17T14:40:05+00:00","remoteAddr":"","user":"--","app":"extract","method":"","url":"--","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"--","version":"21.0.3.1"}
{"reqId":"Ykl9R7TRQ6T1TbaJjz1m","level":0,"time":"2021-11-17T14:40:05+00:00","remoteAddr":"","user":"--","app":"files_sharing","method":"","url":"--","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"--","version":"21.0.3.1"}
{"reqId":"Ykl9R7TRQ6T1TbaJjz1m","level":0,"time":"2021-11-17T14:40:05+00:00","remoteAddr":"","user":"--","app":"keeweb","method":"","url":"--","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"--","version":"21.0.3.1"}
{"reqId":"Ykl9R7TRQ6T1TbaJjz1m","level":0,"time":"2021-11-17T14:40:05+00:00","remoteAddr":"","user":"--","app":"maps","method":"","url":"--","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"--","version":"21.0.3.1"}
{"reqId":"Ykl9R7TRQ6T1TbaJjz1m","level":2,"time":"2021-11-17T14:40:05+00:00","remoteAddr":"","user":"--","app":"filesystem","method":"","url":"--","message":"Storage wrapper 'sharepermissions' was not registered via the 'OC_Filesystem - preSetup' hook which could cause potential problems.","userAgent":"--","version":"21.0.3.1"}
{"reqId":"Ykl9R7TRQ6T1TbaJjz1m","level":0,"time":"2021-11-17T14:40:05+00:00","remoteAddr":"","user":"--","app":"user_usage_report","method":"","url":"--","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"--","version":"21.0.3.1"}
{"reqId":"Ykl9R7TRQ6T1TbaJjz1m","level":0,"time":"2021-11-17T14:40:05+00:00","remoteAddr":"","user":"--","app":"metadata","method":"","url":"--","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"--","version":"21.0.3.1"}
{"reqId":"Ykl9R7TRQ6T1TbaJjz1m","level":0,"time":"2021-11-17T14:40:05+00:00","remoteAddr":"","user":"--","app":"ocdownloader","method":"","url":"--","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"--","version":"21.0.3.1"}
{"reqId":"Ykl9R7TRQ6T1TbaJjz1m","level":0,"time":"2021-11-17T14:40:05+00:00","remoteAddr":"","user":"--","app":"scanner","method":"","url":"--","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"--","version":"21.0.3.1"}
{"reqId":"Ykl9R7TRQ6T1TbaJjz1m","level":0,"time":"2021-11-17T14:40:05+00:00","remoteAddr":"","user":"--","app":"suspicious_login","method":"","url":"--","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"--","version":"21.0.3.1"}
{"reqId":"Ykl9R7TRQ6T1TbaJjz1m","level":0,"time":"2021-11-17T14:40:05+00:00","remoteAddr":"","user":"--","app":"transmission","method":"","url":"--","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"--","version":"21.0.3.1"}
{"reqId":"Ykl9R7TRQ6T1TbaJjz1m","level":0,"time":"2021-11-17T14:40:05+00:00","remoteAddr":"","user":"--","app":"video_converter","method":"","url":"--","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"--","version":"21.0.3.1"}
{"reqId":"Ykl9R7TRQ6T1TbaJjz1m","level":0,"time":"2021-11-17T14:40:05+00:00","remoteAddr":"","user":"--","app":"news","method":"","url":"--","message":"new parser added : FeedIo\\Standard\\Json","userAgent":"--","version":"21.0.3.1"}
{"reqId":"Ykl9R7TRQ6T1TbaJjz1m","level":0,"time":"2021-11-17T14:40:05+00:00","remoteAddr":"","user":"--","app":"news","method":"","url":"--","message":"new parser added : FeedIo\\Standard\\Atom","userAgent":"--","version":"21.0.3.1"}
{"reqId":"Ykl9R7TRQ6T1TbaJjz1m","level":0,"time":"2021-11-17T14:40:05+00:00","remoteAddr":"","user":"--","app":"news","method":"","url":"--","message":"new parser added : FeedIo\\Standard\\Rss","userAgent":"--","version":"21.0.3.1"}
{"reqId":"Ykl9R7TRQ6T1TbaJjz1m","level":0,"time":"2021-11-17T14:40:05+00:00","remoteAddr":"","user":"--","app":"news","method":"","url":"--","message":"new parser added : FeedIo\\Standard\\Rdf","userAgent":"--","version":"21.0.3.1"}
Your data directory is invalid
Ensure there is a file called ".ocdata" in the root of the data directory.

Cannot create "data" directory
This can usually be fixed by giving the webserver write access to the root directory. See https://docs.nextcloud.com/server/21/go.php?to=admin-dir_permissions

An unhandled exception has been thrown:
Exception: Environment not properly prepared. in /web/lib/private/Console/Application.php:168
Stack trace:
#0 /web/console.php(99): OC\Console\Application->loadCommands(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#1 /web/occ(11): require_once('/web/console.ph...')

If they output indicates that my understanding is incorrect, please me know. I don;t feel comfortable using nextcloud until I can get the occ to work properly