I hope this information helps other hosts out there who might be encountering the same kind of issue....
So I ran into a problem trying to remove a subdomain from one of my customer's cPanel.
If I went to cPanel > Subdomains and clicked the "Remove" link next to the subdomain in question, cPanel would just spit back this message:
"error from domain wrapper: subdomain does not exist for user"
So then I checked WHM > List Subdomains to check for duplicates / incorrect users or anything else suspicious, but nothing unusual there.
Below is what I did to FIX the issue and had no problems with it, but I can't say whether it's the best way. I'd recommend getting a second opinion or maybe someone else can post their thoughts on the method I used.
(Note - since the subomains were actually part of an addon domain under the master user account, and he was running a "twitter" subdomain and a "blog" subdomain, I should explain that in the commands below "username" is the master account user and "example" is an addon domain and twitter / blog are the subdomains I discovered "stuck" in his folder in /var/cpanel/userdata/ )
Here's what I did:
ssh into the server and login to root
grep -r twitter.example.com /var/cpanel/users (found nothing there)
so then i checked:
grep -r twitter.example.com /var/cpanel/userdata (and came up with several hits to start examining)
removed the following files:
rm /var/cpanel/userdata/username/example.username.com.cache
rm /var/cpanel/userdata/username/blog.example.com.cache
rm /var/cpanel/userdata/username/twitter.example.com.cache
rm /var/cpanel/userdata/nobody/twitter.example.com
rm /var/cpanel/userdata/username/twitter.example.com
rm /var/cpanel/userdata/nobody/twitter.example.com.cache
Then I EDITED /var/cpanel/userdata/username/main and removed twitter.example.com from it
Then I logged into WHM > cPanel > Upgrade to Latest Version and simply ran update. I did this last step in hopes that everything was resolved and for the most part it was, but there was some lingering "DocumentRoot" missing warnings in the logs during httpd restarts, and so one last step was needed:
Then ran /scripts/rebuildhttpdconf and it finally removed the bogus domain virtual containers from httpd.conf
Ran cPanel update once more and the problem is gone.
I'm interested in any opinions / comments or perhaps anything I've missed, but hopefully this helps someone. I'm sure I took the long-route but it worked.
So I ran into a problem trying to remove a subdomain from one of my customer's cPanel.
If I went to cPanel > Subdomains and clicked the "Remove" link next to the subdomain in question, cPanel would just spit back this message:
"error from domain wrapper: subdomain does not exist for user"
So then I checked WHM > List Subdomains to check for duplicates / incorrect users or anything else suspicious, but nothing unusual there.
Below is what I did to FIX the issue and had no problems with it, but I can't say whether it's the best way. I'd recommend getting a second opinion or maybe someone else can post their thoughts on the method I used.
(Note - since the subomains were actually part of an addon domain under the master user account, and he was running a "twitter" subdomain and a "blog" subdomain, I should explain that in the commands below "username" is the master account user and "example" is an addon domain and twitter / blog are the subdomains I discovered "stuck" in his folder in /var/cpanel/userdata/ )
Here's what I did:
ssh into the server and login to root
grep -r twitter.example.com /var/cpanel/users (found nothing there)
so then i checked:
grep -r twitter.example.com /var/cpanel/userdata (and came up with several hits to start examining)
removed the following files:
rm /var/cpanel/userdata/username/example.username.com.cache
rm /var/cpanel/userdata/username/blog.example.com.cache
rm /var/cpanel/userdata/username/twitter.example.com.cache
rm /var/cpanel/userdata/nobody/twitter.example.com
rm /var/cpanel/userdata/username/twitter.example.com
rm /var/cpanel/userdata/nobody/twitter.example.com.cache
Then I EDITED /var/cpanel/userdata/username/main and removed twitter.example.com from it
Then I logged into WHM > cPanel > Upgrade to Latest Version and simply ran update. I did this last step in hopes that everything was resolved and for the most part it was, but there was some lingering "DocumentRoot" missing warnings in the logs during httpd restarts, and so one last step was needed:
Then ran /scripts/rebuildhttpdconf and it finally removed the bogus domain virtual containers from httpd.conf
Ran cPanel update once more and the problem is gone.
I'm interested in any opinions / comments or perhaps anything I've missed, but hopefully this helps someone. I'm sure I took the long-route but it worked.
Last edited: