[
https://issues.apache.org/jira/browse/FLINK-23788?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17399565#comment-17399565
]
Xi commented on FLINK-23788:
----------------------------
By adding function 'normalize' :
{code}
98 normalize() {
99 UNAME=$(uname -s)
100 if [ "${UNAME:0:6}" == "CYGWIN" -o "${UNAME:0:6}" == "MINGW6" ]; then
101 echo $1|sed -E 's/^\/([^\/]+)\//\1:\//g'
102 else
103 echo $1
104 fi
105 }
{code}
and transform FLINK_CONF_DIR to 'MINGW6'-related path style 'file:/c:/xxx':
{code}
58 norm_conf_dir=`normalize "$FLINK_CONF_DIR"`
59 log_setting=(-Dlog.file="$log"
-Dlog4j.configuration=file:"$norm_conf_dir"/log4j-cli.properties
-Dlog4j.configurationFile=file:"$norm_co nf_dir"/log4j-cli.properties
-Dlogback.configurationFile=file:"$norm_conf_dir"/logback.xml)
{code}
could solve log properties loading issue.
> sql-client.sh cannot run on Windows 10 & MINGW6(git-bash from git-scm)
> ----------------------------------------------------------------------
>
> Key: FLINK-23788
> URL: https://issues.apache.org/jira/browse/FLINK-23788
> Project: Flink
> Issue Type: Bug
> Components: Client / Job Submission
> Affects Versions: 1.13.2
> Reporter: Xi
> Priority: Minor
>
> I'm trying to submit SQL task to my docker-desktop(docker-engine 20.10.8,
> Windows 10, git-bash({color:red}MINGW6{color}, not CYGWIN) 4.4.23 x86-64 )
> based Kubernetes(1.21.3) cluster. My operations are as following:
>
> # Download and extract 1.13.2 tar ball to get a directory named
> 'flink-1.13.2'
> # Enter the subdirectory flink-1.13.2
> # Execute `./bin/sql-client.sh` and I got following content:
>
> {code:java}
> //代码占位符
> Error: Could not find or load main class
> org.apache.flink.table.client.SqlClient
> Caused by: java.lang.ClassNotFoundException:
> org.apache.flink.table.client.SqlClient
> {code}
>
> After adding set -x to the head of ./bin/sqlclient.sh and re-execute the
> script I got this:
>
> {code:java}
> //代码占位符
> + exec 'C:\Program Files\Java\jdk-11.0.12/bin/java'
> -Dlog.file=/c/Users/yi/programs/flink-1.13.2/log/flink--sql-client-yi-station.log
>
> -Dlog4j.configuration=file:/c/Users/yi/programs/flink-1.13.2/conf/log4j-cli.properties
>
> -Dlog4j.configurationFile=file:/c/Users/yi/programs/flink-1.13.2/conf/log4j-cli.properties
>
> -Dlogback.configurationFile=file:/c/Users/yi/programs/flink-1.13.2/conf/logback.xml
> -classpath
> /c/Users/yi/programs/flink-1.13.2/lib/flink-csv-1.13.2.jar:/c/Users/yi/programs/flink-1.13.2/lib/flink-json-1.13.2.jar:/c/Users/yi/programs/flink-1.13.2/lib/flink-shaded-zookeeper-3.4.14.jar:/c/Users/yi/programs/flink-1.13.2/lib/flink-table-blink_2.12-1.13.2.jar:/c/Users/yi/programs/flink-1.13.2/lib/flink-table_2.12-1.13.2.jar:/c/Users/yi/programs/flink-1.13.2/lib/log4j-1.2-api-2.12.1.jar:/c/Users/yi/programs/flink-1.13.2/lib/log4j-api-2.12.1.jar:/c/Users/yi/programs/flink-1.13.2/lib/log4j-core-2.12.1.jar:/c/Users/yi/programs/flink-1.13.2/lib/log4j-slf4j-impl-2.12.1.jar:/c/Users/yi/programs/flink-1.13.2/lib/flink-dist_2.12-1.13.2.jar:/c/Users/yi/programs/flink-1.13.2/opt/flink-python_2.12-1.13.2.jar::::/c/Users/yi/programs/flink-1.13.2/opt/flink-sql-client_2.12-1.13.2.jar
> org.apache.flink.table.client.SqlClient --jar
> /c/Users/yi/programs/flink-1.13.2/opt/flink-sql-client_2.12-1.13.2.jar
> Error: Could not find or load main class
> org.apache.flink.table.client.SqlClient
> Caused by: java.lang.ClassNotFoundException:
> org.apache.flink.table.client.SqlClient
> {code}
>
> It seems like the appearance of multiple ":" (::::\) that result in this
> failure. Then actually I changed the function 'manglePathList' located in
> './bin/config.sh' as following:
>
> {code:java}
> //代码占位符
> 72 manglePathList() {
> 73 UNAME=$(uname -s)
> 74 # a path list, for example a java classpath
> 75 if [ "${UNAME:0:6}" == "CYGWIN" ]; then
> 76 echo `cygpath -wp "$1"`|sed -E 's/:+/:/g'
> 77 else
> 78 echo $1|sed -E 's/:+/:/g'
> 79 fi
> 80 }
> {code}
> NOTE: just replace multiple ":" into single ":" separator.
>
> Then the script can be started successfully(but with a failure to load
> log4j-cli.properties).
>
> {code:java}
> //代码占位符
> + exec 'C:\Program Files\Java\jdk-11.0.12/bin/java'
> -Dlog.file=/c/Users/yi/programs/flink-1.13.2/log/flink--sql-client-yi-station.log
>
> -Dlog4j.configuration=file:/c/Users/yi/programs/flink-1.13.2/conf/log4j-cli.properties
>
> -Dlog4j.configurationFile=file:/c/Users/yi/programs/flink-1.13.2/conf/log4j-cli.properties
>
> -Dlogback.configurationFile=file:/c/Users/yi/programs/flink-1.13.2/conf/logback.xml
> -classpath
> /c/Users/yi/programs/flink-1.13.2/lib/flink-csv-1.13.2.jar:/c/Users/yi/programs/flink-1.13.2/lib/flink-json-1.13.2.jar:/c/Users/yi/programs/flink-1.13.2/lib/flink-shaded-zookeeper-3.4.14.jar:/c/Users/yi/programs/flink-1.13.2/lib/flink-table-blink_2.12-1.13.2.jar:/c/Users/yi/programs/flink-1.13.2/lib/flink-table_2.12-1.13.2.jar:/c/Users/yi/programs/flink-1.13.2/lib/log4j-1.2-api-2.12.1.jar:/c/Users/yi/programs/flink-1.13.2/lib/log4j-api-2.12.1.jar:/c/Users/yi/programs/flink-1.13.2/lib/log4j-core-2.12.1.jar:/c/Users/yi/programs/flink-1.13.2/lib/log4j-slf4j-impl-2.12.1.jar:/c/Users/yi/programs/flink-1.13.2/lib/flink-dist_2.12-1.13.2.jar:/c/Users/yi/programs/flink-1.13.2/opt/flink-python_2.12-1.13.2.jar:/c/Users/yi/programs/flink-1.13.2/opt/flink-sql-client_2.12-1.13.2.jar
> org.apache.flink.table.client.SqlClient
> ERROR StatusLogger Unable to access
> file:/c/Users/yi/programs/flink-1.13.2/conf/log4j-cli.properties
> java.io.FileNotFoundException:
> \c\Users\yi\programs\flink-1.13.2\conf\log4j-cli.properties (The system
> cannot find the path specified)
> at java.base/java.io.FileInputStream.open0(Native Method)
> at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
> at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
> at java.base/java.io.FileInputStream.<init>(FileInputStream.java:112)
> at
> java.base/sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:86)
> at
> java.base/sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:184)
> at
> org.apache.logging.log4j.core.config.ConfigurationSource.fromUri(ConfigurationSource.java:321)
> at
> org.apache.logging.log4j.core.config.ConfigurationFactory$Factory.getConfiguration(ConfigurationFactory.java:443)
> at
> org.apache.logging.log4j.core.config.ConfigurationFactory$Factory.getConfiguration(ConfigurationFactory.java:385)
> at
> org.apache.logging.log4j.core.config.ConfigurationFactory.getConfiguration(ConfigurationFactory.java:293)
> at
> org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:647)
> at
> org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:668)
> at
> org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:253)
> at
> org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:153)
> at
> org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:45)
> at org.apache.logging.log4j.LogManager.getContext(LogManager.java:194)
> at
> org.apache.logging.log4j.spi.AbstractLoggerAdapter.getContext(AbstractLoggerAdapter.java:138)
> at
> org.apache.logging.slf4j.Log4jLoggerFactory.getContext(Log4jLoggerFactory.java:45)
> at
> org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:48)
> at
> org.apache.logging.slf4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:30)
> at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:329)
> at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:349)
> at org.apache.flink.table.client.SqlClient.<clinit>(SqlClient.java:64)
> ERROR StatusLogger Reconfiguration failed: No configuration found for
> '6659c656' at 'null' in 'null'
> No default environment specified.
> Searching for
> 'C:/Users/yi/programs/flink-1.13.2/conf/sql-client-defaults.yaml'...not found.
> Command history file path: C:\Users\yi\flink-sql-history
> ?▒▒▒▒▒▒▒▒▒▒▒▒?
> ▒▒▒▒▒▒▒▒▒▒??▒▒▒▒?▒▒▒▒▒▒▒▒▒▒?
> ▒▒▒▒▒▒▒▒▒▒?? ???▒▒▒▒▒▒? ?
> ?▒▒▒▒? ??▒▒▒▒▒▒▒▒▒▒?? ?▒▒▒▒▒▒▒▒
> ▒▒▒▒? ??▒▒▒▒▒▒▒▒? ?▒▒?▒▒?
> ?▒▒▒▒ ▒▒▒▒▒▒ ▒▒??▒▒▒▒
> ▒▒▒▒ ?????▒▒▒▒▒▒▒▒???▒▒▒▒▒▒
> ▒▒? ▒▒ ??? ▒▒▒▒▒▒▒▒▒▒▒▒ ?▒▒???
> ▒▒▒▒▒▒▒▒? ?▒▒▒▒▒▒ ▒▒▒▒??? ▒▒▒▒▒▒▒▒?
> ??▒▒▒▒▒▒▒▒▒▒ ▒▒▒▒? ▒▒▒▒?▒▒▒▒▒▒▒▒ ?▒▒?
> ▒▒??▒▒▒▒▒▒▒▒▒▒? ▒▒▒▒ ?▒▒ ▒▒▒▒??▒▒???▒▒?
> ▒▒▒▒▒▒▒▒?▒▒▒▒▒▒ ▒▒▒▒ ▒▒ ▒▒▒▒ ?▒▒▒▒▒▒▒▒▒▒?
> ?▒▒▒▒▒▒ ?▒▒? ▒▒ ▒▒? ?▒▒▒▒▒▒▒▒▒▒▒▒? ▒▒▒▒▒▒??
> ▒▒▒▒▒▒? ? ▒▒? ▒▒ ?▒▒ ▒▒▒▒▒▒▒▒▒▒??? ?▒▒?▒▒ ▒▒?
> ▒▒▒▒▒▒▒▒ ??▒▒? ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒? ?▒▒? ?▒▒
> ▒▒▒▒▒▒▒▒
> ?▒▒▒▒▒▒ ▒▒▒▒ ▒▒▒▒▒▒ ??▒▒▒▒▒▒▒▒▒▒▒▒▒▒?? ▒▒▒▒?? ▒▒ ?
> ▒▒▒▒?
> ▒▒▒▒▒▒ ▒▒▒▒ ▒▒▒▒▒▒ ?▒▒▒▒▒▒▒▒▒▒▒▒▒▒? ?▒▒▒▒▒▒
> ?▒▒?
> ▒▒▒▒ ▒▒ ▒▒▒▒▒▒▒▒▒▒?? ?▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ???
> ▒▒▒▒
> ▒▒▒▒▒▒ ▒▒▒▒? ??▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒?
> ▒▒▒▒▒▒▒▒ ▒▒
> ▒▒▒▒▒▒▒▒? ▒▒▒▒▒▒ ?▒▒▒▒??? ?▒▒▒▒▒▒▒▒▒▒▒▒? ??▒▒?
> ▒▒▒▒
> ▒▒▒▒??▒▒▒▒▒▒▒▒ ??????????▒▒▒▒▒▒▒▒? ▒▒▒▒
> ▒▒▒▒ ▒▒??▒▒ ▒▒▒▒▒▒▒▒??? ?▒▒▒▒ ?▒▒▒▒▒▒▒▒▒▒ ▒▒?
> ??▒▒
> ▒▒▒▒▒▒ ▒▒?▒▒ ▒▒▒▒? ??▒▒▒▒▒▒▒▒? ?▒▒▒▒?
> ??????▒▒▒▒▒▒▒▒▒▒▒▒?
> ▒▒▒▒? ▒▒▒▒?▒▒? ?▒▒▒▒? ▒▒▒▒ ▒▒? ???? ?▒▒?
> ▒▒▒▒ ?▒▒▒▒ ? ▒▒? ?▒▒ ▒▒▒▒
> ▒▒▒▒ ▒▒▒▒ ▒▒? ▒▒▒▒ ?▒▒▒▒▒▒▒▒?▒▒?
> ▒▒▒▒ ?▒▒▒▒▒▒? ▒▒? ▒▒▒▒▒▒?????▒▒▒▒? ?▒▒
> ▒▒▒▒ ▒▒▒▒▒▒? ? ??▒▒?▒▒▒▒? ▒▒▒▒
> ▒▒▒▒? ?▒▒▒▒?? ?? ▒▒?▒▒▒▒?????▒▒▒▒
> ?▒▒▒▒? ?▒▒▒▒? ▒▒▒▒▒▒▒▒?▒▒?
> ?▒▒▒▒▒▒▒▒?▒▒▒▒
> ?▒▒▒▒▒▒? ▒▒? ?▒▒▒▒▒▒ ?????
> ?▒▒▒▒▒▒▒▒▒▒?????????????????????????▒▒▒▒ ▒▒??▒▒?
> ______ _ _ _ _____ ____ _ _____ _ _ _ BETA
> | ____| (_) | | / ____|/ __ \| | / ____| (_) | |
> | |__ | |_ _ __ | | __ | (___ | | | | | | | | |_ ___ _ __ | |_
> | __| | | | '_ \| |/ / \___ \| | | | | | | | | |/ _ \ '_ \| __|
> | | | | | | | | < ____) | |__| | |____ | |____| | | __/ | | | |_
> |_| |_|_|_| |_|_|\_\ |_____/ \___\_\______| \_____|_|_|\___|_| |_|\__|
> Welcome! Enter 'HELP;' to list all available commands. 'QUIT;' to exit.
> Flink SQL>
> {code}
> On windows, the file path should be:
> {code}
> file:/c:/Users/yi/programs/flink-1.13.2/conf/log4j-cli.properties
> {code}
> instead of
> {code}
> file:/c/Users/yi/programs/flink-1.13.2/conf/log4j-cli.properties
> {code}
> NOTE: the driver identifier should contain a ':' on windows.
> And the JDK version:
> {code:java}
> $ java -version
> java version "11.0.12" 2021-07-20 LTS
> Java(TM) SE Runtime Environment 18.9 (build 11.0.12+8-LTS-237)
> Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.12+8-LTS-237, mixed mode)
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)