Can't add a replica set member / HW-1.6

On HW-1.6, I keep having troubles to add a member to a replica set.
Here is how it goes. I hope somebody can point out what the issue is.

MongoDB Enterprise HW-1.6:PRIMARY>
MongoDB Enterprise HW-1.6:PRIMARY> rs.add(‘database.m310.mongodb.university:31161’)
{
“ok” : 0,
“errmsg” : “Quorum check failed because not enough voting nodes responded; required 2 but only the following 1 voting nodes responded: database.m310.mongodb.university:31160; the following nodes did not respond affirmatively: database.m310.mongodb.university:31161 failed with not authorized on admin to execute command { replSetHeartbeat: “HW-1.6”, pv: 1, v: 2, from: “database.m310.mongodb.university:31160”, fromId: 1, checkEmpty: false }”,
“code” : 74
}
MongoDB Enterprise HW-1.6:PRIMARY>
MongoDB Enterprise HW-1.6:PRIMARY>
MongoDB Enterprise HW-1.6:PRIMARY> rs.isMaster()
{
“hosts” : [
“database.m310.mongodb.university:31160”
],
“setName” : “HW-1.6”,
“setVersion” : 1,
“ismaster” : true,
“secondary” : false,
“primary” : “database.m310.mongodb.university:31160”,
“me” : “database.m310.mongodb.university:31160”,
“electionId” : ObjectId(“7fffffff0000000000000001”),
“maxBsonObjectSize” : 16777216,
“maxMessageSizeBytes” : 48000000,
“maxWriteBatchSize” : 1000,
“localTime” : ISODate(“2020-11-27T04:09:08.941Z”),
“maxWireVersion” : 4,
“minWireVersion” : 0,
“ok” : 1
}
MongoDB Enterprise HW-1.6:PRIMARY>
MongoDB Enterprise HW-1.6:PRIMARY>
MongoDB Enterprise HW-1.6:PRIMARY> rs.status()
{
“set” : “HW-1.6”,
“date” : ISODate(“2020-11-27T04:09:20.546Z”),
“myState” : 1,
“term” : NumberLong(1),
“heartbeatIntervalMillis” : NumberLong(2000),
“members” : [
{
“_id” : 1,
“name” : “database.m310.mongodb.university:31160”,
“health” : 1,
“state” : 1,
“stateStr” : “PRIMARY”,
“uptime” : 2054,
“optime” : {
“ts” : Timestamp(1606449893, 4),
“t” : NumberLong(1)
},
“optimeDate” : ISODate(“2020-11-27T04:04:53Z”),
“electionTime” : Timestamp(1606449825, 2),
“electionDate” : ISODate(“2020-11-27T04:03:45Z”),
“configVersion” : 1,
“self” : true
}
],
“ok” : 1
}
MongoDB Enterprise HW-1.6:PRIMARY>

For information I am authenticated as user adam. The user has been created with this command:

MongoDB Enterprise HW-1.6:PRIMARY> db.getSiblingDB("$external").runCommand({createUser: “adam”, roles: [{role: ‘root’, db:‘admin’}]})
{ “ok” : 1 }

And I authenticated with this command:

MongoDB Enterprise HW-1.6:PRIMARY> db.getSiblingDB("$external").auth({user:“adam”,pwd:“password”,mechanism:“PLAIN”})
1
MongoDB Enterprise HW-1.6:PRIMARY>

LDAP is an external authentication mechanism
You still need a keyfile for internal authentication between members
I am suspecting this could be the issue as hostname issue mentioned by Steeve seems to be taken care by you

Yes, you are right. That was the issue. This is now working.
Thanks a lot for your help.

Unfortunately I now have another problem for which I created a new thread here:

Password change not working / HW-1.6