debug added for ip

This commit is contained in:
Vaibhav Pathak 2026-01-21 17:11:56 +05:30
parent d3d1f94c04
commit b887bf2919

View File

@ -777,11 +777,19 @@ spec:
# Get or create app_id (using INSERT ... ON DUPLICATE KEY UPDATE for idempotency) # Get or create app_id (using INSERT ... ON DUPLICATE KEY UPDATE for idempotency)
echo " Ensuring app entry exists for: $app_name" echo " Ensuring app entry exists for: $app_name"
if ! run_mysql "INSERT INTO apps (name, token, creation_date, last_update, is_deleted) VALUES ('$app_name', UUID(), NOW(), NOW(), 0) ON DUPLICATE KEY UPDATE last_update=NOW()"; then INSERT_RESULT=$(run_mysql "INSERT INTO apps (name, token, creation_date, last_update, is_deleted) VALUES ('$app_name', UUID(), NOW(), NOW(), 0) ON DUPLICATE KEY UPDATE last_update=NOW()" 2>&1) || true
echo " Warning: INSERT command returned non-zero, but continuing..." echo " INSERT result: '$INSERT_RESULT'"
fi
APP_ID=$(run_mysql "SELECT id FROM apps WHERE name='$app_name'" || echo "") # Debug: Show all apps in table
echo " DEBUG: Listing apps in database..."
run_mysql "SELECT id, name FROM apps LIMIT 10" 2>&1 || true
APP_ID=$(run_mysql "SELECT id FROM apps WHERE name='$app_name'" 2>&1) || true
echo " DEBUG: Raw APP_ID result: '$APP_ID'"
# Clean APP_ID - remove any non-numeric characters
APP_ID=$(echo "$APP_ID" | grep -o '[0-9]*' | head -1)
echo " DEBUG: Cleaned APP_ID: '$APP_ID'"
if [ -z "$APP_ID" ]; then if [ -z "$APP_ID" ]; then
echo " Failed to get app_id for: $app_name" echo " Failed to get app_id for: $app_name"