github-actions[bot] commented on PR #14436:
URL: https://github.com/apache/doris/pull/14436#issuecomment-1321509977
#### `sh-checker report`
To get the full details, please check in the
[job]("https://github.com/apache/doris/actions/runs/3511929415") output.
<details>
<summary>shellcheck errors</summary>
```
'shellcheck ' returned error 1 finding the following syntactical issues:
----------
In docker/runtime/be/Dockerfile line 27:
ADD ./resource/apache-doris-be-"${x.x.x}"-bin-x86_64.tar.gz /opt/
^------^ SC2154 (warning): x is referenced
but not assigned.
In docker/runtime/be/resource/run_be.sh line 55:
feServerArray=(${FE_SERVERS})
^-----------^ SC2206 (warning): Quote to prevent word
splitting/globbing, or split robustly with mapfile or read -a.
In docker/runtime/be/resource/run_be.sh line 61:
tmpFeId=$(echo $val | awk -F ':' '{ sub(/fe/, ""); sub(/ /, "");
print$1}')
^--^ SC2086 (info): Double quote to prevent globbing and
word splitting.
^--^ SC2250 (style): Prefer putting braces around
variable references even when not strictly required.
Did you mean:
tmpFeId=$(echo "$val" | awk -F ':' '{ sub(/fe/, ""); sub(/ /, "");
print$1}')
In docker/runtime/be/resource/run_be.sh line 62:
tmpFeIp=$(echo $val | awk -F ':' '{ sub(/ /, ""); print$2}')
^--^ SC2086 (info): Double quote to prevent globbing and
word splitting.
^--^ SC2250 (style): Prefer putting braces around
variable references even when not strictly required.
Did you mean:
tmpFeIp=$(echo "$val" | awk -F ':' '{ sub(/ /, ""); print$2}')
In docker/runtime/be/resource/run_be.sh line 63:
tmpFeEditLogPort=$(echo $val | awk -F ':' '{ sub(/ /, ""); print$3}')
^--^ SC2086 (info): Double quote to prevent
globbing and word splitting.
^--^ SC2250 (style): Prefer putting braces
around variable references even when not strictly required.
Did you mean:
tmpFeEditLogPort=$(echo "$val" | awk -F ':' '{ sub(/ /, ""); print$3}')
In docker/runtime/be/resource/run_be.sh line 70:
be_ip=$(echo ${BE_ADDR} | awk -F ':' '{ sub(/ /, ""); print$1}')
^--------^ SC2086 (info): Double quote to prevent globbing and
word splitting.
Did you mean:
be_ip=$(echo "${BE_ADDR}" | awk -F ':' '{ sub(/ /, ""); print$1}')
In docker/runtime/be/resource/run_be.sh line 71:
be_heartbeat_port=$(echo ${BE_ADDR} | awk -F ':' '{ sub(/ /, ""); print$2}')
^--------^ SC2086 (info): Double quote to prevent
globbing and word splitting.
Did you mean:
be_heartbeat_port=$(echo "${BE_ADDR}" | awk -F ':' '{ sub(/ /, "");
print$2}')
In docker/runtime/be/resource/run_be.sh line 79:
priority_networks=$(echo ${be_ip} | awk -F '.' '{print$1"."$2"."$3".0/24"}')
^------^ SC2086 (info): Double quote to prevent
globbing and word splitting.
Did you mean:
priority_networks=$(echo "${be_ip}" | awk -F '.'
'{print$1"."$2"."$3".0/24"}')
In docker/runtime/be/resource/run_be.sh line 83:
registerMySQL=$(echo "mysql -uroot -P9030 -h${feIpArray[1]} -e" "\"alter
system add backend '${be_ip}:${be_heartbeat_port}'\"")
^-- SC2116 (style): Useless echo? Instead of 'cmd $(echo
foo)', just use 'cmd foo'.
In docker/runtime/be/resource/run_be.sh line 92:
echo "DEBUG >>>>>> The " "$i" "time to register BE node,
be_join_status=${be_join_status}"
^-- SC2250 (style): Prefer putting braces
around variable references even when not strictly required.
Did you mean:
echo "DEBUG >>>>>> The " "${i}" "time to register BE node,
be_join_status=${be_join_status}"
In docker/runtime/be/resource/run_be.sh line 102:
eval ${registerShell}
^--------------^ SC2248 (style): Prefer double quoting even
when variables don't contain special characters.
Did you mean:
eval "${registerShell}"
In docker/runtime/be/resource/run_be.sh line 106:
eval ${registerMySQL}
^--------------^ SC2086 (info): Double quote to prevent
globbing and word splitting.
Did you mean:
eval "${registerMySQL}"
In docker/runtime/fe/Dockerfile line 27:
ADD ./resource/apache-doris-fe-"${x.x.x}"-bin.tar.gz /opt/
^------^ SC2154 (warning): x is referenced
but not assigned.
In docker/runtime/fe/resource/run_fe.sh line 54:
feServerArray=(${FE_SERVERS})
^-----------^ SC2206 (warning): Quote to prevent word
splitting/globbing, or split robustly with mapfile or read -a.
In docker/runtime/fe/resource/run_fe.sh line 60:
tmpFeId=$(echo "$val" | awk -F ':' '{ sub(/fe/, ""); sub(/ /, "");
print$1}')
^--^ SC2250 (style): Prefer putting braces around
variable references even when not strictly required.
Did you mean:
tmpFeId=$(echo "${val}" | awk -F ':' '{ sub(/fe/, ""); sub(/ /, "");
print$1}')
In docker/runtime/fe/resource/run_fe.sh line 61:
tmpFeIp=$(echo "$val" | awk -F ':' '{ sub(/ /, ""); print$2}')
^--^ SC2250 (style): Prefer putting braces around
variable references even when not strictly required.
Did you mean:
tmpFeIp=$(echo "${val}" | awk -F ':' '{ sub(/ /, ""); print$2}')
In docker/runtime/fe/resource/run_fe.sh line 62:
tmpFeEditLogPort=$(echo "$val" | awk -F ':' '{ sub(/ /, ""); print$3}')
^--^ SC2250 (style): Prefer putting braces
around variable references even when not strictly required.
Did you mean:
tmpFeEditLogPort=$(echo "${val}" | awk -F ':' '{ sub(/ /, ""); print$3}')
In docker/runtime/fe/resource/run_fe.sh line 91:
registerMySQL=$(echo "mysql -uroot -P9030 -h${feIpArray[1]} -e" "\"alter
system add follower '${feIpArray[FE_ID]}:${feEditLogPortArray[FE_ID]}'\"")
^-- SC2116 (style): Useless echo? Instead of 'cmd $(echo
foo)', just use 'cmd foo'.
In docker/runtime/fe/resource/run_fe.sh line 107:
eval ${registerMySQL}
^--------------^ SC2086 (info): Double quote to prevent
globbing and word splitting.
Did you mean:
eval "${registerMySQL}"
In docker/runtime/fe/resource/run_fe.sh line 111:
mysql -uroot -P9030 -h${feIpArray[1]} -e "show frontends" | grep
"${feIpArray[FE_ID]}_9010" | grep -E "false[[:space:]]*false"
^-------------^ SC2086 (info): Double quote to
prevent globbing and word splitting.
Did you mean:
mysql -uroot -P9030 -h"${feIpArray[1]}" -e "show frontends" | grep
"${feIpArray[FE_ID]}_9010" | grep -E "false[[:space:]]*false"
In docker/runtime/fe/resource/run_fe.sh line 114:
if [[ "$followerJoined" == 0 ]]; then
^-------------^ SC2250 (style): Prefer putting braces around
variable references even when not strictly required.
Did you mean:
if [[ "${followerJoined}" == 0 ]]; then
In docker/runtime/fe/resource/run_fe.sh line 116:
eval ${registerShell}
^--------------^ SC2086 (info): Double quote to prevent
globbing and word splitting.
Did you mean:
eval "${registerShell}"
In docker/runtime/fe/resource/run_fe.sh line 126:
eval ${registerShell}
^--------------^ SC2248 (style): Prefer double quoting even when
variables don't contain special characters.
Did you mean:
eval "${registerShell}"
For more information:
https://www.shellcheck.net/wiki/SC2154 -- x is referenced but not assigned.
https://www.shellcheck.net/wiki/SC2206 -- Quote to prevent word
splitting/g...
https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing
...
----------
You can address the above issues in one of three ways:
1. Manually correct the issue in the offending shell script;
2. Disable specific issues by adding the comment:
# shellcheck disable=NNNN
above the line that contains the issue, where NNNN is the error code;
3. Add '-e NNNN' to the SHELLCHECK_OPTS setting in your .yml action file.
```
</details>
<details>
<summary>shfmt errors</summary>
```
'shfmt ' returned error 1 finding the following formatting issues:
----------
docker/runtime/be/Dockerfile:27:35: invalid parameter name
--- docker/runtime/be/resource/run_be.sh.orig
+++ docker/runtime/be/resource/run_be.sh
@@ -23,23 +23,22 @@
eval set -- "${ARGS}"
-while [[ -n "$1" ]]
-do
+while [[ -n "$1" ]]; do
case "$1" in
- --fe_servers)
- FE_SERVERS=$2
- shift
- ;;
- --be_addr)
- BE_ADDR=$2
- shift
- ;;
- --)
- ;;
- *)
- echo "Error option $1"
- break
- ;;
+ --fe_servers)
+ FE_SERVERS=$2
+ shift
+ ;;
+ --be_addr)
+ BE_ADDR=$2
+ shift
+ ;;
+ --) ;;
+
+ *)
+ echo "Error option $1"
+ break
+ ;;
esac
shift
done
@@ -66,11 +65,9 @@
feEditLogPortArray[tmpFeId]=${tmpFeEditLogPort}
done
-
be_ip=$(echo ${BE_ADDR} | awk -F ':' '{ sub(/ /, ""); print$1}')
be_heartbeat_port=$(echo ${BE_ADDR} | awk -F ':' '{ sub(/ /, ""); print$2}')
-
echo "DEBUG >>>>>> feIpArray = ${feIpArray[*]}"
echo "DEBUG >>>>>> feEditLogPortArray = ${feEditLogPortArray[*]}"
echo "DEBUG >>>>>> masterFe = ${feIpArray[1]}:${feEditLogPortArray[1]}"
@@ -78,7 +75,7 @@
priority_networks=$(echo ${be_ip} | awk -F '.' '{print$1"."$2"."$3".0/24"}')
echo "DEBUG >>>>>> Append the configuration [priority_networks =
${priority_networks}] to /opt/apache-doris/be/conf/fe.conf"
-echo "priority_networks = ${priority_networks}" >>
/opt/apache-doris/be/conf/be.conf
+echo "priority_networks = ${priority_networks}"
>>/opt/apache-doris/be/conf/be.conf
registerMySQL=$(echo "mysql -uroot -P9030 -h${feIpArray[1]} -e" "\"alter
system add backend '${be_ip}:${be_heartbeat_port}'\"")
registerShell="/opt/apache-doris/be/bin/start_be.sh"
@@ -86,9 +83,8 @@
echo "DEBUG >>>>>> registerMySQL = ${registerMySQL}"
echo "DEBUG >>>>>> registerShell = ${registerShell}"
+for ((i = 0; i <= 20; i++)); do
-for (( i=0; i<=20; i++)); do
-
echo "DEBUG >>>>>> The " "$i" "time to register BE node,
be_join_status=${be_join_status}"
## check be register status
docker/runtime/fe/Dockerfile:27:35: invalid parameter name
--- docker/runtime/fe/resource/run_fe.sh.orig
+++ docker/runtime/fe/resource/run_fe.sh
@@ -23,23 +23,22 @@
eval set -- "${ARGS}"
-while [[ -n "$1" ]]
-do
+while [[ -n "$1" ]]; do
case "$1" in
- --fe_id)
- FE_ID=$2
- shift
- ;;
- --fe_servers)
- FE_SERVERS=$2
- shift
- ;;
- --)
- ;;
- *)
- echo "Error option $1"
- break
- ;;
+ --fe_id)
+ FE_ID=$2
+ shift
+ ;;
+ --fe_servers)
+ FE_SERVERS=$2
+ shift
+ ;;
+ --) ;;
+
+ *)
+ echo "Error option $1"
+ break
+ ;;
esac
shift
done
@@ -74,10 +73,9 @@
echo "DEBUG >>>>>> masterFe = ${feIpArray[1]}:${feEditLogPortArray[1]}"
echo "DEBUG >>>>>> currentFe =
${feIpArray[FE_ID]}:${feEditLogPortArray[FE_ID]}"
-
priority_networks=$(echo "${feIpArray[FE_ID]}" | awk -F '.'
'{print$1"."$2"."$3".0/24"}')
echo "DEBUG >>>>>> Append the configuration [priority_networks =
${priority_networks}] to /opt/doris-fe/conf/fe.conf"
-echo "priority_networks = ${priority_networks}" >>
/opt/apache-doris/fe/conf/fe.conf
+echo "priority_networks = ${priority_networks}"
>>/opt/apache-doris/fe/conf/fe.conf
if [[ "${FE_ID}" != 1 ]]; then
@@ -100,7 +98,7 @@
## STEP1: check FE master status
- for (( i=0; i<=2000; i++)); do
+ for ((i = 0; i <= 2000; i++)); do
## run STEP1 & STEP2, and then break
echo "Run registerShell command, [ registerMySQL = ${registerMySQL}
]"
----------
You can reformat the above files to meet shfmt's requirements by typing:
shfmt -w filename
```
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]