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

🐛 [webtrees] SMB mount successful but can't redirect webtrees?.. #1694

Open
arsenyspb opened this issue Jan 2, 2025 · 4 comments
Open
Labels
bug Something isn't working

Comments

@arsenyspb
Copy link

Description

Hi @alexbelgium this is likely a user error, or maybe a bit more documentation would've helped?

Have a perfectly working SMB mountpoint (...with 4MB blocks wow) based on your 2.2.1 webtrees addon's startup configuration, but webtrees can't use this mountpoint to create its files? It would've been a perfectly stateless docker image if I got this working.

Inside the container the mount works:

# docker exec -it addon_db21ed7f_webtrees /bin/bash
root@db21ed7f-webtrees:/data/webtrees# cd /mnt/2_uploads/webtrees/data/
root@db21ed7f-webtrees:/mnt/2_uploads/webtrees/data# touch test
root@db21ed7f-webtrees:/mnt/2_uploads/webtrees/data# ls -la
total 0
drwxrwxr-x 2 root root 0 Jan  2 18:21 .
drwxrwxr-x 2 root root 0 Jan  2 16:25 ..
-rwxrwxr-x 1 root root 0 Jan  2 18:21 test
root@db21ed7f-webtrees:/mnt/2_uploads/webtrees/data# mount -l | grep uploads
//192.168.0.250/2_uploads on /mnt/2_uploads type cifs (rw,relatime,vers=3.1.1,cache=strict,username=<username>,domain=192.168.0.250,uid=0,forceuid,gid=0,forcegid,addr=192.168.0.250,file_mode=0775,dir_mode=0775,iocharset=utf8,soft,nounix,serverino,mapposix,nobrl,reparse=nfs,rsize=4194304,wsize=4194304,bsize=1048576,retrans=1,echo_interval=60,actimeo=1,closetimeo=1)

But in the webtrees:

image

And it defaults back to /share/webtrees/data/ which is going back to the Supervisor's disk.

Let me know if it's a documentation bug or something, maybe I'll send a rookie PR for your markdown...

Reproduction steps

Home Assistant 
Core 2024.12.5
Supervisor 2024.12.0
Operating System 14.1
Frontend 20241127.8

