SOLVED Error " 'str' object has no attribute 'name' " when trying to link TrueNas Core with an Active Directory

Abiqueen

Dabbler
Joined
Nov 6, 2023
Messages
12
Hello everyone. I’m using TrueNAS-13.0-U5.3 in VMWare Exsi, with 4GB of RAM and 2 storage disks of 20GB each. I have already linked this TrueNas to an Active Directory No.1, just by filling in the necessary information in the “Active Directory” tab located in “Directory Services”, and by putting the IP address of the domain controller of this Active Directory among the DNS addresses of TrueNas in the network configuration. I disconnected TrueNas from this directory, and I wanted to link it to another Active Directory No.2. But by following the same steps that worked previously, I get the error:

‘str’ object has no attribute ‘name’
Error: Traceback (most recent call last): File “/usr/local/lib/python3.9/site-packages/middlewared/job.py”, line 367, in run await self.future
File “/usr/local/lib/python3.9/site-packages/middlewared/job.py”, line 403, in __run_body rv = await self.method(*([self] + args))
File “/usr/local/lib/python3.9/site-packages/middlewared/plugins/activedirectory.py”, line 691, in start await self._net_ads_join()
File “/usr/local/lib/python3.9/site-packages/middlewared/plugins/activedirectory.py”, line 1037, in _net_ads_join await self.set_state(DSStatus[‘FAULTED’].name)
File “/usr/local/lib/python3.9/site-packages/middlewared/plugins/activedirectory.py”, line 588, in set_state return await self.middleware.call(‘directoryservices.set_state’, {‘activedirectory’: state.name})
AttributeError: ‘str’ object has no attribute ‘name’

So I canceled the operation and tried again with Active Directory No.1, everything went well as the first time. So I attempted again with Active Directory No.2, always following exactly the same steps, but I still get this error. Thank you for helping me understand what is not working.
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
Hello everyone. I’m using TrueNAS-13.0-U5.3 in VMWare Exsi, with 4GB of RAM and 2 storage disks of 20GB each. I have already linked this TrueNas to an Active Directory No.1, just by filling in the necessary information in the “Active Directory” tab located in “Directory Services”, and by putting the IP address of the domain controller of this Active Directory among the DNS addresses of TrueNas in the network configuration. I disconnected TrueNas from this directory, and I wanted to link it to another Active Directory No.2. But by following the same steps that worked previously, I get the error:

‘str’ object has no attribute ‘name’
Error: Traceback (most recent call last): File “/usr/local/lib/python3.9/site-packages/middlewared/job.py”, line 367, in run await self.future
File “/usr/local/lib/python3.9/site-packages/middlewared/job.py”, line 403, in __run_body rv = await self.method(*([self] + args))
File “/usr/local/lib/python3.9/site-packages/middlewared/plugins/activedirectory.py”, line 691, in start await self._net_ads_join()
File “/usr/local/lib/python3.9/site-packages/middlewared/plugins/activedirectory.py”, line 1037, in _net_ads_join await self.set_state(DSStatus[‘FAULTED’].name)
File “/usr/local/lib/python3.9/site-packages/middlewared/plugins/activedirectory.py”, line 588, in set_state return await self.middleware.call(‘directoryservices.set_state’, {‘activedirectory’: state.name})
AttributeError: ‘str’ object has no attribute ‘name’

So I canceled the operation and tried again with Active Directory No.1, everything went well as the first time. So I attempted again with Active Directory No.2, always following exactly the same steps, but I still get this error. Thank you for helping me understand what is not working.
Looks like a bug in failure path for joining AD. Looks like it should be fixed in U6. Note hat this won't fix your problems with joining AD (your user account for joining AD for instance may have insufficient rights), but you should get a more useful error message.
 

Abiqueen

Dabbler
Joined
Nov 6, 2023
Messages
12
Looks like a bug in failure path for joining AD. Looks like it should be fixed in U6. Note hat this won't fix your problems with joining AD (your user account for joining AD for instance may have insufficient rights), but you should get a more useful error message.
Okay thank you. I'm a novice so what should I do precisely ?
 

Abiqueen

Dabbler
Joined
Nov 6, 2023
Messages
12
Looks like a bug in failure path for joining AD. Looks like it should be fixed in U6. Note hat this won't fix your problems with joining AD (your user account for joining AD for instance may have insufficient rights), but you should get a more useful error message.
Hie. I switched to version U6 today, and I tried connecting to the AD server again. But I got the same error. What should I do please?
 

Abiqueen

Dabbler
Joined
Nov 6, 2023
Messages
12
The same error? That traceback isn't possible in U6. Please verify your update was successful.
Hello again. I have updated my TrueNAS, manually installed version U6. But now when I want to connect it to the AD server, the following error appears below the domain name field:

" Time offset from Active Directory domain exceeds maximum permitted value. This may indicate an NTP misconfiguration. "

I checked, and the time on my TrueNAS and the AD server are the same. I also tried to reconnect with the AD server #1 which worked before the update, but I get this same error.
So I don’t understand why this error is happening this time.
 
Last edited:

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
Hello again. I have updated my TrueNAS, manually installed version U6. But now when I want to connect it to the AD server, the following error appears below the domain name field:

" Time offset from Active Directory domain exceeds maximum permitted value. This may indicate an NTP misconfiguration. "

I checked, and the time on my TrueNAS and the AD server are the same. So I don’t understand why this error is happening this time.
Perhaps you have set your bios clock to local TZ rather than UTC. If clocks are off by too large of a margin you can't join AD.
 

Abiqueen

Dabbler
Joined
Nov 6, 2023
Messages
12
Perhaps you have set your bios clock to local TZ rather than UTC. If clocks are off by too large of a margin you can't join AD.
Before doing the update, I had saved the configuration of my TrueNAS, in order to be able to put it back in place. So I restored this configuration after the update. The connection to AD server #1 had already succeeded with this configuration, so it should also succeed now since I have reinstated the same configuration. In addition to that, I checked the time on the AD and on my TrueNAS, and they are the same.
 

Abiqueen

Dabbler
Joined
Nov 6, 2023
Messages
12
Hi. Finally, I was able to link Truenas to AD server #1. Apparently, this error was a temporary bug, because I just tried again to link them today, and it worked. I will now try again with the problematic AD server #2. I will get back to you if I get an error message (which I hope will be different from the one I mentioned in my first message). Thank you.
 

Abiqueen

Dabbler
Joined
Nov 6, 2023
Messages
12
Perhaps you have set your bios clock to local TZ rather than UTC. If clocks are off by too large of a margin you can't join AD.
This time I restarted TrueNas before making the connection, to avoid a bug. But despite everything, I still get this NTP error. Attached are some screenshots showing that the time is the same on TrueNas and on the AD server, and the two communicate well with a ping.

TrueNas&AD.jpg


ping_truenas.jpg


Link.jpg
 

Abiqueen

Dabbler
Joined
Nov 6, 2023
Messages
12
Perhaps you have set your bios clock to local TZ rather than UTC. If clocks are off by too large of a margin you can't join AD.
Hello. To try to solve my problem, I added the AD server #2 as an NTP server in my Truenas. I checked the ‘prefer’ checkbox, and the AD server there is the only NTP server with this checkbox checked. I then tried to link them again, but unfortunately, I still get the same error. I need help please.
 

Abiqueen

Dabbler
Joined
Nov 6, 2023
Messages
12
(^_^) I finally solve the problem. I first had to check the synchronization between truenas and the NTP server by typing in the shell of my truenas :
ntpdate -q <AD server IP adress>

I got as response :
server 192.168..., stratum 1, offset +283.606575, delay 0.02625 11 Dec 15:27:43 ntpdate[1927]: step time server 192.168... offset +283.606575 sec

Which means that the offset was +283 sec. I then forced the synchronization by typing :
ntpdate -u <adresse_IP_serveur_AD>

Then I checked again with : ntpdate -q <adresse_IP_serveur_AD> , and this time the offset was +0.000008 sec.
So I tried to link again and it worked. Thank you.
 
Top