ca2236

Well-Known Member
Feb 2, 2018
244
25
28
Nebraska
cPanel Access Level
DataCenter Provider
Hello,

I'm having trouble getting addon domains added or removed. This is confusing and might need some help.

I go to create an addon domain, and get an error. However, a DNS zone gets created and a listing under domains gets created, however, it doesn't seem to work.
if I want to remove a DNS zone, I can't remove it because it says to remove a subdomain that doesn't seem to exist. I found a listing under the domain section, but i can't remove it do to the error:

Error: The domain userdata file for the “<domain.tld>" domain appears to be missing.
 

ca2236

Well-Known Member
Feb 2, 2018
244
25
28
Nebraska
cPanel Access Level
DataCenter Provider
Hi

I will try to explain what is going on. I will try to make it as clear as possible, but I'm not sure i'm completely following what is going on so, I will try my best to be clear.


I have a wordpress site on a cpanel server that has a lot of subdomains for it. I told cPanel to use itself as a DNS server. I am trying to add a few addon domains. (Let's call it domain.com) When I go to add an addon domain, I get the following error: '(XID xyx4f4) A DNS entry for the domain “domain.maindomain.com" already exists.'

so, it errors out, however, the addon domain gets listed in DNS when I go to the 'Delete a DNS zone" in cPanel. But it won't let me remove it since as it says this:

You cannot remove the domain “domain.com" because it is still configured for HTTP use on the “maindomain.com” account. In order to remove the domain, perform any of the following actions:
  • Remove the domain from the account with the “List Subdomains” interface.

However, since it is an addon domain and not a subdomain, it doesn't appear to be listed there.




However, if I go under 'Domains' on the user cpanel interface (the orange infinity like logo) I can see domain.com listed there and then I go to manage domain and to remove the domain I added. When I click the remove button, I get this error:

for this error, I realize it says domain not exist :) but don't know why I'm getting it or how to remove it.

Error: The domain userdata file for the “domain.com" domain appears to be missing.


I thought about rebuilding the userdata, but not sure if this would be helpful since everything seems to be missed up and half there, half not.



I'm getting other errors, but if it is OK, we can start with this one. I'm not sure if it is helpful, but got plenty of storage, but the server is low on Ram.
 

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,300
363
Houston
I get the following error: '(XID xyx4f4) A DNS entry for the domain “domain.maindomain.com" already exists.'
You're getting that after you've already added the domain once I'd wager right? And the initial attempt failed, but most likely for another reason.

This can cause a bunch of issues when domains are 1/2 added and for some reason, the process dies. We have an internal script that we use for these kinds of issues, it's better than rebuilding the userdata and should be attempted first. You need to make a decision to remove or add the domain then based on that you can fill in the places that are missing from the failed add or remove the references to the domain based on the script's output.


Code:
/usr/local/cpanel/3rdparty/bin/perl <(curl -s https://raw.githubusercontent.com/cPanelInc/tech-acctinfo/master/acctinfo) --cruft domain.com
Normal MISSING files:

/var/cpanel/quotawarned
/etc/remotedomains - usually the domain is in localdomains but this could be reversed (it should be in one or the other)
/etc/email_send_limits - if you don't have these enforced
/var/cpanel/mainips/$user
/var/cpanel/bwlimited/$user
/var/cpanel/bwlimited/domain.tld
 

ca2236

Well-Known Member
Feb 2, 2018
244
25
28
Nebraska
cPanel Access Level
DataCenter Provider
Awesome (I had to switch to Bash to run it)

But here is the output.

/usr/local/cpanel/3rdparty/bin/perl <(curl -s https://raw.githubusercontent.com/cPanelInc/tech-acctinfo/master/acctinfo) --cruft domain.com
Timeout while executing: httpd -M
acctinfo - Version: 2.5.21
==============================================================================================
CRUFT CHECK
==============================================================================================
From your query of domain.com I have determined:
No data found for your query of: domain.com in /var/cpanel/accounting.log
Continuing search for domain.com ...
domain.com has an entry in /etc/userdatadomains as an Addon Domain under the maindomain user
----------------------------------------------------------------------------------------------
Searching the following files for user: maindomain
/etc/passwd [EXISTS]
/etc/group [EXISTS]
/etc/shadow [EXISTS]
/etc/gshadow [EXISTS]
/etc/quota.conf [MISSING]
/etc/dbowners [EXISTS]
/etc/trueuserowners [EXISTS]
/var/cpanel/databases/users.db is either empty or missing [SKIPPING]
/etc/userdatadomains.json [EXISTS]
/var/cpanel/quotawarned [MISSING]
/etc/nocgiusers is either empty or missing [SKIPPING]
/etc/userips [EXISTS]
/etc/userbwlimits [EXISTS]
Searching the following files for domain: domain.com
/etc/userdomains [MISSING]
/etc/trueuserdomains [MISSING]
/etc/userdatadomains [EXISTS]
/etc/domainusers [MISSING]
/etc/localdomains [MISSING]
/etc/remotedomains is either empty or missing [SKIPPING]
/etc/demousers is either empty or missing [SKIPPING]
/etc/email_send_limits [MISSING]
/etc/demoids is either empty or missing [SKIPPING]
/etc/demodomains is either empty or missing [SKIPPING]
/etc/ssldomains is either empty or missing [SKIPPING]
/var/cpanel/moddirdomains [MISSING]
/home/maindomain [EXISTS]
\_ etc - EXISTS
\_ mail - EXISTS
\_ public_html - EXISTS
\_ ssl - EXISTS
\_ tmp - EXISTS
/var/cpanel/userdata/maindomain [EXISTS]
sh: /bin/egrep: Argument list too long
/var/cpanel/users/maindomain [EXISTS]
\_ [WARN]: One or more DNS lines may be missing from this file!
/var/cpanel/mainips/maindomain [MISSING]
/var/cpanel/databases/grants_maindomain.yaml [EXISTS]
/var/cpanel/databases/maindomain.json [EXISTS]
/var/cpanel/databases/dbindex.db.json [EXISTS]
/etc/proftpd/maindomain [EXISTS]
/var/cpanel/bandwidth/maindomain.sqlite [EXISTS]
/var/cpanel/bwlimited/maindomain [MISSING]
/var/cpanel/bwlimited/maindomain.com [MISSING]
/etc/valiases/domain.com [MISSING]
/etc/vfilters/domain.com [MISSING]
/var/named/domain.com.db [EXISTS]
/etc/apache2/logs/domlogs/domain.maindomain.com [EXISTS]
/etc/named.conf [EXISTS]
/etc/apache2/conf/httpd.conf [EXISTS]
Cpanel::Exception::JSONParseError/(XID 9cya4z) The system failed to parse the JSON stream data “Timeout while executing: cpapi2 --output=json MysqlFE listdbs --user=maindomain
” for the caller “main::get_json_from_command” because of an error: malformed JSON string, neither tag, array, object, number, string or atom, at character offset 0 (before "Timeout while execut...") at /usr/local/cpanel/Cpanel/JSON.pm line 123.

at /usr/local/cpanel/Cpanel/JSON.pm line 139.
Cpanel::JSON::_throw_json_error("malformed JSON string, neither tag, array, object, number, st"..., undef, SCALAR(0x46dc358)) called at /usr/local/cpanel/Cpanel/JSON.pm line 123
Cpanel::JSON::Load("Timeout while executing: cpapi2 --output=json MysqlFE listdbs"...) called at /dev/fd/63 line 3419
main::get_json_from_command("cpapi2", "--output=json", "MysqlFE", "listdbs", "--user=maindomain") called at /dev/fd/63 line 3431
main::get_cpapi2("MysqlFE", "listdbs", "--user=maindomain") called at /dev/fd/63 line 1938
main::cruft_check() called at /dev/fd/63 line 184
 
Last edited:

ca2236

Well-Known Member
Feb 2, 2018
244
25
28
Nebraska
cPanel Access Level
DataCenter Provider
hello @cPanelLauren

I wanted to follow up on this. I'm getting issues with half added domains. I'm trying to add an addon domain. But the domain appears to be partially added. It is listed in DNS, but I can't remove it due it claiming there is subdomain that doesn't seem to exist. When I try to add it again in addon domains, it is claimed that it exists in userdata already (but not listed in the addon domain section)

Note: it is also not in Parked domains and the below code brings up no search results. As far as I can tell right now, it is only in DNS, which I can't delete the zone
Code:
 /usr/local/cpanel/bin/whmapi1 domainuserdata domain=domain.tld
---
metadata:
  command: domainuserdata
  reason: "API failure: (XID x2z3qc) This system does not have a domain named “domain.tld”."
  result: 0
  version: 1
 
Last edited:

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,300
363
Houston
I'd suggest doing another cruft check:

Code:
/usr/local/cpanel/3rdparty/bin/perl <(curl -s https://raw.githubusercontent.com/cPanelInc/tech-acctinfo/master/acctinfo) --cruft domain.com
And removing the references to the domain. But this is an involved process and if you'd like to open a ticket we'd be happy to help you there.
 

ca2236

Well-Known Member
Feb 2, 2018
244
25
28
Nebraska
cPanel Access Level
DataCenter Provider
I cleaned up everything to where it says missing now (previous exists).. but still is showing userdata exists. Am I correct in assuming that missing is what you want it to say on the cruft output?
 

ca2236

Well-Known Member
Feb 2, 2018
244
25
28
Nebraska
cPanel Access Level
DataCenter Provider
I'm seeing an error that might be kicking off this whole half added domain maybe.


[2020-03-24 10:20:12 -0500] info [park] Creating Addon domain 'domain.com' on 'subdomain.maindomain.com'.
[2020-03-24 10:20:15 -0500] die [park] Requested command [refresh_dkim_validity_cache domain.com] has invalid arguments. at /usr/local/cpanel/Cpanel/LoggerAdapter.pm line 32.


is there any insite on this error that can be provide?
 

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,300
363
Houston
Hi @ca2236

I will open a ticket if need. Is there any place we can look to see why it is getting half added in the first place? Or have you seen anything like this to where I can take a look at?
I'd suggest checking the cPanel error logs, it is strange to see this behavior without an underlying issue on the server.

And as I say that I see your last response:
[2020-03-24 10:20:12 -0500] info [park] Creating Addon domain 'domain.com' on 'subdomain.maindomain.com'.
[2020-03-24 10:20:15 -0500] die [park] Requested command [refresh_dkim_validity_cache domain.com] has invalid arguments. at /usr/local/cpanel/Cpanel/LoggerAdapter.pm line 32.
As far as that goes, I see it come up when failures to add a domain are present sometimes but I don't believe it's the initial cause.
 

ca2236

Well-Known Member
Feb 2, 2018
244
25
28
Nebraska
cPanel Access Level
DataCenter Provider
I think at this point, I'm looking to open a ticket. I will let you know if I do. some puzzling things going on here. sporadically domains get half added, not sure why and other times they get added just fine. I'm trying to cleanup the cruft as I understand how to, (removing entries and files related to what the domain I'm looking for, so it comes up missing instead of existing)

last issue is that from what I can tell, this domain exists under the domains tab for the account, but no where else, but I can remove it from manage domains as it says no user data exists. the cruft comes up and not finds anything (as far as I understand)
 
  • Like
Reactions: cPanelLauren