Bug with failed admin restore on shared IP

erostew

Verified User
Joined
Apr 16, 2006
Messages
24
Location
Montreal, Canada
Ok I'm using admin backup/restore to transfer stuff from an older server to a newer one and I have run into trouble with failed/partial restores on the new server due to corrupt tarballs.

The backup files are pretty large. Up to 13.6 gb so far. Obviously that won't work with backup to ftp or restore from ftp. So I do the backup on the old server and use ssh to ftp the file to the new server and then restore it from there.

A couple of times now the tarball has been corrupt (crc failed) so the reseller is only partially restored. In one case the reseller was there and some of the domain's files had been restored before it failed. In another the reseller was there but no domains were restored. In both cases if you clicked "show all users" the reseller was not listed. But if you clicked the "list resellers" link they were. So I used the "list resellers" page to delete the user and rebooted the server. After that I deleted the backups, redid the backup, re-ftped, and re-restored. Everything was okay.

The 3rd time it happened the reseller that failed was on a shared IP. One other reseller on that IP with one domain. When I deleted the failed user and rebooted I checked the IP Management page. It now shows 0 users on that IP. It's listed as free. I tried going into the resellers IP Management and sharing it. But it didn't fix it in the admin level IP management. Still zero users but now the IP shows as shared instead of free.

If you go to the "Show all Users" page the reseller is there and the correct IP is shown. If you use the direct IP address in the browser it goes to the domain because there is currently only 1 domain. So it seems this little bug doesn't affect the actual operation of the server. Just the IP management page. It does have me a little worried what will happen if I restore the failed reseller again to that IP, or add a user/reseller with that IP assigned.

If anyone can tell me what to fix so that IP Management is working correctly again, I would appreciate it.

Here's the logged error from the restore in question in case it helps anything:
Code:
2008:09:24-16:15:54: Unable to extract user.conf, reseller.conf or ip.list from /home/admin/new_backups/reseller.admin.FAILEDRESELLER.tar.gz : Error while extracting backup/user.conf backup/reseller.conf backup/ip.list to /home/admin/new_backups/FAILEDRESELLER as admin : 
gzip: stdin: invalid compressed data--crc error
/bin/tar: Child returned status 1
/bin/tar: Error exit delayed from previous errors
<br>

2008:09:24-16:19:56: User::getRCF
2008:09:24-16:19:56: Unable to read ./data/users/FAILEDRESELLER/crontab.conf for user: FAILEDRESELLER
2008:09:24-16:19:57: *** Unable to read admin reseller files *** : ./data/users/admin/user.usage : Can't get a lock on ./data/users/admin/user.usage<br>
<br>
./data/users/admin/domains.list : Can't get a lock on ./data/users/admin/domains.list<br>
<br>
./data/users/admin/user.conf : Can't get a lock on ./data/users/admin/user.conf<br>
<br>
Can't get a lock on ./data/users/admin/reseller.usage<br>
<br>
Can't get a lock on ./data/users/admin/users.list<br>
<br>
Can't get a lock on ./data/users/admin/reseller.conf<br>
<br>
Can't get a lock on ./data/users/admin/reseller.allocation<br>
<br>

2008:09:24-16:19:57: Can't get lock on ./data/admin/next_ticket.number
2008:09:24-16:19:57: Couldn't get a ticket number for the system message
2008:09:24-16:19:57: Unable to open ./data/admin/services.status
2008:09:24-16:19:57: Tally::dumpShowAllUsersCache: error getting users : Unable to stat: ./data/users<br>

2008:09:24-16:19:57: Unable to read ./data/admin/login.hist: Can't get a lock on ./data/admin/login.hist<br>
 
Yeah it's definitely a bug. It just happened again. Same account trying to restore to a different IP with 2 resellers already on it. Corrupt archive again and the restore failed part way through. Deleted the reseller and checked the IP Management page. The IP has zero ( 0 ) users on it and is listed as free. Reboot, same thing. Assign it to admin (which it originally was before sharing) succeeded. Now it shows admin as user and status is still free. Went to reseller level of admin account and shared it with IP Management. Returned to admin level and checked: It shows shared instead of free but still zero users and admin not shown as user. Strangely If I tried to assign the IP to one of the resellers that are actually on it, it fails and throws an error. Probably because they actually ARE assigned that IP.

I believe my problem with corrupt archives could be a problem with memory on the old server, because I tried d/ling the archive from the old server by ftp and http and both failed. Wrong size was given and only 1.2GB was d/led by http. So it's corrupt on the originating server. I'll have to get a tech to check it out.

But I'm starting to get a bit p'ed off at this IP management bug. It seems to only affect the main admin account IP management page. Resellers that are supposed to be on that IP have it listed everywhere else, including in their reseller level IP management. But it's pretty hard to Manage IPs from the admin like it is.

I would REALLY appreciate any help to get this fixed. Originating server is Centos 4.4 with DA 1.32.2 and new server is Centos 5 with DA 1.32.3 if that helps.
 
Hello,

