Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add error handling for failed external domain addition #76

Merged
merged 3 commits into from
Aug 2, 2024

Conversation

stephdl
Copy link
Contributor

@stephdl stephdl commented Aug 1, 2024

This pull request adds error handling for failed external domain addition. If the external domain cannot be added, the cluster will be left using the /usr/sbin/ns8-leave command.

NethServer/dev#6985

when the error comes

image

what you find in logs

=========== Join cluster Fri, 02 Aug 2024 10:17:47 +0200
=========== Leave cluster Fri, 02 Aug 2024 10:17:56 +0200
{"steps":2,"pid":23770,"args":"","event":"nethserver-ns8-migration-save"}
{"step":1,"pid":23770,"action":"S05generic_template_expand","event":"nethserver-ns8-migration-save","state":"running"}
{"progress":"0.50","time":"0.05514","exit":0,"event":"nethserver-ns8-migration-save","state":"done","step":1,"pid":23770,"action":"S05generic_template_expand"}
{"step":2,"pid":23770,"action":"S90adjust-services","event":"nethserver-ns8-migration-save","state":"running"}
{"progress":"1.00","time":"0.1998","exit":0,"event":"nethserver-ns8-migration-save","state":"done","step":2,"pid":23770,"action":"S90adjust-services"}
{"pid":23770,"status":"success","event":"nethserver-ns8-migration-save"}
cluster/task/1e150f5c-6a12-4f40-a3eb-a6d061362a45
removed ‘/var/lib/nethserver/nethserver-ns8-migration/agent.env’
removed ‘/var/lib/nethserver/nethserver-ns8-migration/environment’
{"steps":2,"pid":24481,"args":"","event":"nethserver-ns8-migration-save"}
{"step":1,"pid":24481,"action":"S05generic_template_expand","event":"nethserver-ns8-migration-save","state":"running"}
{"progress":"0.50","time":"0.056436","exit":0,"event":"nethserver-ns8-migration-save","state":"done","step":1,"pid":24481,"action":"S05generic_template_expand"}
{"step":2,"pid":24481,"action":"S90adjust-services","event":"nethserver-ns8-migration-save","state":"running"}
{"progress":"1.00","time":"0.216974","exit":0,"event":"nethserver-ns8-migration-save","state":"done","step":2,"pid":24481,"action":"S90adjust-services"}
{"pid":24481,"status":"success","event":"nethserver-ns8-migration-save"}
Task add_external_domain has failed: {'code': 200, 'data': {'error': '<3>LDAPSocketOpenError: socket connection error while opening: [Errno 111] Connection refused\n', 'exit_code': 3, 'file': 'task/cluster/646a9993-fbb0-4a9b-b384-a5969c1dc8d4', 'output': [{'error': 'port_connection_error', 'field': 'port', 'parameter': 'port', 'value': 636}]}, 'message': 'success'}

if you cp and paste the command from UI

