commit b5022969e8adf294094eb0cf92d058d466c0f1f6 parent 273efea7f4d0aaa7c3f215eec8b14178a0d8a23d Author: HernĂ¢ni Marques <hernani@vecirex.net> Date: Thu, 16 Jul 2026 10:41:22 +0200 11368/mytops: clearer taler-merchant-dbconfig errors for dbinit/libs Diffstat:
| M | contrib/taler-merchant-dbconfig | | | 23 | +++++++++++++++++++---- |
1 file changed, 19 insertions(+), 4 deletions(-)
diff --git a/contrib/taler-merchant-dbconfig b/contrib/taler-merchant-dbconfig @@ -66,11 +66,24 @@ if [ "$(id -u)" -ne 0 ]; then fi if [ 0 = "$SKIP_DBINIT" ]; then - if ! taler-merchant-dbinit -v 2>/dev/null; then - echo "Required 'taler-merchant-dbinit' not found. Please fix your installation." + if ! command -v taler-merchant-dbinit >/dev/null 2>&1; then + echo "Required 'taler-merchant-dbinit' not found in PATH." >&2 + echo "Install package 'taler-merchant' (same suite as libgnunet)." >&2 exit 1 fi - DBINIT=$(which taler-merchant-dbinit) + DBINIT=$(command -v taler-merchant-dbinit) + # Binary may exist but fail to load (e.g. missing libgnunet). + DBINIT_ERR=$(mktemp) + if ! "$DBINIT" -v >"$DBINIT_ERR" 2>&1; then + echo "Required 'taler-merchant-dbinit' is installed ($DBINIT) but failed to run:" >&2 + sed 's/^/ /' "$DBINIT_ERR" >&2 || true + rm -f "$DBINIT_ERR" + echo "Common cause: missing or mismatched shared libraries (often libgnunet)." >&2 + echo "Try: ldd \"$DBINIT\" | grep 'not found'" >&2 + echo "Install matching libgnunet packages for this Debian suite, then re-run." >&2 + exit 1 + fi + rm -f "$DBINIT_ERR" fi if ! id "$DBUSER" >/dev/null; then @@ -139,7 +152,9 @@ fi if [ 0 = "$SKIP_DBINIT" ]; then echo "Initializing database $DBNAME." 1>&2 if ! sudo -u "$DBUSER" "$DBINIT" -c "$CFGFILE"; then - echo "Failed to initialize database schema" + echo "Failed to initialize database schema." >&2 + echo "Command was: sudo -u $DBUSER $DBINIT -c $CFGFILE" >&2 + echo "Re-run that command for full errors; ensure Postgres is up and CONFIG is correct." >&2 exit 1 fi fi