{"action":"created","issue":{"url":"https://api.github.com/repos/NixOS/nixpkgs/issues/14099","repository_url":"https://api.github.com/repos/NixOS/nixpkgs","labels_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/14099/labels{/name}","comments_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/14099/comments","events_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/14099/events","html_url":"https://github.com/NixOS/nixpkgs/issues/14099","id":142282953,"number":14099,"title":"Documentation: How to purge a packages state?","user":{"login":"angerman","id":40449,"avatar_url":"https://avatars.githubusercontent.com/u/40449?v=3","gravatar_id":"","url":"https://api.github.com/users/angerman","html_url":"https://github.com/angerman","followers_url":"https://api.github.com/users/angerman/followers","following_url":"https://api.github.com/users/angerman/following{/other_user}","gists_url":"https://api.github.com/users/angerman/gists{/gist_id}","starred_url":"https://api.github.com/users/angerman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angerman/subscriptions","organizations_url":"https://api.github.com/users/angerman/orgs","repos_url":"https://api.github.com/users/angerman/repos","events_url":"https://api.github.com/users/angerman/events{/privacy}","received_events_url":"https://api.github.com/users/angerman/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/NixOS/nixpkgs/labels/0.kind:%20question","name":"0.kind: question","color":"84b6eb"},{"url":"https://api.github.com/repos/NixOS/nixpkgs/labels/6.topic:%20nixos","name":"6.topic: nixos","color":"fef2c0"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-03-21T08:20:09Z","updated_at":"2016-03-21T09:55:02Z","closed_at":null,"body":"So I just ran into the issue of trying to do a force reinstall of gitlab (which brings in redis). I failed to find a command that would take care of purging all the state, should I have wanted to.\r\n\r\nWhat I ended up with was:\r\n\r\n``` bash\r\n$ rm -fR /var/lib/redis\r\n$ rm -fR /var/gitlab\r\n$ dropdb gitlab\r\n$ dropuser gitlab\r\n```\r\n\r\nThis seems far from perfect. Maybe I've just missed some documentation?"},"comment":{"url":"https://api.github.com/repos/NixOS/nixpkgs/issues/comments/199201240","html_url":"https://github.com/NixOS/nixpkgs/issues/14099#issuecomment-199201240","issue_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/14099","id":199201240,"user":{"login":"angerman","id":40449,"avatar_url":"https://avatars.githubusercontent.com/u/40449?v=3","gravatar_id":"","url":"https://api.github.com/users/angerman","html_url":"https://github.com/angerman","followers_url":"https://api.github.com/users/angerman/followers","following_url":"https://api.github.com/users/angerman/following{/other_user}","gists_url":"https://api.github.com/users/angerman/gists{/gist_id}","starred_url":"https://api.github.com/users/angerman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angerman/subscriptions","organizations_url":"https://api.github.com/users/angerman/orgs","repos_url":"https://api.github.com/users/angerman/repos","events_url":"https://api.github.com/users/angerman/events{/privacy}","received_events_url":"https://api.github.com/users/angerman/received_events","type":"User","site_admin":false},"created_at":"2016-03-21T09:55:01Z","updated_at":"2016-03-21T09:55:01Z","body":"I have no idea how this could look either. But maybe integrate with the garbage collection. E.g. allow to collect `stateful` garbage. This clearly needs to be marked dangerous though.\r\n\r\nYet for the gitlab case, not properly purging the state, results in either a broken gitlab instance, with weird error messages (e.g. pushing through ssh is broken). Or if one forgets to drop the user, the service won't start with a message that the ROLE already exists. One needs to make the mental leap from ROLE to postgres database roles to make sense of it.\r\n\r\nI initially tried to drop gitlab from the configuration file, rebuild, re-add it and rebuild again hoping I would be presented with a clean slate. But the system was in an invalid state due to dirty state. And yes, state is something very annoying!\r\n\r\nMaybe @fpletz has some idea esp. with respect to gitlab, yet this could be a more general theme I think."}}