Admin user can't create new user or domain

WebbedIT

Verified User
Joined
Jun 10, 2012
Messages
15
In the last few weeks I've transferred my server provider and imported all users from one server to another using admin backups.

Everything has gone really well except that I don't seem to be able to create new users or domains with my main admin account. If I login as an existing user, I can add extra domains to their accounts. But, if I login as admin and go to user level to add myself a new domain I get:
Code:
Error Creating Domain

Details

Could not write domain's db file in /var/named
User added to named.conf file successfully
Unable to save dns zone: named-checkzone returned:
loading "test2.com" from "/var/named/test2.com.db.temp" class "IN"
dns_rdata_fromtext: /var/named/test2.com.db.temp:18: near '.': extra input text
zone test2.com/IN: loading from master file /var/named/test2.com.db.temp failed: extra input text
zone test2.com/IN: not loaded due to errors.


Error Creating Domain

When I try to create a user I get:
Code:
User testda created

Details

Unix User created successfully

User's System Quotas set
User's data directory created successfully
Domains directory created successfully
Domains directory created successfully in user's home

Could not write domain's db file in /var/named
User added to named.conf file successfully
Unable to save dns zone: named-checkzone returned:
loading "test.com" from "/var/named/test.com.db.temp" class "IN"
dns_rdata_fromtext: /var/named/test.com.db.temp:18: near '.': extra input text
zone test.com/IN: loading from master file /var/named/test.com.db.temp failed: extra input text
zone test.com/IN: not loaded due to errors.

Any ideas?
 
Are you using bind-chroot or just bind?

What do you get from:

Code:
rpm -aq | grep -i bind
 
Thanks for your response, sorry it's taken me days to get back to you. Bank holiday weekend took it's toll.

Are you using bind-chroot or just bind?

What do you get from:

Code:
rpm -aq | grep -i bind

Here's the output from that command:
Code:
bind-utils-9.8.2-0.17.rc1.el6_4.4.x86_64
bind-libs-9.8.2-0.17.rc1.el6_4.4.x86_64
bind-9.8.2-0.17.rc1.el6_4.4.x86_64

I read various threads regarding chroot and I don't think that is the problem as I can find no reference of chroot on the server.

About to open a support query with DirectAdmin.
 
Have you made any changes to the templates in /usr/local/directadmin/data/templates or data/templates/custom ?

Is test2.com the domain you are attempting to add or another domain that already existed?

My guess is some of your dns templates are messed up.
 
AFAIK it's a completely default install of DirectAdmin. I've certainly not edited anything and can't see why my server host will have done so either as they simply bought a DA license, installed it and handed it over to me to begin importing sites.

Just tried to create a new user with one of my reseller accounts and that failed too, so sounds plausible that there is a problem with the templates in some way.

How can I tell if they have been changed/if there's a problem and how would I resolve them?
 
Install an ssh client and check those folders I told you. The files would start with dns_. I dont see any other reason why just adding a domain would do that.

Can you see if /var/named/test.com.db.temp or /var/named/test.com.db exists and what data is in the file and post it here.
 
Hello,

To get more info on the syntax issue, shut off the zone checker.
Add this to your /usr/local/directadmin/conf/directadmin.conf:
Code:
named_checkzone=0
then do the restore again.
It will then have the code in the zone so we can see what's wrong with it.

The domain.com.db.temp is a temp file for this check, and is deleted right away, if the test fails, hence the need to shut off the check if we want to get more info on the actual data.

Related:
http://www.directadmin.com/features.php?id=1167

John
 
I've added named_checkzone=0 to the end of the conf file then restarted httpd and directadmin.

I can't restore any files as the server data is now 3 weeks in advance of the restore files.

I've tried creating a new user and get the same errors, but there is no domain.com.db.temp file being created in /var/named

@chatwizard: timestamps on dns_ templates are all pre 2013 and there are no files in /custom folder.
 
With named_checkzone=0 set, there won't be a domain.com.db.temp file.
The check is skipped, so the data is saved directly to the final zone file location:
/var/named/domain.com.db

You should be able to get past that error now, so the User can be restored ...
Then we'd just have to see what the issue is with the zone files (eg: on line 18)

John
 
Do this in ssh:

Code:
cd /usr/local/directadmin/data/templates
for i in dns_*; do echo $i;echo "------"; cat $i; echo; done

Copy the output back here.
 
Output:
Code:
dns_aaaa.conf
------
localhost=::1
|*if IS_IPV6="yes"|
|DOMAIN|.=|IP|
mail=|IP|
pop=|IP|
www=|IP|
ftp=|IP|
smtp=|IP|
|*endif|

dns_a.conf
------
localhost=127.0.0.1
|*if IS_IPV6!="yes"|
|DOMAIN|.=|IP|
mail=|IP|
pop=|IP|
www=|IP|
ftp=|IP|
smtp=|IP|
|*endif|

dns_cname.conf
------

dns_mx.conf
------
mail=10

dns_ns.conf
------
|NS1|=|DOMAIN|.
|NS2|=|DOMAIN|.

dns_srv.conf
------

dns_txt.conf
------
|DOMAIN|.="v=spf1 a mx ip4:|SERVER_IP| ~all"
 
Issue found/fix.

The initial catayst was a current bug where the ns2 value is not correctly sanitized in the Admin Settings.
The bug is that the ns1 was actually checked twice, and ns2 not at all (copy paste coding = bad).

This allowed the ns2 to have an extra space at the end, and DA saved it, and also set it in the ns2 value at Reseller Level -> Nameservers.
So when a User was created, it used:
Code:
domain.com.  NS  ns2.domain.com .
which explains the error.

Once the space was removed, the issue went away.

I've fixed the bug in the code to prevent it in the future (for the next release of DA)

Case closed.

John
 
Problem happening with resellers

Issue found/fix.

The initial catayst was a current bug where the ns2 value is not correctly sanitized in the Admin Settings.
The bug is that the ns1 was actually checked twice, and ns2 not at all (copy paste coding = bad).

This allowed the ns2 to have an extra space at the end, and DA saved it, and also set it in the ns2 value at Reseller Level -> Nameservers.
So when a User was created, it used:
Code:
domain.com.  NS  ns2.domain.com .
which explains the error.

Once the space was removed, the issue went away.

I've fixed the bug in the code to prevent it in the future (for the next release of DA)

Case closed.

John

Hi, I am assuming that whatever you changed only took affect on one of my resellers. I have just tried to create a domain pointer for a user under another reseller and I'm getting the same errors as in my original post.

If I look at the source code of the http://xxx.xxx.xxx.xxx:2222/CMD_SHOW_RESELLER?user=resellername I can see an extra space at the end of the second nameserver value. Where can I alter this value?

Thanks, Paul.
 
Last edited:
I found this myself, wasn't that hard to do so once I opened my eyes :)

Resolved the problem.
 
Back
Top