Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 [Nextcloud] Nextcloud-ocr.sh gets deleted on startup #1682

Open
tsvi opened this issue Dec 27, 2024 · 2 comments
Open

🐛 [Nextcloud] Nextcloud-ocr.sh gets deleted on startup #1682

tsvi opened this issue Dec 27, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@tsvi
Copy link

tsvi commented Dec 27, 2024

Description

Whenever starting up I get a message that the auto script cannot be run. I thought it was a fluke, but then when recreating it, I saw it was deleted by the addon.

Reproduction steps

1. create auto script file
2. Restart the addon
3. Auto script has been deleted and addon does not run it
4. See error in logs

Addon Logs

�[32m Provided by: https://github.com/alexbelgium/hassio-addons �[0m
�[34m-----------------------------------------------------------�[0m
�[32m Defining permissions for main user : �[0m
�[34mUser UID: 1000�[0m
�[34mUser GID : 1000�[0m
�[34m-----------------------------------------------------------�[0m
/etc/cont-init.d/00-global_var.sh: executing
�[34mFull_Text_Search='true'�[0m
�[34mOCR='true'�[0m
�[34mOCRLANG='eng,heb'�[0m
�[34mPGID='1000'�[0m
�[34mPUID='1000'�[0m
�[34madditional_apps='inotify-tools'�[0m
�[34mcertfile='fullchain.pem'�[0m
�[34mdefault_phone_region='**'�[0m
�[34melasticsearch_server='<ip:port>'�[0m
�[34menable_thumbnails='true'�[0m
�[34mkeyfile='privkey.pem'�[0m
�[34mtrusted_domains='****'�[0m
�[34muse_own_certs='false'�[0m
/etc/cont-init.d/00-local_mounts.sh: executing
/etc/cont-init.d/00-migrate_files.sh: executing
/etc/cont-init.d/00-smb_mounts.sh: executing
/etc/cont-init.d/01-config_yaml.sh: executing
Setting permissions for the config.yaml directory

�[32mLoad environment variables from /config/config.yaml if existing�[0m
�[32mIf accessing the file with filebrowser it should be mapped to /addon_configs/db21ed7f_nextcloud-ocr/config.yaml�[0m
�[32m---------------------------------------------------------�[0m
�[32mWiki here on how to use : github.com/alexbelgium/hassio-addons/wiki/Add‐ons-feature-:-add-env-variables�[0m

�[32m... no env variables found, exiting�[0m
/etc/cont-init.d/01-custom_script.sh: executing
�[32mExecute /addon_configs/db21ed7f_nextcloud-ocr/nextcloud-ocr.sh if existing�[0m
�[32mWiki here : github.com/alexbelgium/hassio-addons/wiki/Add-ons-feature-:-customisation�[0m
�[32m... script found, executing�[0m
cp: cannot stat '/config/addons_autoscripts/nextcloud-ocr.sh': No such file or directory
Scanning files
Could not open input file: /app/www/public/occ
�[0;31mError�[0m : /etc/cont-init.d/01-custom_script.sh exiting 1
/etc/cont-init.d/01-folders.sh: executing
�[32mSetting user to 1000:1000�[0m

Architecture

No response

OS

HAos

@tsvi tsvi added the bug Something isn't working label Dec 27, 2024
@tsvi
Copy link
Author

tsvi commented Dec 27, 2024

Ok, I managed to discover that the file has been migrated to /addon_configs/, so I tried editing the script to copy itself from there to the scripts directory as in the original example, but that fails as well:

cp: cannot stat '/addon_configs/db21ed7f_nextcloud_ocr/nextcloud-ocr.sh': No such file or directory
Add missing indices to database
Could not open input file: /app/www/public/occ

If I understand correctly, the idea here is if occ is not found copy myself into the scripts directory, otherwise run my contents. So I'm unable to update the contents of the file copied during the container start as it's unable to see the file that's running?

@tsvi
Copy link
Author

tsvi commented Dec 27, 2024

I managed fixing it by using:

full_path=`realpath $BASH_SOURCE`
cp $full_path /scripts/

In any case the readme has to be fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant