hassio-addons: 🐛 [Nextcloud] latest upstream version does not allow to install apps
Description
I can’t enable the External Storage Support App in Nextcloud. When trying to enable it, it says:
Error: This app cannot be enabled because it makes the server unstable
I set the Share up as CIFS networkdisks in the Addon Options and rebooted, it looks like sucessful:
[09:22:50] INFO: ...... //192.168.xxx.xxx/SERVER/SHARE1/Subfolder successfully mounted to /mnt/Subfolder with options rw,file_mode=0775,dir_mode=0775,username=user-smb-nextcloud,password=XXXXXXXXXX,nobrl,uid=1000,gid=1000,iocharset=utf8
Any Idea how to resolve that Issue?
Reproduction steps
1. Set up CIFS Share
2. Reboot the Nextcloud-Addon
3. Open the Nextcloud UI, navigate to Apps-> Find "External Storage Support"
4. Click on "Enable"
Addon Logs
Add-on version: 28.0.4
You are running the latest version of this add-on.
System: Home Assistant OS 12.1 (aarch64 / raspberrypi4-64)
Home Assistant Core: 2024.3.3
Home Assistant Supervisor: 2024.03.1
-----------------------------------------------------------
Please, share the above information when looking for help
or support in, e.g., GitHub, forums
-----------------------------------------------------------
Provided by: https://github.com/alexbelgium/hassio-addons
-----------------------------------------------------------
Defining permissions for main user :
User UID: 1000
User GID : 1000
-----------------------------------------------------------
/etc/cont-init.d/00-global_var.sh: executing
Full_Text_Search='false'
OCR='false'
OCRLANG='fra'
PGID='1000'
PUID='1000'
additional_apps='inotify-tools'
certfile='fullchain.pem'
cifspassword='xxxxxxxxxxxxx'
cifsusername='xxxxxxxxxxxxx'
default_phone_region='DE'
elasticsearch_server='<ip:port>'
enable_thumbnails='false'
keyfile='privkey.pem'
networkdisks='//192.168.xxx.xxx/SERVER/SHARE1/Subfolder/'
trusted_domains='ha.mydomain.com, ha-dev.mydomain.com'
use_own_certs='true'
/etc/cont-init.d/00-local_mounts.sh: executing
/etc/cont-init.d/00-smb_mounts.sh: executing
Mounting smb share(s)...
... using PUID 1000 and PGID 1000
... mounting //192.168.xxx.xxx/SERVER/SHARE1/Subfolder
[09:22:50] INFO: ...... //192.168.xxx.xxx/SERVER/SHARE1/Subfolder successfully mounted to /mnt/Subfolder with options rw,file_mode=0775,dir_mode=0775,username=user-smb-nextcloud,password=XXXXXXXXXX,nobrl,uid=1000,gid=1000,iocharset=utf8
/etc/cont-init.d/01-config_yaml.sh: executing
Setting permissions for the config.yaml directory
Load environment variables from /config/addons_config/nextcloud-ocr/config.yaml if existing
If accessing the file with filebrowser it should be mapped to /homeassistant/addons_config/nextcloud-ocr/config.yaml
---------------------------------------------------------
Wiki here on how to use : github.com/alexbelgium/hassio-addons/wiki/Add‐ons-feature-:-add-env-variables
... no env variables found, exiting
/etc/cont-init.d/01-custom_script.sh: executing
Execute /homeassistant/addons_config/nextcloud-ocr/nextcloud-ocr.sh if existing
Wiki here : github.com/alexbelgium/hassio-addons/wiki/Add-ons-feature-:-customisation
/etc/cont-init.d/01-folders.sh: executing
Setting user to 1000:1000
Updating permissions...
... Config directory : /data
... data directory detected : /share/nextcloud
... setting permissions
... done
/etc/cont-init.d/02-init_steps.sh: executing
/etc/cont-init.d/02-mariadb_discovery.sh: executing
/etc/cont-init.d/30-ssl.sh: executing
Using referenced ssl certificates
... checking if referenced files exist
... done
/etc/cont-init.d/99-add_packages.sh: executing
/etc/cont-init.d/99-elasticsearch.sh: executing
/etc/cont-init.d/99-ocr.sh: executing
/etc/cont-init.d/99-trusted_domains.sh: executing
Starting the upstream container
[migrations] started
[migrations] 01-nginx-site-confs-default: skipped
[migrations] 02-default-location: skipped
[migrations] done
───────────────────────────────────────
██╗ ███████╗██╗ ██████╗
██║ ██╔════╝██║██╔═══██╗
██║ ███████╗██║██║ ██║
██║ ╚════██║██║██║ ██║
███████╗███████║██║╚██████╔╝
╚══════╝╚══════╝╚═╝ ╚═════╝
Brought to you by linuxserver.io
───────────────────────────────────────
To support LSIO projects visit:
https://www.linuxserver.io/donate/
───────────────────────────────────────
GID/UID
───────────────────────────────────────
User UID: 1000
User GID: 1000
───────────────────────────────────────
using keys found in /data/config/keys
Initializing nextcloud 28.0.4.1 (this can take a while) ...
Setting permissions
Initializing finished
Starting...
/etc/cont-init.d/02-init_steps.sh: executing
Setting logs
----------------------------------------
Nextcloud 28.0.4.1 is installed
----------------------------------------
... checking for app updates
... Clean potential errors
Maintenance mode already disabled
... Remove CODE if installed as not compatible
... Define default_phone_region
System config value default_phone_region set to string DE
... Disabling check_data_directory_permissions
System config value check_data_directory_permissions set to boolean false
... disabling thumbnails
System config value enable_previews set to string false
/etc/cont-init.d/02-mariadb_discovery.sh: executing
0 [>---------------------------] 0 [->--------------------------]---
MariaDB addon was found! It can't be configured automatically due to the way Nextcloud works, but you can configure it manually when running the web UI for the first time using those values :
Database user : service bashio::log.blue Database user : service
Database password : xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Database name : nextcloud
Host-name : core-mariadb:3306
---
/etc/cont-init.d/99-add_packages.sh: executing
[09:23:32] INFO: Installing additional apps :
... inotify-tools
/etc/cont-init.d/99-elasticsearch.sh: executing
/etc/cont-init.d/99-ocr.sh: executing
/etc/cont-init.d/99-trusted_domains.sh: executing
[09:23:35] INFO: Currently set trusted domains :
192.168.xxx.xxx:8099
ha.mydomain.com
ha-dev.mydomain.com
[09:23:36] INFO: Trusted domains set in the configuration. Refreshing domains.
[09:23:36] INFO: ... removing previously added trusted domain (except for first one created)
System config value trusted_domains => 2 deleted
System config value trusted_domains => 3 deleted
System config value trusted_domains => 4 deleted
System config value trusted_domains => 5 deleted
[09:23:41] INFO: ... alignement with trusted domains list : ha.mydomain.com, ha-dev.mydomain.com
[09:23:41] INFO: ... adding ha.mydomain.com
System config value trusted_domains => 6 set to string ha.mydomain.com
[09:23:42] INFO: ... adding ha-dev.mydomain.com
System config value trusted_domains => 7 set to string ha-dev.mydomain.com
[09:23:43] INFO: Remaining configurated trusted domains :
[09:23:44] INFO: 192.168.xxx.xxx:8099
ha.mydomain.com
ha-dev.mydomain.com
Starting the upstream container
[custom-init] No custom files found, skipping...
crond: crond (busybox 1.36.1) started, log level 8
[ls.io-init] done.
[05-Apr-2024 09:23:45] NOTICE: fpm is running, pid 1406
[05-Apr-2024 09:23:45] NOTICE: ready to handle connections
Architecture
No response
OS
HAos
About this issue
- Original URL
- State: closed
- Created 3 months ago
- Comments: 51 (23 by maintainers)
Commits related to this issue
- Avoid "app cannot be enabled" https://github.com/linuxserver/docker-nextcloud/issues/425 https://github.com/alexbelgium/hassio-addons/issues/1333 — committed to alexbelgium/docker-nextcloud by alexbelgium 2 months ago
- Update config.json https://github.com/alexbelgium/hassio-addons/issues/1333 — committed to alexbelgium/hassio-addons by alexbelgium 2 months ago
i can confirm this is workaround working!
Ok, you probably didn’t get the message. So I will try to explain in more straightforward way.
It is rude to start switch to other language that the one in which given topic is discussed. It is rude because you automatically expect that other people who cooperate on the issuse will now start using translator just to overcome your inabilities.
So thank you, that next time you will try to use English.
Ok, vous n’avez probablement pas compris le message. Je vais donc essayer de vous expliquer de manière plus simple.
Il est impoli de commencer à passer à une autre langue que celle dans laquelle le sujet donné est abordé. C’est impoli car vous vous attendez automatiquement à ce que d’autres personnes qui coopèrent sur le problème commencent désormais à utiliser un traducteur juste pour surmonter vos incapacités.
Alors merci, la prochaine fois, vous essaierez d’utiliser l’anglais.
Sorry guys, my Klingon is little bit rusty, would you please prefer to speak UN galactic standard?
Hélas il est peu recommandé de revenir sur des versions précédentes de Nextcloud, car cela peut causer des problèmes de corruption de database… La solution la plus simple a court terme est d’éviter d’utiliser ssl car le problème de base est sur la redirection https -> http ; sinon je vais tenter de regarder mais cela ne dois pas être évident à faire car l’issue est ouverte depuis un moment sur nextcloud : https://github.com/nextcloud/server/issues/44685
yes I’ve checked using portainer that the files are modifed and I’ve tried in incognito mode to avoid the cache ; I’ll try again tomorrow but don’t see what else to do
For sure the file is used though - if I delete it then the apps page doesn’t work anymore
BUT beware, this are not the issues! just check some of them, they are completely fine, having inside strings like.
I really think, that that fix is only where the original nextcloud commit has:
return api.get(generateUrl('apps/files'))
and that seems to be only at one place - the one you already fixed:
and correspondig minified dist/settings-vue-settings-apps-users-management.js:
So to my best knowledge it shall be working…
Not all are javascripts, only those
Yep, as I am afraid that single function in src is on many more places…
No worry, I don’t know anything about JS either, just quick googled info. 😃
Yep, this modified version should do the trick.
I was wrong
you need to edit:
settings-vue-settings-apps-users-management.js
and replace string
"apps/files"
by"apps/files/"
The map file is just kind of optional to modify.
this is how it look in the minified code:
(e.commit(“startLoading”,n),e.commit(“startLoading”,“install”),v((0,p.Jv)(“settings/apps/enable”),{appIds:n,groups:i}).then((r=>(e.commit(“stopLoading”,n),e.commit(“stopLoading”,“install”),n.forEach((t=>{e.commit(“enableApp”,{appId:t,groups:i})})),g((0,p.Jv)(“
apps/files
”)).then((()=>{r.data.update_required&&((0,c.cf)(t(“settings”,“The app has been enabled but needs to be updated. You will be redirected to the update page in 5 seconds.”),{onClick:()=>window.location.reload(),close:!1}),setTimeout((function(){location.reload()}),5e3))})).catdist/settings-vue-settings-apps-users-management.js
and
dist/settings-vue-settings-apps-users-management.js.map
Based on my knowledge minified file would be used. So to be safe you need to modify both.
So yep, it seem that source js is minified…
Awesome, yes its working Great and instantly! I wish i would have as much as Knowledge. Thank you so much for helping me out there! 👍 👍
For Reference: If somebody is looking for a Way to do file Operations directly in the Nextcloud Data Folder, and to make them visible in Nextcloud via syncing - this is your Copy, Paste and Restart Addon Solution 💯
Hi, sorry I wrote that code from my couch without testing it 😃 Here is a code tested as working :
Hi,
To begin with, I’ve encoutered the same issue as you regarding the unability to install new apps. After investigating it is confirmed to be an upstream issue : https://github.com/linuxserver/docker-nextcloud/issues/422 . To solve it I’ve installed portainer, then manually enabled additional apps using for example
occ app:enable external
for the “external” appRegarding the usage of startup script, you probably should try with
In theory it should work 😃
Thank you so much for taking your Time and showing and explaining my Option! As im still in the Phase of observing how it works with my system, i think ill keep the standard Setup by now. Sooner or later (maybe sooner 😄) ill start from scratch anyway, using a big ssd as storage.
The Hint with autoscript, and Options to run that is superhelpful! Thanks! Will give it a shot during the next Days…
I’ll keep that Ticket open in Case something change. I can just add: I restored the second last Version from an older Homeassistant-Backup. Indeed, with Nextcloud 28.0.3 there is no problem at all, i could add external Folders right away. In case somebody has the same Problems and an older Backup…
Thanks again mate! The only Problem with your great Addon-Collection: Too many Temptations. If id use all interesting ones it’s surely screw my RPi… 😄
Hello! Indeed if you want to use your external drive it would likely be more preferable that you restart from scratch, and directly use /mnt/subfolder/nextcloud as a data folder. This is how my own system is configured. I don’t think nextcloud allows to add additional folders after initial config but I might be wrong…
Another way would be that you could have a script that periodically moves your files. For example, an automation that executes every 30 minutes a cp command so that everytime someone uploads to the folder it gets copied to a folder visible by nextcloud ? Usually I simply use the nextcloud app, which allows uploading directly to the nextcloud folders 😃
To run custom commands I don’t think it’s easy to do it from a shell_command as those run in the homeassistant container, while you would need to run it in the nextcloud container… The easiest way is to use my autoscript feature, that allows you to manually run commands when the addon starts : https://github.com/alexbelgium/hassio-addons/wiki/Add‐ons-feature-:-customisation . As this is injected as addon start, it will also stay there even when updating the addon, which would not be the case if you modify the code directly using portainer. There is then two ways to run it regularly:
Hope this is helpful to you 😃
And thanks for the very kind words and appreciation !
According to this “https://www.reddit.com/r/NextCloud/comments/1bqf8wp/2804_error_this_app_cannot_be_enabled_because_it/” you could enable it manually by running
occ app:enable files_external
after going in the container using portainer. This link also confirms that it is not linked to the addon, but to the upstream container… Good luck!Hi, I see the same issue on my instance but I think it is more due to nextcloud than the addon… Perhaps an incompatibility of version? I think you’d have more chance posting on their forum where they have seemed to have encountered that issue before : https://help.nextcloud.com/t/external-storage-support-cannot-be-enabled/120830
But anyway you don’t really need it : you can use the /mnt/Subfolder folder as if it was a native folder - this app is only used if you want to mount the SMB drive from nextcloud