[root@NS2 ~]#  echo '{"action":"login","Host":"rocky9-pve.org","User":"admin","Password":"Nethesis,1234","TLSVerify":"disabled"}' | /usr/bin/setsid /usr/bin/sudo /usr/libexec/nethserver/api/nethserver-ns8-migration/connection/update | jq
{
  "steps": -1,
  "id": "1717508984",
  "type": "CommandFailed",
  "message": "{\"steps\":2,\"pid\":30951,\"args\":\"\",\"event\":\"nethserver-ns8-migration-save\"}\n{\"step\":1,\"pid\":30951,\"action\":\"S05generic_template_expand\",\"event\":\"nethserver-ns8-migration-save\",\"state\":\"running\"}\n{\"progress\":\"0.50\",\"time\":\"0.053631\",\"exit\":0,\"event\":\"nethserver-ns8-migration-save\",\"state\":\"done\",\"step\":1,\"pid\":30951,\"action\":\"S05generic_template_expand\"}\n{\"step\":2,\"pid\":30951,\"action\":\"S90adjust-services\",\"event\":\"nethserver-ns8-migration-save\",\"state\":\"running\"}\n{\"progress\":\"1.00\",\"time\":\"0.173759\",\"exit\":0,\"event\":\"nethserver-ns8-migration-save\",\"state\":\"done\",\"step\":2,\"pid\":30951,\"action\":\"S90adjust-services\"}\n{\"pid\":30951,\"status\":\"success\",\"event\":\"nethserver-ns8-migration-save\"}\ncluster/task/32035cfa-6b15-4529-b30c-308f53380113\nremoved ‘/var/lib/nethserver/nethserver-ns8-migration/agent.env’\nremoved ‘/var/lib/nethserver/nethserver-ns8-migration/environment’\n{\"steps\":2,\"pid\":31663,\"args\":\"\",\"event\":\"nethserver-ns8-migration-save\"}\n{\"step\":1,\"pid\":31663,\"action\":\"S05generic_template_expand\",\"event\":\"nethserver-ns8-migration-save\",\"state\":\"running\"}\n{\"progress\":\"0.50\",\"time\":\"0.05408\",\"exit\":0,\"event\":\"nethserver-ns8-migration-save\",\"state\":\"done\",\"step\":1,\"pid\":31663,\"action\":\"S05generic_template_expand\"}\n{\"step\":2,\"pid\":31663,\"action\":\"S90adjust-services\",\"event\":\"nethserver-ns8-migration-save\",\"state\":\"running\"}\n{\"progress\":\"1.00\",\"time\":\"0.208003\",\"exit\":0,\"event\":\"nethserver-ns8-migration-save\",\"state\":\"done\",\"step\":2,\"pid\":31663,\"action\":\"S90adjust-services\"}\n{\"pid\":31663,\"status\":\"success\",\"event\":\"nethserver-ns8-migration-save\"}\nTask add_external_domain has failed: {'code': 200, 'data': {'error': '<3>LDAPSocketOpenError: socket connection error while opening: [Errno 111] Connection refused\\n', 'exit_code': 3, 'file': 'task/cluster/14c6e3e1-2348-4455-af0d-a0b90769e113', 'output': [{'error': 'port_connection_error', 'field': 'port', 'parameter': 'port', 'value': 636}]}, 'message': 'success'}\n=========== Leave cluster Thu, 01 Aug 2024 15:50:11 +0200"
}

@stephdl stephdl self-assigned this Aug 1, 2024
@nethbot
Copy link
Member

nethbot commented Aug 1, 2024

in 7.9.2009/autobuild:

  • nethserver-ns8-migration-1.0.14-1.1.pr76.gf006445.ns7.x86_64.rpm x86_64

@nethbot
Copy link
Member

nethbot commented Aug 1, 2024

in 7.9.2009/autobuild:

  • nethserver-ns8-migration-1.0.14-1.1.pr76.g9f6f14e.ns7.x86_64.rpm x86_64

@nethbot
Copy link
Member

nethbot commented Aug 1, 2024

in 7.9.2009/autobuild:

  • nethserver-ns8-migration-1.0.14-1.1.pr76.g75f5e90.ns7.x86_64.rpm x86_64

root/usr/sbin/ns8-join Outdated Show resolved Hide resolved
root/usr/sbin/ns8-join Outdated Show resolved Hide resolved
root/usr/sbin/ns8-join Outdated Show resolved Hide resolved
@NethServer NethServer deleted a comment from nethbot Aug 2, 2024
@NethServer NethServer deleted a comment from nethbot Aug 2, 2024
@nethbot
Copy link
Member

nethbot commented Aug 2, 2024

in 7.9.2009/autobuild:

  • nethserver-ns8-migration-1.0.14-1.3.pr76.g99969de.ns7.x86_64.rpm x86_64

@stephdl stephdl merged commit 6d81f38 into master Aug 2, 2024
1 check passed
@stephdl stephdl deleted the handleLostSlapd branch August 2, 2024 09:17
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.

3 participants