1. Clean install of addon, with manual user creation [as in issues/907](https://github.com/alexbelgium/hassio-addons/issues/907#issuecomment-2566974530)
2. Normal boot with CIFS configuration, success
3. Import GEDCOM
4. Try configuring https://<fqdn>:<port>/admin/site-preferences --> Data folder to <mounted-path-from-logs> 
5. Receive error `"Cannot write to the folder "<mounted-path-from-logs>"`

Addon Logs

Starting...
/etc/cont-init.d/00-banner.sh: executing
-----------------------------------------------------------
 Add-on: Webtrees
 web's leading on-line collaborative genealogy application
-----------------------------------------------------------
 Add-on version: 2.2.1
 You are running the latest version of this add-on.
 System: Home Assistant OS 14.1  (aarch64 / raspberrypi4-64)
 Home Assistant Core: 2024.12.5
 Home Assistant Supervisor: 2024.12.0
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums
-----------------------------------------------------------
 Provided by: https://github.com/alexbelgium/hassio-addons 
-----------------------------------------------------------
/etc/cont-init.d/00-global_var.sh: executing
BASE_URL='<fqdn>'
CONFIG_LOCATION='/config/addons_config/webtrees/config.yaml'
DB_TYPE='mariadb_addon'
certfile='certs/ECC-cert.pem'
cifsdomain='192.168.0.250'
cifspassword=<password>
cifsusername='<username>'
keyfile='certs/ECC-privkey.pem'
networkdisks='//192.168.0.250/2_uploads'
ssl='true'
Timezone set from Etc/UTC to Asia/Singapore
/etc/cont-init.d/00-local_mounts.sh: executing
/etc/cont-init.d/00-smb_mounts.sh: executing
Mounting smb share(s)...
... using domain 192.168.0.250
... mounting //192.168.0.250/2_uploads
[16:23:04] INFO: ...... //192.168.0.250/2_uploads successfully mounted to /mnt/2_uploads with options rw,file_mode=0775,dir_mode=0775,username=<username>,password=<password>,nobrl,uid=0,gid=0,iocharset=utf8,domain=192.168.0.250
/etc/cont-init.d/01-config_yaml.sh: executing
Setting permissions for the config.yaml directory
Load environment variables from /config/addons_config/webtrees/config.yaml if existing
If accessing the file with filebrowser it should be mapped to /homeassistant/addons_config/webtrees/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_autoscripts/webtrees.sh if existing
Wiki here : github.com/alexbelgium/hassio-addons/wiki/Add-ons-feature-:-customisation
/etc/cont-init.d/99-run.sh: executing
[16:23:05] INFO: Defining database
[16:23:06] INFO: Using MariaDB addon. Requirements : running MariaDB addon. Discovering values...
DB_HOST=core-mariadb
DB_PORT=3306
DB_NAME=webtrees
DB_USER=service
DB_PASS=<pass>
[16:23:08] WARNING: Webtrees is using the Maria DB addon
[16:23:08] WARNING: Please ensure this is included in your backups
[16:23:08] WARNING: Uninstalling the MariaDB addon will remove any data
[16:23:11] INFO: Ssl enabled. If webui don't work, disable ssl or check your certificate paths
[16:23:11] INFO: Launching app, please wait
... update data with image
... update permissions
... make links with data in /share
... linking data
... linking modules_v4
... align base url with latest addon value
Aligning base_url addon config
[16:23:13] INFO: Aligning trusted_headers addon config with cf-connecting-ip
[16:23:13] INFO: Data is stored in /share/webtrees
[16:23:13] INFO: Webui can be accessed at : https://<fqdn>:<port>
[16:23:13] INFO: If it is your first boot, the start-up wizard will open
python3 /docker-entrypoint.py
[NV_INIT] PRETTY_URLS found in environment variables
[NV_INIT] HTTPS found in environment variables
[NV_INIT] HTTPS_REDIRECT found in environment variables
[NV_INIT] SSL_CERT_FILE found in environment variables
[NV_INIT] SSL_CERT_KEY_FILE found in environment variables
[NV_INIT] BASE_URL found in environment variables
[NV_INIT] LANG found in environment variables
[NV_INIT] DB_TYPE found in environment variables
[NV_INIT] DB_HOST found in environment variables
[NV_INIT] DB_PORT found in environment variables
[NV_INIT] DB_USER found in environment variables
[NV_INIT] DB_PASS found in environment variables
[NV_INIT] DB_NAME found in environment variables
[NV_INIT] DB_PREFIX found in environment variables
[NV_INIT] WT_USER found in environment variables
[NV_INIT] WT_NAME found in environment variables
[NV_INIT] WT_PASS found in environment variables
[NV_INIT] WT_EMAIL found in environment variables
[NV_INIT] DB_KEY NOT found in environment variables, using default: None
[NV_INIT] DB_CERT NOT found in environment variables, using default: None
[NV_INIT] DB_CA NOT found in environment variables, using default: None
[NV_INIT] DB_VERIFY NOT found in environment variables, using default: None
[NV_INIT] PHP_MEMORY_LIMIT NOT found in environment variables, using default: 1024M
[NV_INIT] PHP_MAX_EXECUTION_TIME NOT found in environment variables, using default: 90
[NV_INIT] PHP_POST_MAX_SIZE NOT found in environment variables, using default: 50M
[NV_INIT] PHP_UPLOAD_MAX_FILE_SIZE NOT found in environment variables, using default: 50M
[NV_INIT] PUID NOT found in environment variables, using default: 33
[NV_INIT] PGID NOT found in environment variables, using default: 33
[NV_INIT] Setting up folder permissions for uploads
usermod: no changes
[NV_INIT] Updating php.ini
[NV_INIT] Creating php.ini
[NV_INIT] Setting value for memory_limit in php.ini
[NV_INIT] Setting value for max_execution_time in php.ini
[NV_INIT] Setting value for post_max_size in php.ini
[NV_INIT] Setting value for upload_max_filesize in php.ini
[NV_INIT] Updating config file
[NV_INIT] Setting value for rewrite_urls in config
[NV_INIT] Setting value for base_url in config
[NV_INIT] Setting value for dbtype in config
[NV_INIT] Setting value for dbhost in config
[NV_INIT] Setting value for dbport in config
[NV_INIT] Setting value for dbuser in config
[NV_INIT] Setting value for dbpass in config
[NV_INIT] Setting value for dbname in config
[NV_INIT] Setting value for tblpfx in config
[NV_INIT] Configuring HTTPS
[NV_INIT] Adding HTTPS, with HTTPS redirect
[NV_INIT] Disabling site webtrees
[NV_INIT] Enabling site webtrees-ssl
[NV_INIT] Enabling site webtrees-redir
[NV_INIT] Setting up folder permissions for uploads
usermod: no changes
[NV_INIT] Starting Apache
webtrees:80 127.0.0.1 - - [02/Jan/2025:16:23:21 +0800] "GET / HTTP/1.0" 400 618 "-" "-"
webtrees:80 127.0.0.1 - - [02/Jan/2025:16:23:51 +0800] "GET / HTTP/1.0" 400 618 "-" "-"
webtrees:80 127.0.0.1 - - [02/Jan/2025:16:24:21 +0800] "GET / HTTP/1.0" 400 618 "-" "-"

Architecture

aarch64

OS

HAos

@arsenyspb arsenyspb added the bug Something isn't working label Jan 2, 2025
@alexbelgium
Copy link
Owner

I'll try to rework the addon it was an old one and I think I can do a better job now at coding it for efficiency

@alexbelgium
Copy link
Owner

You probably need to chown -R www-data:www-data the new folder

@arsenyspb
Copy link
Author

Ah, yes, www-data for Apach2 in the docker is a good troubleshooting thread, but I've got the widest possible permission on the NAS already:

image

Also the webtrees container chown seems to be silently ignored... I don't want to go into PCAP sniffing SMB3 just yet:

root@db21ed7f-webtrees:/mnt/2_uploads/webtrees# chown -R www-data:www-data data/
root@db21ed7f-webtrees:/mnt/2_uploads/webtrees# ls -la
total 0
drwxrwxr-x 2 root root 0 Jan  2 16:25 .
drwxrwxr-x 2 root root 0 Jan  2 21:26 ..
drwxrwxr-x 2 root root 0 Jan  2 18:21 data

And webtrees still throws an error... "Cannot write to the folder ‘/mnt/2_uploads/webtrees/data/’."

Wondering how did you make it work?

@alexbelgium
Copy link
Owner

Hi, I've pushed a new version with code refactor allowing for data folder change, please let me know how it goes!

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

2 participants