argocd Unable to delete application resource with --cascade - prometheus-alertmanager

I'm trying to delete the argo app with argocd app delete Prometheus --cascade command.
It's prompting for confirmation after pressing y able to delete resources but some of the resources are not deleting.
Are you sure you want to delete 'prometheus' and all its resources? [y/n]
How can I confirm that some of the resources are not deleted ?
kubectl get all -n prometheus
NAME READY AGE
statefulset.apps/alertmanager-prometheus-2-kube-promethe-alertmanager 1/1 39m
What I'm looking for ?
I need the solution for delete the all resources with argocd

Usually this is due to child resources created by an application that are pending deletion (probably due to a finalizer on that resource).
As a matter of fact, k get all wont show you everything at all; it wont show secrets, configmaps, serviceaccounts etc, and of course not any CR used by Prometheus. So to investigate further and see those resources that are still there, you will need to query specifically using k get <type>.
Or, use a hammer and query everything in that namespace

Related

GCloud delete CloudRun Domain-Mapping

I am currently trying to represent a new google cloud project in terraform. To complete this I still need to create the domain mapping of my cloudrun instance in terraform.
The domain mapping has already been created in the UI and Terraform cannot overwrite it. When I run terraform apply I get an error message that the domain mapping already exists.
I first tried to import the domain mapping with terraform import. This command returns a success message, as soon as I run terraform apply I get an error message that the domain mapping already exists but is flagged for deletion, I should try the command again after the complete deletion. A few hours later, the resource is still not deleted.
Next I tried to delete the domain mapping in the UI. This does not work, I get the message:
Delete domain mapping failed. Deletion in progress. Resource readiness deadline exceeded.
I have also tried it via the command line interface:
gcloud beta run domain-mappings delete --domain=\<domain\> --namespace=\<namespace\>
But I get the same error message as before.
Does anybody know another way of deleting / importing / fixing /workaround this problem, I'd appreciate any help!

Terraform trying to read the SQL user after database is deleted

Our terraform state went to a broken state after we accidentally executed a out of date branch.
Two of the database got deleted, and as GCP doesn't let you use the same name for database after deletion, terraform couldn't recreate the databases, and bailed out.
The problem is, terraform thinks the databases are their, and trying to read its users:
Error when reading or editing SQL User "xxx" in instance "xxx": googleapi: Error 400: Invalid request: Invalid request since instance is not running., invalid
The instance is simply not there!
I tried to taint the database, and the user, but I still get this exact same error.
Does anyone know how to fix this? I cannot afford to destroy and recreate the environment.
terraform state rm can be used to remove the no longer existing databases from the state file which should fix this. Details at https://www.terraform.io/docs/commands/state/rm.html

How to really move Resources from one subscription to another one on Azure when 1 depends on another

I am trying to move a single Resourcegroup from one subscription to another one. Here how the things looked like
ResourceGroupA (I want to move between subscriptions)
-WebApp A
-SqlDB
-Plan
ResourceGroupB
-WebApp B
So WebApp B is accessing also SQlDB. When I try to move ResourceGroupA to the other Subscription, Azure returns warning that I must Move WebApp B together. It makes sense because it depends on SQLDB. Ok I moved WebApp B to the ResourceGroupA. Starting Move operation again, bump, another error. It complains
WebApp B This resource is located in resource group 'ResourceGroupA ',
but hosted in the resource group 'ResourceGroupB'. This may be a
result of prior move operations. Move it back to respective hosting
resource group
So what will be the solution now? Is there a better way to move maybe 2 ResourceGroups at the same time?
Did you try stopping the WebApp2 and then move the resources?
After 2 days i could solve the problem and i hope that it will help anyone else struggling with this problem.
Although i have described above a simple scenario, i tried to move like 20 resource together within a resource group and Azure complains every time a different resource. Like above described, it complained first a web app which is in another resource group and it suggested me that i should move it together with ResourceGroupA and move it from ResourceGroupB to ResourceGroupA. Here very important you stop the website first and move it because otherwise hosting will remain in ResourceGroupB and it will complain again as error message above. Even though you do that correctly, it complains that you should move the Plan as well if it is in other resource group. When you move it, it complains again that Plan hosting remained in the other resource group. It asks you to move back to the original ResourceGroup which makes no sense and it goes like a ping-pong game. If you make a few move operations suddenly it gets locked and gives your warning that "ResourceGroup has incomplete operation please wait". this might take entire day til you can do another attempt.
Final clear solution, if you are able to do, just publish your web app to the other subscription with a new plan and delete the old one. I have had like 3 web apps complained like that deleted all 3 and republished to the target subscription and i was able to move the rest of the resource group without any error or warning. Beside this solution it is pointless to try back and forth.

