Skip to content

Conversation

@SystemKeeper
Copy link
Contributor

It seems that starting and directly restarting samba-ad-dc causes a race condition where the port 389 is not yet freed, although we attempt to allocate it already:

[2025/04/30 22:59:14.795512,  0] source4/samba/server.c:633(binary_smbd_main)
  samba version 4.19.5-Ubuntu started.
  Copyright Andrew Tridgell and the Samba Team 1992-2023
[2025/04/30 22:59:14.924563,  0] source4/lib/tls/tlscert.c:67(tls_cert_generate)
  Attempting to autogenerate TLS self-signed keys for https for hostname 'KRB.domain.test'
[2025/04/30 22:59:15.878287,  0] source4/samba/server.c:633(binary_smbd_main)
  samba version 4.19.5-Ubuntu started.
  Copyright Andrew Tridgell and the Samba Team 1992-2023
[2025/04/30 22:59:15.974428,  0] source4/lib/tls/tlscert.c:154(tls_cert_generate)
  TLS self-signed keys generated OK
[2025/04/30 22:59:16.509633,  0] source4/samba/service_stream.c:371(stream_setup_socket)
  stream_setup_socket: Failed to listen on :::389 - NT_STATUS_ADDRESS_ALREADY_ASSOCIATED
[2025/04/30 22:59:16.509747,  0] source4/ldap_server/ldap_server.c:[118](https://github.com/nextcloud/server/actions/runs/14765943837/job/41457286732#step:6:119)8(add_socket)
  add_socket: ldapsrv failed to bind to :::389 - NT_STATUS_ADDRESS_ALREADY_ASSOCIATED
[2025/04/30 22:59:16.509814,  0] source4/samba/service_stream.c:371(stream_setup_socket)
  stream_setup_socket: Failed to listen on 0.0.0.0:389 - NT_STATUS_ADDRESS_ALREADY_ASSOCIATED
[2025/04/30 22:59:16.509907,  0] source4/ldap_server/ldap_server.c:1188(add_socket)
  add_socket: ldapsrv failed to bind to 0.0.0.0:389 - NT_STATUS_ADDRESS_ALREADY_ASSOCIATED
[2025/04/30 22:59:16.509956,  0] source4/samba/service_task.c:36(task_server_terminate)
  task_server_terminate: task_server_terminate: [Failed to startup ldap server task]
[2025/04/30 22:59:16.514517,  0] source4/samba/server.c:403(samba_terminate)
  samba_terminate: samba_terminate of samba 138: Failed to startup ldap server task

Debug run: https://github.com/nextcloud/server/actions/runs/14765943837/job/41457286732#step:6:124

I don't see a reason to do a direct restart here? Was there a reason?

@icewind1991
Copy link
Owner

I don't see a reason to do a direct restart here? Was there a reason?

Can't remember if it was intentional.

@icewind1991 icewind1991 merged commit a537a65 into icewind1991:main May 2, 2025
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants