lowlydba.sqlserver icon indicating copy to clipboard operation
lowlydba.sqlserver copied to clipboard

[Bug] SPN creation is successful but the ansible task is reported as FAILED.

Open DorBreger opened this issue 1 year ago • 5 comments

Describe the bug spn is created but ansible task fails and reports changed: "false".

To Reproduce Create an availability groups where the engine is ran under a GMSA. Use

lowlydba.sqlserver.spn:
      computer: db1.domain.com
      service_account: "DOMAIN\\g9540dbs$"

The ansible task will fail, but it will create the SPN. The error message is changed: "false", msg: "Configuring SPN failed: Exception calling "CommitChanges" with "0" argument(s): "Access is denied.\r\n""

Expected behavior The ansible task to be successful.

Versions(please complete the following information):

  • OS: server 2022
  • SQL Server: 2022
  • PowerShell: 5.1.20348.2031

Additional context Add any other context about the problem here. I'm using a GMSA to run the sql server engine.

DorBreger avatar May 07 '24 10:05 DorBreger

Is it possible that SPN creation was successful on some AD object(s), but failed on other(s), like the listener computer object?

briantist avatar May 07 '24 17:05 briantist

@briantist unfortunately not, I ran this before a listener was even created.

DorBreger avatar May 10 '24 09:05 DorBreger

Can you try running with verbose output, and also include your dbatools version? If you can also try doing the creation directly with the DBATools command, that would be helpful to isolate the issue.

lowlydba avatar May 17 '24 21:05 lowlydba

I will get to it when I'm back in the office on Wednesday, I haven't been able to replicate the problem locally on my cluster of VMs.

DorBreger avatar May 18 '24 09:05 DorBreger

@DorBreger Were you able to reliably reproduce? If not, this issue can be closed I think

lowlydba avatar Oct 06 '24 16:10 lowlydba

I haven't tried, switched to using microsoft.ad.service_account. can be closed for now as far as I am concerned.

DorBreger avatar Oct 14 '24 14:10 DorBreger