automation-suite
2024.10
false
UiPath logo, featuring letters U and I in white

Automation Suite on Linux installation guide

Last updated Nov 13, 2025

Upgrade stuck on rook-ceph application deletion

Description

During an upgrade, the process may stall at the pre-upgrade stage while attempting to delete the rook-ceph ArgoCD application. This occurs because ArgoCD continues to track resources that must be deleted, preventing the upgrade from completing.

Solution

To address the issue, you must remove the ArgoCD tracking from the affected application by running the following script:
#!/bin/bash
# Remove ArgoCD tracking from stuck applications
# Usage: ./remove-argocd-tracking.sh <app-name> [app-namespace]

set -e
APP_NAME="${1:-}"
APP_NAMESPACE="${2:-argocd}"

# Check dependencies
if ! command -v kubectl &> /dev/null; then
    echo "Error: kubectl not found"
    exit 1
fi

if ! command -v jq &> /dev/null; then
    echo "Error: jq not found"
    exit 1
fi

if [[ -z "$APP_NAME" ]]; then
    echo "Usage: $0 <app-name> [app-namespace]"
    exit 1
fi

# Check if application exists
if ! kubectl get application "$APP_NAME" -n "$APP_NAMESPACE" >/dev/null 2>&1; then
    echo "Error: Application '$APP_NAME' not found in namespace '$APP_NAMESPACE'"
    exit 1
fi

echo "Removing ArgoCD tracking from: $APP_NAME"

# Disable auto-sync
kubectl patch application "$APP_NAME" -n "$APP_NAMESPACE" \
    --type='json' -p='[{"op": "remove", "path": "/spec/syncPolicy"}]' 2>/dev/null || true

# Remove tracking from all managed resources
kubectl get application "$APP_NAME" -n "$APP_NAMESPACE" -o json | \
    jq -r '.status.resources[]? | select(.kind != null and .name != null) | "\(.kind) \(.name) \(.namespace // "")"' | \
    while IFS= read -r line; do
        [[ -z "$line" ]] && continue
        read -r kind name namespace <<< "$line"
        
        if [[ -n "$namespace" ]]; then
            kubectl annotate "$kind" "$name" -n "$namespace" argocd.argoproj.io/tracking-id- --ignore-not-found=true 2>/dev/null || true
            kubectl label "$kind" "$name" -n "$namespace" argocd.argoproj.io/instance- app.kubernetes.io/instance- --ignore-not-found=true 2>/dev/null || true
        else
            kubectl annotate "$kind" "$name" argocd.argoproj.io/tracking-id- --ignore-not-found=true 2>/dev/null || true
            kubectl label "$kind" "$name" argocd.argoproj.io/instance- app.kubernetes.io/instance- --ignore-not-found=true 2>/dev/null || true
        fi
        
        echo "Removed tracking from $kind/$name"
    done

echo "Tracking removal completed. You can now manually delete stuck resources."
#!/bin/bash
# Remove ArgoCD tracking from stuck applications
# Usage: ./remove-argocd-tracking.sh <app-name> [app-namespace]

set -e
APP_NAME="${1:-}"
APP_NAMESPACE="${2:-argocd}"

# Check dependencies
if ! command -v kubectl &> /dev/null; then
    echo "Error: kubectl not found"
    exit 1
fi

if ! command -v jq &> /dev/null; then
    echo "Error: jq not found"
    exit 1
fi

if [[ -z "$APP_NAME" ]]; then
    echo "Usage: $0 <app-name> [app-namespace]"
    exit 1
fi

# Check if application exists
if ! kubectl get application "$APP_NAME" -n "$APP_NAMESPACE" >/dev/null 2>&1; then
    echo "Error: Application '$APP_NAME' not found in namespace '$APP_NAMESPACE'"
    exit 1
fi

echo "Removing ArgoCD tracking from: $APP_NAME"

# Disable auto-sync
kubectl patch application "$APP_NAME" -n "$APP_NAMESPACE" \
    --type='json' -p='[{"op": "remove", "path": "/spec/syncPolicy"}]' 2>/dev/null || true

# Remove tracking from all managed resources
kubectl get application "$APP_NAME" -n "$APP_NAMESPACE" -o json | \
    jq -r '.status.resources[]? | select(.kind != null and .name != null) | "\(.kind) \(.name) \(.namespace // "")"' | \
    while IFS= read -r line; do
        [[ -z "$line" ]] && continue
        read -r kind name namespace <<< "$line"
        
        if [[ -n "$namespace" ]]; then
            kubectl annotate "$kind" "$name" -n "$namespace" argocd.argoproj.io/tracking-id- --ignore-not-found=true 2>/dev/null || true
            kubectl label "$kind" "$name" -n "$namespace" argocd.argoproj.io/instance- app.kubernetes.io/instance- --ignore-not-found=true 2>/dev/null || true
        else
            kubectl annotate "$kind" "$name" argocd.argoproj.io/tracking-id- --ignore-not-found=true 2>/dev/null || true
            kubectl label "$kind" "$name" argocd.argoproj.io/instance- app.kubernetes.io/instance- --ignore-not-found=true 2>/dev/null || true
        fi
        
        echo "Removed tracking from $kind/$name"
    done

echo "Tracking removal completed. You can now manually delete stuck resources."
  • Description
  • Solution

Was this page helpful?

Get The Help You Need
Learning RPA - Automation Courses
UiPath Community Forum
Uipath Logo
Trust and Security
© 2005-2025 UiPath. All rights reserved.