Can you clarify this statement?
Same account trying to restore to a different IP with 2 resellers already on it
The only IP that can have multiple Reseller is the server IP address. The "other" IPs can be set to be shared for many Users, but are only designed for 1 Reseller per IP.

Thus when you delete the reseller from the IP, DA assumes he was the only Reseller on it (as he should have been the only one on it), thus it goes to free/0.

People often do manually setup multiple Reseller on IPs that are not the server IP, but quirks like that will happen since it's not what DA is expecting.

Let me know if I'm missing something.

John
 
Hello,

Can you clarify this statement?
The only IP that can have multiple Reseller is the server IP address. The "other" IPs can be set to be shared for many Users, but are only designed for 1 Reseller per IP.

Thus when you delete the reseller from the IP, DA assumes he was the only Reseller on it (as he should have been the only one on it), thus it goes to free/0.

People often do manually setup multiple Reseller on IPs that are not the server IP, but quirks like that will happen since it's not what DA is expecting.

Let me know if I'm missing something.

John

That's exactly what I mean. More than one reseller on the same IP. I don't have any users at all. Only Admin and resellers. I use reseller accounts because that's the only way I could find to give any domain it's own IP. If I don't care about having an exclusive IP, I just have more than one domain per reseller. I don't run a hosting company. Only servers for our own domains, so user level accounts are not necessary.

Right now I am consolidating 3 old servers to 1 new server and I have more resellers than IP addresses available. In cases where it doesn't matter if there is a particular IP I first assign the IP address to admin and then shared it. After that when I use the backup/restore any shared IP including the server IP is available to assign. After restoring the first reseller to that IP it still shows shared in the IP management and in the backup/restore. I did nothing manually.

If you are saying that there isn't supposed to be more than one reseller on any IP except the server IP then obviously you have a bug in your backup/restore script. If it isn't supposed to be done then the option shouldn't be there, should it? If IPs aren't supposed to be shared, why is there an option to share them in the first place?

In the meantime, since the domains are in production and it's too late to delete domains and get an exclusive IP for every reseller and then add them back, do you have any suggestions on how I can get the IP Management working correctly again?

I suppose it's mainly a cosmetic thing. All domains and resellers work as they should, and reseller level IP management shows the relevant info. But it IS irritating. If somebodu is tinkering with things manually then, okay, it's a quirk. When somebody uses your software as written and there are unexpected results it's a bug.
 
Hello,

I'll have to check to see why the IPs were showing up in the list (I'll try and duplicate it here)

For fixing the IP Manager, you can edit the files:
/usr/local/directadmin/data/admin/ips/*
and set them to the values you need.

Sample server IP:
Code:
gateway=
netmask=255.255.255.0
ns=
reseller=
status=server
value=7
The status can be server, free, shared, or owned.
The "value" can be a number if shared, or the name of a user if owned, or blank for free. Reseller is the name of the reseller that manages that IP. ns is just cosmetic, add the ns1.domain.com if you want.

John
 
Thanks for the instructions. I just want the list to reflect reality even if it isn't a DA approved config ;)

Re sharing IPs: If I remember correctly before adding a second reseller to the ip that I shared from admin, I went into the IP management of the first reseller and set the IP to shared from there. Not sure if that was a necessary step or not. At any rate it should be fairly easy to reproduce.
 
Last edited:
In case it helps, here is a screenshot of my IP Management for Admin on Admin level.
.98 is the server IP and is used only by admin with 2 domains - shows 2 users.
.99 and .100 are each assigned to a reseller with 3 or 4 domains - nothing in reseller column and reseller name in users column.
.101 is the first IP I used when I had a fialed restore and deleted the failed reseller. It already had 1 reseller. Shows shared, no reseller, 0 users. Reality is that there is one reseller with 1 domain.
.102 currently has 1 reseller with 3 domains - shows shared, admin, 3 users.
.103 has 3 resellers, each with 1 domain - shows shared, admin, 3 users.
.104 is the second IP where I had a failed restore and deleted the failed reseller. It shows shared, admin, 0 users. Reality is that there are 2 resellers each with 1 domain.
.105 has 1 reseller with 1 domain that I restored just today. It shows shared, admin, 1 user.

From the admin Backup/Restore I have .98 and .101 to .105 available in the select box. I did not share .105 from the reseller's admin. Just the original assign to admin and then share from reseller level IP Management of admin that I did a few days ago.

Personally I think that the ability to have more than 1 server IP to share among resellers is desirable. You might want to support that as a feature instead of trying to fix the backup/restore so it doesn't allow it. As far as the IP management/reseller deletion goes: Assuming only 1 reseller per IP is kind of lazy programming. Instead of assuming it should be written properly to actually perform a check.

EDIT:
Forgot to add this. If you edit the reseller ( http://xxx.xxx.xxx.98:xxxx/CMD_MODIFY_USER?user=username) Those same IPs are available to assign to any current reseller.
 

Attachments

  • Capture.jpg
    Capture.jpg
    44.9 KB · Views: 159
Last edited:
Back
Top