[Samba] samba-tool computer delete does not work

Rowland Penny rpenny at samba.org
Fri Nov 22 09:32:36 UTC 2024


On Thu, 21 Nov 2024 09:40:29 +1300
Douglas Bagnall via samba <samba at lists.samba.org> wrote:

> On 21/11/24 04:17, Rowland Penny via samba wrote:
> 
> > After reading the code again and thinking about this (yes I know,
> > thinking is dangerous), I think this is what is happening:
> > 
> > The samba tool command is run and everything works okay until it
> > gets to the 'try', the first thing that the 'try' does is to delete
> > the computers entire DN, it then attempts to delete all the
> > computers dns records, if this or deleting the computers DN fails,
> > then, from my understanding, the 'try' should fail and the
> > computers DN deletion should not happen and an error message
> > 'Failed to remove computer "%s"' should be printed.
> 
> Try blocks don't work like that in python -- they are not
> transactions, just a kind of goto-on-error. So the deletion of the
> original object is never going to be rolled back, control-C or not.
> 
> We *could* make it a transaction, by sprinkling 
> `samdb.transaction_start()`, `samdb.transaction_commit()`, 
> `samdb.transaction_cancel()` around in the right places (which could
> let control-C cancel the whole thing, but ).
> 
> In any case, DNS still looks like the problem.
> 
> Douglas
> 
> 

Hi Douglas,

Yes, now I stop and really think about it, using 'try' requires
transactions to back out, so I got that wrong :-(

I am getting more and more convinced that all the OPs problems are
being caused by his DNS setup, it sounds like every Linux client is
running Bind9 as a slave. They have also stated that at least two
attributes are not getting populated, so could there be more?

I have asked for more information about their network on another
thread, lets see what turns up.

Rowland



More information about the samba mailing list