couchdb, after replicating to clean version of the database, users get not authorized

After replicating the database to remove tombstones, it started throwing "you are not authorized to access this db".
Restlet error
Pouchdb error
What I had to do was manually add a new user, then remove them again, and that made it happy.
I guess that means, like the indexes, something needs to be reset or rescanned. Any way I can do this operation through script? My script handling this is currently in node by using pouchdb to replicate with a filter to remove all tombstones, then shut down couchdb service, swap the dbname.couch and .dbname_design file and folder around with the clean versions, then start up the service again.
Thanks
--Edit, I have narrowed it down a bit, it looks like creating a new database, adds a new _admin role. Removing that role fixes the permissions. Is there a way to prevent this role from being added, or alternatively, remove it through a script, curl, node, etc.? I am only finding documentation on removing users, not roles.

Sql Data Sync fails and no logs are available

I have 2 SQL data sync groups setup
First one does a 1 way sync from azure to local db. Sync's only 1 table.
Second one does a 1 way sync from local db to the azure. Syncs 2 tables.
After setting it up and getting a few sync errors I was able to figure out what's wrong by checking the logs and fixing the problems. It was all running fine for a while and now it broke down.
I got a sync error every time sync is attempted - however this time I'm not able to fix anything because I don't have any visibility on what's wrong - when I click on the Log tab in the Azure Management portal it just stays blank - no details come up.
I click [Logs]
Wait spinner comes up
And then it looks like this:
Another detail worth mentioning is that the error only occurs for the Second sync group that I have.
Here's what I've attempted so far
I poked around the azure management portal to try to find another way of looking at the logs - looking for something like ftp access to the log file - couldn't find anything like that.
I refreshed schema in the sync rules tab.
Used the SQL Data Sync agent tool on the premise to do the ping operation. Restarted the sql data sync windows service.
Made sure I have the latest SQL Data Sync Agent installed.
I'm wondering what are my options from here...
I'm close to trying to deleting and recreating the sync group... I'm not too comfortable doing this because I know there are some sql tables that get created in the local db to support the operation of the sync - so if I delete the sync group would that automatically drop those helper tables as well or would I have to drop those manually - If I do drop those then that will obviously brake the other sync group that works fin as well..
Any advice is appreciated.
Thanks
you can check the Event Log entries on the box where you installed the SQL Data Sync Agent.
Event Viewer->Applications and Services Logs->Sql Azure Data Sync Preview
or Event Viewer->Applications and Services Logs->Data Sync Service
or you may also try turning logging in verbose mode.
Open LocalAgentHost.exe.config in notepad. This file should be present in your installation directory.
a) Uncomment the section that is currently commented
< !--
< switches>
< add name="SyncAgentTracer" value="4" />
< /switches>
< trace autoflush="true" indentsize="4">
< listeners>
< add name="myListener" type="Microsoft.SqlAzureDataSync.ClientLogging.DSSClientTraceListener, Microsoft.SqlAzureDataSync.ClientLogging, Version=2.0.0.0" initializeData="DSSAgentOutput.log" />
< remove name="Default" />
< /listeners>
< /trace>
-->
b) Stop and restart SQL Azure Data Sync Preview Windows Service.
Now you would find the detailed logs in files named DSSAgentOutput*.log.
If you delete the sync group and the tables are part of other sync groups or you have other sync groups, the deprovisioning will not completely remove everything, just that particular sync group definition.

Resources