The Basics
- Nextcloud Server version (e.g., 29.x.x):
31.0.2
- Operating system and version (e.g., Ubuntu 24.04):
TrueNAS-SCALE Electric Eel 24.10
- Web server and version (e.g, Apache 2.4.25):
NA
- Reverse proxy and version _(e.g. nginx 1.27.2)
NA
- PHP version (e.g, 8.3):
8.3.19
- Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
TrueNAS App/Docker
- Are you using CloudfIare, mod_security, or similar? (Yes / No)
No
Summary of the issue you are facing:
I have configured Nextcloud Assistant to use my local Ollama instance (also running on TrueNAS) and noticed that there was a 5 minute delay when I tried to use Chat with AI. I found that this is due to the jobs being run by cron. I found that if I shell into the Nextcloud container and run occ background-job:worker
it works great. I don’t want to have to shell in every time I restart. I have searched like mad on how to run the worker automatically and found little bits here and there but they are all contradictory and confusing. The best option I saw was actually from chatting with the assistant but it seems incomplete and I think may be incorrect. It said to mount a volume and create a shell script that will run workers and time time out / restart them. But it didn’t say how that script would get run automatically. I’m also not clear if the workers need to be restart regularly or not.
TLDR What is the process for automatically running background workers when Nextcloud is running in a docker container?
Configuration
Nextcloud
The output of occ config:list system
or similar is best, but, if not possible, the contents of your config.php
file from /path/to/nextcloud
is fine (make sure to remove any identifiable information!):
{
"system": {
"allow_local_remote_servers": true,
"default_phone_region": "US",
"maintenance_window_start": 1,
"htaccess.RewriteBase": "\/",
"memcache.local": "\\OC\\Memcache\\APCu",
"apps_paths": [
{
"path": "\/var\/www\/html\/apps",
"url": "\/apps",
"writable": false
},
{
"path": "\/var\/www\/html\/custom_apps",
"url": "\/custom_apps",
"writable": true
}
],
"overwritehost": "nextcloud.xxxxxxxx.xxxxx:8443",
"overwriteprotocol": "https",
"trusted_proxies": "***REMOVED SENSITIVE VALUE***",
"upgrade.disable-web": true,
"passwordsalt": "***REMOVED SENSITIVE VALUE***",
"secret": "***REMOVED SENSITIVE VALUE***",
"datadirectory": "***REMOVED SENSITIVE VALUE***",
"dbtype": "pgsql",
"version": "31.0.2.1",
"overwrite.cli.url": "https:\/\/nextcloud.xxxxxxxx.xxxxx:8443",
"dbname": "***REMOVED SENSITIVE VALUE***",
"dbhost": "***REMOVED SENSITIVE VALUE***",
"dbport": "",
"dbtableprefix": "oc_",
"dbuser": "***REMOVED SENSITIVE VALUE***",
"dbpassword": "***REMOVED SENSITIVE VALUE***",
"installed": true,
"instanceid": "***REMOVED SENSITIVE VALUE***",
"mail_smtpmode": "smtp",
"mail_smtpsecure": "ssl",
"mail_sendmailmode": "smtp",
"mail_from_address": "***REMOVED SENSITIVE VALUE***",
"mail_domain": "***REMOVED SENSITIVE VALUE***",
"mail_smtphost": "***REMOVED SENSITIVE VALUE***",
"mail_smtpport": "465",
"mail_smtpauth": 1,
"mail_smtpname": "***REMOVED SENSITIVE VALUE***",
"mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
"maintenance": false,
"loglevel": 2,
"memcache.distributed": "\\OC\\Memcache\\Redis",
"memcache.locking": "\\OC\\Memcache\\Redis",
"redis": {
"host": "***REMOVED SENSITIVE VALUE***",
"password": "***REMOVED SENSITIVE VALUE***",
"port": 6379
},
"app_install_overwrite": [
"news",
"richdocumentscode",
"journal",
"weather",
"cookbook"
],
"trusted_domains": [
"127.0.0.1",
"192.168.1.254",
"localhost",
"nextcloud",
"nextcloud.xxxxxxxx.xxxxx",
"nextcloud.xxxxxxxx.xxxxx:8443"
]
}
}
Apps
The output of occ app:list
(if possible).
Enabled:
- activity: 4.0.0
- app_api: 5.0.2
- assistant: 2.4.0
- bruteforcesettings: 4.0.0
- calendar: 5.2.1
- circles: 31.0.0
- cloud_federation_api: 1.14.0
- comments: 1.21.0
- contacts: 7.0.5
- contactsinteraction: 1.12.0
- context_chat: 4.2.0
- cookbook: 0.11.3
- dashboard: 7.11.0
- dav: 1.33.0
- federatedfilesharing: 1.21.0
- federation: 1.21.0
- files: 2.3.1
- files_downloadlimit: 4.0.0
- files_pdfviewer: 4.0.0
- files_reminders: 1.4.0
- files_sharing: 1.23.1
- files_trashbin: 1.21.0
- files_versions: 1.24.0
- firstrunwizard: 4.0.0
- integration_openai: 3.5.0
- integration_openstreetmap: 2.0.1
- logreader: 4.0.0
- lookup_server_connector: 1.19.0
- mail: 4.3.6
- nextcloud_announcements: 3.0.0
- notes: 4.11.0
- notifications: 4.0.0
- oauth2: 1.19.1
- password_policy: 3.0.0
- privacy: 3.0.0
- profile: 1.0.0
- provisioning_api: 1.21.0
- recommendations: 4.0.0
- related_resources: 2.0.0
- richdocuments: 8.6.4
- serverinfo: 3.0.0
- settings: 1.14.0
- sharebymail: 1.21.0
- systemtags: 1.21.1
- tasks: 0.16.1
- text: 5.0.0
- theming: 2.6.1
- twofactor_backupcodes: 1.20.0
- updatenotification: 1.21.0
- user_status: 1.11.0
- viewer: 4.0.0
- weather_status: 1.11.0
- webhook_listeners: 1.2.0
- workflowengine: 2.13.0
Disabled:
- admin_audit: 1.21.0
- encryption: 2.19.0
- files_external: 1.23.0
- journal: 0.0.4 (installed 0.0.4)
- photos: 4.0.0-dev.1 (installed 2.4.0)
- qownnotesapi: 25.2.0 (installed 25.2.0)
- support: 3.0.0 (installed 1.11.0)
- survey_client: 3.0.0 (installed 2.0.0)
- suspicious_login: 9.0.1
- twofactor_nextcloud_notification: 5.0.0
- twofactor_totp: 13.0.0-dev.0
- user_ldap: 1.22.0
Thanks,
-Bill