Skip to content

Commit 7dede60

Browse files
authored
chore(NODE-1515): add more logging for check-network.sh (#2302)
<img width="1688" alt="image" src="https://github.com/user-attachments/assets/202f660b-daf2-44fa-aae2-3c0fe36a5f61">
1 parent e7b16ea commit 7dede60

File tree

2 files changed

+22
-8
lines changed

2 files changed

+22
-8
lines changed

ic-os/components/setupos-scripts/check-network.sh

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,32 @@ function eval_command_with_retries() {
3333
local error_message="${2}"
3434
local result=""
3535
local attempt_count=0
36+
local exit_code=1
3637

37-
while [ -z "${result}" ] && [ ${attempt_count} -lt 3 ]; do
38+
while [ ${exit_code} -ne 0 ] && [ ${attempt_count} -lt 3 ]; do
3839
result=$(eval "${command}")
40+
exit_code=$?
3941
((attempt_count++))
4042

41-
if [ -z "${result}" ] && [ ${attempt_count} -lt 3 ]; then
43+
if [ ${exit_code} -ne 0 ] && [ ${attempt_count} -lt 3 ]; then
4244
sleep 1
4345
fi
4446
done
4547

46-
if [ -z "${result}" ]; then
47-
log_and_halt_installation_on_error "1" "${error_message}"
48+
if [ ${exit_code} -ne 0 ]; then
49+
local ip6_output=$(ip -6 addr show)
50+
local ip6_route_output=$(ip -6 route show)
51+
local dns_servers=$(grep 'nameserver' /etc/resolv.conf)
52+
53+
log_and_halt_installation_on_error "${exit_code}" "${error_message}
54+
Output of 'ip -6 addr show':
55+
${ip6_output}
56+
57+
Output of 'ip -6 route show':
58+
${ip6_route_output}
59+
60+
Configured DNS servers:
61+
${dns_servers}"
4862
fi
4963

5064
echo "${result}"

ic-os/components/setupos-scripts/functions.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ function log_and_halt_installation_on_error() {
1616
echo "--------------------------------------------------------------------------------"
1717
echo " INTERNET COMPUTER - SETUP - FAILED"
1818
echo "--------------------------------------------------------------------------------"
19-
echo -e "\n\n\n\n"
19+
echo -e "\n\n"
2020
echo " Please consult the wiki guide: Troubleshooting Node Deployment Errors."
21-
echo -e "\n\n\n\n"
21+
echo -e "\n\n"
2222
echo "--------------------------------------------------------------------------------"
2323
echo " ERROR"
2424
echo "--------------------------------------------------------------------------------"
25-
echo -e "\n\n"
25+
echo -e "\n"
2626
echo -e "${log_message}"
27-
echo -e "\n\n"
27+
echo -e "\n"
2828
echo "--------------------------------------------------------------------------------"
2929
echo " ERROR"
3030
echo "--------------------------------------------------------------------------------"

0 commit comments

Comments
 (0)