fix(erpnext): start bench Redis services before bench new-site

bench new-site requires Redis Queue (port 11000) to be running.
The bench init generates redis_queue.conf and redis_cache.conf but
does not start them, causing ConnectionError during site creation.

Start both Redis instances from the bench-generated configs before
running bench new-site. The production setup (bench setup production)
will take over Redis management afterwards.

Fixes #14331
This commit is contained in:
MickLesk
2026-05-08 21:29:02 +02:00
parent a450266925
commit 425d6bf5d0

View File

@@ -69,6 +69,13 @@ DB_ROOT_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
mysql -u root -e "ALTER USER 'root'@'localhost' IDENTIFIED BY '${DB_ROOT_PASS}'; FLUSH PRIVILEGES;"
$STD sudo -u frappe bash -c 'export PATH="$HOME/.local/bin:$PATH"; cd /opt && bench init --frappe-branch version-15 frappe-bench'
$STD sudo -u frappe bash -c 'export PATH="$HOME/.local/bin:$PATH"; cd /opt/frappe-bench && bench get-app erpnext --branch version-15'
msg_info "Starting Redis Services for Site Setup"
$STD sudo -u frappe bash -c 'redis-server /opt/frappe-bench/config/redis_queue.conf --daemonize yes'
$STD sudo -u frappe bash -c 'redis-server /opt/frappe-bench/config/redis_cache.conf --daemonize yes'
sleep 3
msg_ok "Started Redis Services for Site Setup"
$STD sudo -u frappe bash -c "export PATH=\"\$HOME/.local/bin:\$PATH\"; cd /opt/frappe-bench && bench new-site site1.local --db-root-username root --db-root-password \"$DB_ROOT_PASS\" --admin-password \"$ADMIN_PASS\" --install-app erpnext --set-default"
msg_ok "Initialized Frappe Bench"