virtualmin delete-domain fails at webalizer

Howdy Virtualmin team,

I am having some trouble deleting a domain via the virtualmin UI and CLI. In particular, there seems to be trouble in deleting the webalizer plugin. In each domain that I have tried to remove, I get stuck at this step, whether I am deleting the domain via the virtualmin UI ('selecting virtual server' -> 'Disable and Delete' -> 'Delete Virtual Server') or the virtualmin CLI ('virtualmin delete-domain --domain'):

Deleting scheduled Webalizer reporting ..

I've also tried disabling the plugin for the site I would like to delete prior to running the delete-domain command ('edit virtual server' -> 'enabled features' -> 'uncheck webalizer' -> 'save') ; however, it too gets stuck at "Deleting scheduled Webalizer reporting ..". I waited at one point 2 hours before killing off the delete-domain process.

Looking at the strace output of the running, it appears to be stuck looking at some .htaccess.lock file in the stats directoryfor the user (~utweb-demo-0948/public_html/stats/.htaccess.lock). I've attached the loop that appears to be happening in that strace output. I was able to delete a domain sometime last week (11/10) without issues. Any ideas why webalizer might be putting up a fight? Thanks!




Howdy -- thanks for all the info in your report!

Jamie will likely need to chime in with some thoughts, but I had an additional question -- is this issue occurring for one particular domain?

Or do you experience this problem with most/all domains that you try to remove?

What does that ~utweb-demo-0948/public_html/stats/.htaccess.lock file contain? Normally it should have the PID of the process that is holding the lock, which you can then lookup with ps

I have a similar delete domain issue. Create dummy2 domain. Cannot delete dummy2 domain. Nothing presented to web page during delete request. I posted a related question to the forum as I cannot create/delete domain user.

How long is the .htaccess.lock file held?

drwxr-xr-x 2 dummy2 dummy2 4096 Nov 29 04:48 . drwxr-x--- 4 dummy2 dummy2 4096 Nov 28 10:58 .. -rw-r--r-- 1 dummy2 dummy2 12288 Nov 29 04:48 dns_cache.db -rw-r--r-- 1 dummy2 dummy2 156 Nov 28 10:58 .htaccess -rw-r--r-- 1 root root 6 Nov 28 18:34 .htaccess.lock

sh-4.2$ cat .htaccess.lock 27763

sh-4.2$ ps --pid 27763 PID TTY TIME CMD sh-4.2$

It looks like the PID in that .lock file is no longer running... you may want to try deleting that file, and then re-attempt deleting the domain.

Hi Andre and Jamie,

Thanks for the questions and apologies for such a late reply. We've found that if we 'disassociate' the webalizer plugin from the site we want to delete, and then run virtualmin delete-domain --domain "domain", we can delete the site without getting stuck. We did this for all of our sites using:

virtualmin disable-feature --all-domains --disassociate --webalizer

and so far, deleting domains has not been an issue. We are not using the webalizer plugin in our production environment so this workaround is fine with us.

*What does that ~utweb-demo-0948/public_html/stats/.htaccess.lock file contain? Great question but I did not have the brains to think and view the contents of that file :/

*It looks like the PID in that .lock file is no longer running... you may want to try deleting that file, and then re-attempt deleting the domain. We did try that; however, upon deleting that .lock file, another file was put in its place that was a hidden file (beginning with '.') and had abunch of random alphanumeric characters as its name. That file persisted there for what seemed to be 10 seconds or so. Then when I looked again using ls -la for hidden files, the .lock file was there once more. Keep in mind that we were trying to delete that .lock file prior to deleting the site so it seemed as if some process was checking to make sure that .lock file was there?

We also noticed that the .lock file appeared to exist for all sites in the same location (~utweb-demo-NNNN/public_html/stats/.htaccess.lock). I think as far as our issue goes with deleting sites, we are all set but let me know if there is some other information y'all would like.


I wonder if there was some other ongoing operation at the same time for the problem domain that was creating this lock file, and thus preventing the deletion?

That was my initial thought. There is a crontab entry to run /etc/webmin/virtualmin-awstats/ with the site's domain name as an argument at various hours throughout the day. Ex:

43 8 * * * /etc/webmin/virtualmin-awstats/

I'm not sure if that script might have interfered with the deletion or how long it takes to run. At any rate though, dissociating the feature across all the sites seemes to have resolved the issue of not being able to delete a site. thanks for y'alls insight!