linux – Nextcloud JailKit Privileges Paradox

I am using Nextcloud 21.0.3 with ISPConfig 3.2.5 and the NC installation is inside of a user JailKit. While Nextcloud is successfully installed and phpmyinfo.php confirms that Memcache, APCu, & Redis are all installed & working correctly… I seem to have a privileges problem when attempting to run commands against NC’s occ file from inside the jailkit, as the jailkit’s “root” shell-user.

Specifically, NC currently has this bug:

Invalid private key for encryption app. Please update your private key password in your personal settings to recover access to your encrypted files

For which there is a solution here.
https://github.com/nextcloud/server/issues/8546

I ran:

jk_init -j /var/www/clients/client1/web4 php

Which ensured all the necessary php-modules from the real system were in sync with the jailkit.

However, when I run:

./occ encryption:enable-master-key
(yes, occ has temporary 777 permissions, when I run the above command)

I get this error:

An unhandled exception has been thrown: OCHintException: (0): Memcache OCMemcacheAPCu not available for local cache (Is the matching PHP module installed and enabled?)

The suggested & correct way to fix this bug is to run:

1.) $ sudo -u www-data ./occ encryption:disable-master-key

2.) $ sudo -u www-data ./occ encryption:enable
`

However, it seems that running the above commands as the “root” shell-user without sudo -u www-data means that I do not have sufficient access to the necessary caches.

I do not wish to add sudo to the jailkit as that actions seems to negate the purpose of restricting user’s access to the real system using jailkit.

Can someone tell me how I can run the above commands (or their equivalent) on nextcloud’s occ as the “root” shell-user without adding sudo to the jailkit?