I am running Landscape On-Premises (version 16.06) on Ubuntu Server 16.04. The activities and the event tabs are filling up with the same entries every day. I am not able to delete any entries from the web interface. Via ssh I deleted relevant log files in the /var/log directory of the server but all activities and the event logs are still present when I login to the Landscape web interface.
I already got the information that the logs are supposed be an auditable log and so intentionally are meant to be not clearable. How can I nevertheless remove the activities and the event logs ? Where are the log files located and how can I manipulate them to clean up the server interface ?
Update : Results from the attempt to remove and reinstall postgresql and landscape-server
The solution to purge and reinstall postgresql
generally worked, but after re-installing and re-registering account and computers, the computers were not able to ping the Landscape Server.
The solution to purge and reinstall landscape-server
did not work - I got an error, which I was not able to solve, also I could not access Landscape Server at all anymore -> screenshots below.
I need to add that I did not run sudo apt autoremove
after the removal - because this would have been a complete re-installation, which is too much effort for only clearing the event log.
I had a period of lots of VM churn, which left me with a similar situation (lots of dangling activities).
It turns out it's quite easy to clear out old activities.
Log into your database:
We can see the databases landscape creates at this point.
I've poked around before, I have no idea why landscape apparently needs SIX different databases for one application. Anyways, in this case, we want the
landscape-standalone-account-1
database:\d
will list the tables in this database. There are a giant number of them. This will probably open an output pager, hit q to exit (or just don't bother with\d
.The
activity
table looks interesting. Let's have a look:[Opens a output-pager again]
Whoa, it's HUGE. How many items are in it?
That doesn't match my activity count (38). Anyways, we can reinstall easily enough, let's just nuke everything.
And I now have no activities, and
tail
ing the logs in/var/log/landscape
and/var/log/landscape-server
doesn't show any errors.So yes, it's pretty easy to clean out stale activities yourself.
They are located in the postgresql database, and there is no supported facility to clear them. You could attempt database manipulations, but I don't know what they are offhand.
Just in case it's fuzzy at all, I would not recommend trying to clear out the database rows, unless you are just playing around.
It is not normal to have so many resync activities. Something else is going on. Ideally, there should be none.
We have this old FAQ entry which still applies:
https://help.landscape.canonical.com/FAQ#I_have_hundreds_of_resynchronization_requests.2C_what_is_going_on.3F
And there is one more tip to add to that list: check if you have multiple landscape-client processes. A normal process tree looks like this:
There might be one more child called package-reporter or package-changer, that's ok, but all under the parent landscape-client. If you have something different like a process outside of this group, that could be causing the resyncs. This would also cause "clones" to appear in your computers.
After many different attempts to clear the activities and event logs, this is what worked :
shutdown the Ubuntu server
change /etc/landscape/client.conf to default on every attached Ubuntu workstation
shutdown every workstation
start Ubuntu server, register Landscape account and afterwards register the server
Now all works as expected, though starting over from scratch somehow is a bit overkill.