You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-zh@flink.apache.org by 111 <xi...@163.com> on 2020/03/25 00:47:05 UTC

关于sql-gateway insert into 异常捕获的问题

Hi,
最近在使用sql-gateway,当使用
StatementExecuteResponseBody body = getInstance().sendRequest(
host,port,StatementExecuteHeaders.getInstance(),
        new SessionMessageParameters(sessionId),
        new StatementExecuteRequestBody(stmt, timeout)).get();
提交insert语句时,当任务失败,无法返回对应的异常信息;是目前版本暂时不支持这种特性吗?

回复: 关于sql-gateway insert into 异常捕获的问题

Posted by 111 <xi...@163.com>.
Hi godfrey,
关于exceptions 这个rest api 的建议,试验了下,目前可以满足需求。非常感谢 !
Best,
Xinghalo


在2020年03月25日 11:37,111<xi...@163.com> 写道:
Hi,
好的,我研究下哈。现在taskmanager的原理还不太熟,有问题再沟通
Best,
Xinghalo


在2020年03月25日 11:01,godfrey he<go...@gmail.com> 写道:
Hi,你可以尝试在yarn上去拿历史作业的日志

Best,
Godfrey

111 <xi...@163.com> 于2020年3月25日周三 上午10:53写道:

Hi,

目前确实通过sql-gateway拿到了jobId,并且获取到了状态。不过由于使用的是yarn-session,导致失败后taskmanager回收,taskmanager上的日志也就丢失了。
如果连接到Jobmanager上,是拿不到taskmanager曾经的日志吧?


Best,
xinghalo
在2020年03月25日 10:47,godfrey he<go...@gmail.com> 写道:
hi, sql gateway目前支持获取作业状态(要求jm还能查询到该作业)。如果要获取作业异常可以通过jm提供的REST API [1]

[1]

https://ci.apache.org/projects/flink/flink-docs-stable/monitoring/rest_api.html#jobs-jobid-exceptions

Best,
Godfrey

111 <xi...@163.com> 于2020年3月25日周三 上午10:38写道:

Hi,
确实是执行报错….那如果是执行报错,flink本身是否有提供获取exception的机制呢?


| |
xinghalo
|
|
xinghalo@163.com
|
签名由网易邮箱大师定制


在2020年03月25日 10:32,godfrey he<go...@gmail.com> 写道:
目前sql gateway只负责提交作业,不负责跟踪作业的状态。如果作业没提交成功,sql gateway会返回相关的错误;如果是执行时报错,sql
gateway不会返回错误。你看看flink web ui作业是否提交成功

Best,
Godfrey

111 <xi...@163.com> 于2020年3月25日周三 上午10:29写道:



Hi,
我试过了,insert into是不行的…sql-gateway的后台日志也没有任何报错。
怀疑是不是我使用的jdbc sink connector,内部是流的方式。流不会把异常抛给sql-gateway?


在2020年03月25日 10:26,godfrey he<go...@gmail.com> 写道:
hi, sql gateway当前会把服务端的完整异常栈返回给用户,
例如:
Caused by: java.util.concurrent.ExecutionException:
org.apache.flink.runtime.rest.util.RestClientException: [Internal server
error., <Exception on server side:
com.ververica.flink.table.gateway.SqlExecutionException: xxx

你可以检查一下sql gateway的日志,看看是否相关的错误

Best,
Godfrey

111 <xi...@163.com> 于2020年3月25日周三 上午8:47写道:

Hi,
最近在使用sql-gateway,当使用
StatementExecuteResponseBody body = getInstance().sendRequest(
host,port,StatementExecuteHeaders.getInstance(),
new SessionMessageParameters(sessionId),
new StatementExecuteRequestBody(stmt, timeout)).get();
提交insert语句时,当任务失败,无法返回对应的异常信息;是目前版本暂时不支持这种特性吗?




回复: 关于sql-gateway insert into 异常捕获的问题

Posted by 111 <xi...@163.com>.
Hi,
好的,我研究下哈。现在taskmanager的原理还不太熟,有问题再沟通
Best,
Xinghalo


在2020年03月25日 11:01,godfrey he<go...@gmail.com> 写道:
Hi,你可以尝试在yarn上去拿历史作业的日志

Best,
Godfrey

111 <xi...@163.com> 于2020年3月25日周三 上午10:53写道:

Hi,

目前确实通过sql-gateway拿到了jobId,并且获取到了状态。不过由于使用的是yarn-session,导致失败后taskmanager回收,taskmanager上的日志也就丢失了。
如果连接到Jobmanager上,是拿不到taskmanager曾经的日志吧?


Best,
xinghalo
在2020年03月25日 10:47,godfrey he<go...@gmail.com> 写道:
hi, sql gateway目前支持获取作业状态(要求jm还能查询到该作业)。如果要获取作业异常可以通过jm提供的REST API [1]

[1]

https://ci.apache.org/projects/flink/flink-docs-stable/monitoring/rest_api.html#jobs-jobid-exceptions

Best,
Godfrey

111 <xi...@163.com> 于2020年3月25日周三 上午10:38写道:

Hi,
确实是执行报错….那如果是执行报错,flink本身是否有提供获取exception的机制呢?


| |
xinghalo
|
|
xinghalo@163.com
|
签名由网易邮箱大师定制


在2020年03月25日 10:32,godfrey he<go...@gmail.com> 写道:
目前sql gateway只负责提交作业,不负责跟踪作业的状态。如果作业没提交成功,sql gateway会返回相关的错误;如果是执行时报错,sql
gateway不会返回错误。你看看flink web ui作业是否提交成功

Best,
Godfrey

111 <xi...@163.com> 于2020年3月25日周三 上午10:29写道:



Hi,
我试过了,insert into是不行的…sql-gateway的后台日志也没有任何报错。
怀疑是不是我使用的jdbc sink connector,内部是流的方式。流不会把异常抛给sql-gateway?


在2020年03月25日 10:26,godfrey he<go...@gmail.com> 写道:
hi, sql gateway当前会把服务端的完整异常栈返回给用户,
例如:
Caused by: java.util.concurrent.ExecutionException:
org.apache.flink.runtime.rest.util.RestClientException: [Internal server
error., <Exception on server side:
com.ververica.flink.table.gateway.SqlExecutionException: xxx

你可以检查一下sql gateway的日志,看看是否相关的错误

Best,
Godfrey

111 <xi...@163.com> 于2020年3月25日周三 上午8:47写道:

Hi,
最近在使用sql-gateway,当使用
StatementExecuteResponseBody body = getInstance().sendRequest(
host,port,StatementExecuteHeaders.getInstance(),
new SessionMessageParameters(sessionId),
new StatementExecuteRequestBody(stmt, timeout)).get();
提交insert语句时,当任务失败,无法返回对应的异常信息;是目前版本暂时不支持这种特性吗?




Re: 关于sql-gateway insert into 异常捕获的问题

Posted by godfrey he <go...@gmail.com>.
Hi,你可以尝试在yarn上去拿历史作业的日志

Best,
Godfrey

111 <xi...@163.com> 于2020年3月25日周三 上午10:53写道:

> Hi,
>
> 目前确实通过sql-gateway拿到了jobId,并且获取到了状态。不过由于使用的是yarn-session,导致失败后taskmanager回收,taskmanager上的日志也就丢失了。
> 如果连接到Jobmanager上,是拿不到taskmanager曾经的日志吧?
>
>
> Best,
>  xinghalo
> 在2020年03月25日 10:47,godfrey he<go...@gmail.com> 写道:
> hi, sql gateway目前支持获取作业状态(要求jm还能查询到该作业)。如果要获取作业异常可以通过jm提供的REST API [1]
>
> [1]
>
> https://ci.apache.org/projects/flink/flink-docs-stable/monitoring/rest_api.html#jobs-jobid-exceptions
>
> Best,
> Godfrey
>
> 111 <xi...@163.com> 于2020年3月25日周三 上午10:38写道:
>
> Hi,
> 确实是执行报错….那如果是执行报错,flink本身是否有提供获取exception的机制呢?
>
>
> | |
> xinghalo
> |
> |
> xinghalo@163.com
> |
> 签名由网易邮箱大师定制
>
>
> 在2020年03月25日 10:32,godfrey he<go...@gmail.com> 写道:
> 目前sql gateway只负责提交作业,不负责跟踪作业的状态。如果作业没提交成功,sql gateway会返回相关的错误;如果是执行时报错,sql
> gateway不会返回错误。你看看flink web ui作业是否提交成功
>
> Best,
> Godfrey
>
> 111 <xi...@163.com> 于2020年3月25日周三 上午10:29写道:
>
>
>
> Hi,
> 我试过了,insert into是不行的…sql-gateway的后台日志也没有任何报错。
> 怀疑是不是我使用的jdbc sink connector,内部是流的方式。流不会把异常抛给sql-gateway?
>
>
> 在2020年03月25日 10:26,godfrey he<go...@gmail.com> 写道:
> hi, sql gateway当前会把服务端的完整异常栈返回给用户,
> 例如:
> Caused by: java.util.concurrent.ExecutionException:
> org.apache.flink.runtime.rest.util.RestClientException: [Internal server
> error., <Exception on server side:
> com.ververica.flink.table.gateway.SqlExecutionException: xxx
>
> 你可以检查一下sql gateway的日志,看看是否相关的错误
>
> Best,
> Godfrey
>
> 111 <xi...@163.com> 于2020年3月25日周三 上午8:47写道:
>
> Hi,
> 最近在使用sql-gateway,当使用
> StatementExecuteResponseBody body = getInstance().sendRequest(
> host,port,StatementExecuteHeaders.getInstance(),
> new SessionMessageParameters(sessionId),
> new StatementExecuteRequestBody(stmt, timeout)).get();
> 提交insert语句时,当任务失败,无法返回对应的异常信息;是目前版本暂时不支持这种特性吗?
>
>
>

回复: 关于sql-gateway insert into 异常捕获的问题

Posted by 111 <xi...@163.com>.
Hi,
目前确实通过sql-gateway拿到了jobId,并且获取到了状态。不过由于使用的是yarn-session,导致失败后taskmanager回收,taskmanager上的日志也就丢失了。
如果连接到Jobmanager上,是拿不到taskmanager曾经的日志吧?


Best,
 xinghalo
在2020年03月25日 10:47,godfrey he<go...@gmail.com> 写道:
hi, sql gateway目前支持获取作业状态(要求jm还能查询到该作业)。如果要获取作业异常可以通过jm提供的REST API [1]

[1]
https://ci.apache.org/projects/flink/flink-docs-stable/monitoring/rest_api.html#jobs-jobid-exceptions

Best,
Godfrey

111 <xi...@163.com> 于2020年3月25日周三 上午10:38写道:

Hi,
确实是执行报错….那如果是执行报错,flink本身是否有提供获取exception的机制呢?


| |
xinghalo
|
|
xinghalo@163.com
|
签名由网易邮箱大师定制


在2020年03月25日 10:32,godfrey he<go...@gmail.com> 写道:
目前sql gateway只负责提交作业,不负责跟踪作业的状态。如果作业没提交成功,sql gateway会返回相关的错误;如果是执行时报错,sql
gateway不会返回错误。你看看flink web ui作业是否提交成功

Best,
Godfrey

111 <xi...@163.com> 于2020年3月25日周三 上午10:29写道:



Hi,
我试过了,insert into是不行的…sql-gateway的后台日志也没有任何报错。
怀疑是不是我使用的jdbc sink connector,内部是流的方式。流不会把异常抛给sql-gateway?


在2020年03月25日 10:26,godfrey he<go...@gmail.com> 写道:
hi, sql gateway当前会把服务端的完整异常栈返回给用户,
例如:
Caused by: java.util.concurrent.ExecutionException:
org.apache.flink.runtime.rest.util.RestClientException: [Internal server
error., <Exception on server side:
com.ververica.flink.table.gateway.SqlExecutionException: xxx

你可以检查一下sql gateway的日志,看看是否相关的错误

Best,
Godfrey

111 <xi...@163.com> 于2020年3月25日周三 上午8:47写道:

Hi,
最近在使用sql-gateway,当使用
StatementExecuteResponseBody body = getInstance().sendRequest(
host,port,StatementExecuteHeaders.getInstance(),
new SessionMessageParameters(sessionId),
new StatementExecuteRequestBody(stmt, timeout)).get();
提交insert语句时,当任务失败,无法返回对应的异常信息;是目前版本暂时不支持这种特性吗?



Re: 关于sql-gateway insert into 异常捕获的问题

Posted by godfrey he <go...@gmail.com>.
hi, sql gateway目前支持获取作业状态(要求jm还能查询到该作业)。如果要获取作业异常可以通过jm提供的REST API [1]

[1]
https://ci.apache.org/projects/flink/flink-docs-stable/monitoring/rest_api.html#jobs-jobid-exceptions

Best,
Godfrey

111 <xi...@163.com> 于2020年3月25日周三 上午10:38写道:

> Hi,
> 确实是执行报错….那如果是执行报错,flink本身是否有提供获取exception的机制呢?
>
>
> | |
> xinghalo
> |
> |
> xinghalo@163.com
> |
> 签名由网易邮箱大师定制
>
>
> 在2020年03月25日 10:32,godfrey he<go...@gmail.com> 写道:
> 目前sql gateway只负责提交作业,不负责跟踪作业的状态。如果作业没提交成功,sql gateway会返回相关的错误;如果是执行时报错,sql
> gateway不会返回错误。你看看flink web ui作业是否提交成功
>
> Best,
> Godfrey
>
> 111 <xi...@163.com> 于2020年3月25日周三 上午10:29写道:
>
>
>
> Hi,
> 我试过了,insert into是不行的…sql-gateway的后台日志也没有任何报错。
> 怀疑是不是我使用的jdbc sink connector,内部是流的方式。流不会把异常抛给sql-gateway?
>
>
> 在2020年03月25日 10:26,godfrey he<go...@gmail.com> 写道:
> hi, sql gateway当前会把服务端的完整异常栈返回给用户,
> 例如:
> Caused by: java.util.concurrent.ExecutionException:
> org.apache.flink.runtime.rest.util.RestClientException: [Internal server
> error., <Exception on server side:
> com.ververica.flink.table.gateway.SqlExecutionException: xxx
>
> 你可以检查一下sql gateway的日志,看看是否相关的错误
>
> Best,
> Godfrey
>
> 111 <xi...@163.com> 于2020年3月25日周三 上午8:47写道:
>
> Hi,
> 最近在使用sql-gateway,当使用
> StatementExecuteResponseBody body = getInstance().sendRequest(
> host,port,StatementExecuteHeaders.getInstance(),
> new SessionMessageParameters(sessionId),
> new StatementExecuteRequestBody(stmt, timeout)).get();
> 提交insert语句时,当任务失败,无法返回对应的异常信息;是目前版本暂时不支持这种特性吗?
>
>

回复: 关于sql-gateway insert into 异常捕获的问题

Posted by 111 <xi...@163.com>.
Hi,
确实是执行报错….那如果是执行报错,flink本身是否有提供获取exception的机制呢?


| |
xinghalo
|
|
xinghalo@163.com
|
签名由网易邮箱大师定制


在2020年03月25日 10:32,godfrey he<go...@gmail.com> 写道:
目前sql gateway只负责提交作业,不负责跟踪作业的状态。如果作业没提交成功,sql gateway会返回相关的错误;如果是执行时报错,sql
gateway不会返回错误。你看看flink web ui作业是否提交成功

Best,
Godfrey

111 <xi...@163.com> 于2020年3月25日周三 上午10:29写道:



Hi,
我试过了,insert into是不行的…sql-gateway的后台日志也没有任何报错。
怀疑是不是我使用的jdbc sink connector,内部是流的方式。流不会把异常抛给sql-gateway?


在2020年03月25日 10:26,godfrey he<go...@gmail.com> 写道:
hi, sql gateway当前会把服务端的完整异常栈返回给用户,
例如:
Caused by: java.util.concurrent.ExecutionException:
org.apache.flink.runtime.rest.util.RestClientException: [Internal server
error., <Exception on server side:
com.ververica.flink.table.gateway.SqlExecutionException: xxx

你可以检查一下sql gateway的日志,看看是否相关的错误

Best,
Godfrey

111 <xi...@163.com> 于2020年3月25日周三 上午8:47写道:

Hi,
最近在使用sql-gateway,当使用
StatementExecuteResponseBody body = getInstance().sendRequest(
host,port,StatementExecuteHeaders.getInstance(),
new SessionMessageParameters(sessionId),
new StatementExecuteRequestBody(stmt, timeout)).get();
提交insert语句时,当任务失败,无法返回对应的异常信息;是目前版本暂时不支持这种特性吗?


Re: 关于sql-gateway insert into 异常捕获的问题

Posted by godfrey he <go...@gmail.com>.
目前sql gateway只负责提交作业,不负责跟踪作业的状态。如果作业没提交成功,sql gateway会返回相关的错误;如果是执行时报错,sql
gateway不会返回错误。你看看flink web ui作业是否提交成功

Best,
Godfrey

111 <xi...@163.com> 于2020年3月25日周三 上午10:29写道:

>
>
> Hi,
> 我试过了,insert into是不行的…sql-gateway的后台日志也没有任何报错。
> 怀疑是不是我使用的jdbc sink connector,内部是流的方式。流不会把异常抛给sql-gateway?
>
>
> 在2020年03月25日 10:26,godfrey he<go...@gmail.com> 写道:
> hi, sql gateway当前会把服务端的完整异常栈返回给用户,
> 例如:
> Caused by: java.util.concurrent.ExecutionException:
> org.apache.flink.runtime.rest.util.RestClientException: [Internal server
> error., <Exception on server side:
> com.ververica.flink.table.gateway.SqlExecutionException: xxx
>
> 你可以检查一下sql gateway的日志,看看是否相关的错误
>
> Best,
> Godfrey
>
> 111 <xi...@163.com> 于2020年3月25日周三 上午8:47写道:
>
> Hi,
> 最近在使用sql-gateway,当使用
> StatementExecuteResponseBody body = getInstance().sendRequest(
> host,port,StatementExecuteHeaders.getInstance(),
> new SessionMessageParameters(sessionId),
> new StatementExecuteRequestBody(stmt, timeout)).get();
> 提交insert语句时,当任务失败,无法返回对应的异常信息;是目前版本暂时不支持这种特性吗?
>

回复: 关于sql-gateway insert into 异常捕获的问题

Posted by 111 <xi...@163.com>.

Hi,
我试过了,insert into是不行的…sql-gateway的后台日志也没有任何报错。
怀疑是不是我使用的jdbc sink connector,内部是流的方式。流不会把异常抛给sql-gateway?


在2020年03月25日 10:26,godfrey he<go...@gmail.com> 写道:
hi, sql gateway当前会把服务端的完整异常栈返回给用户,
例如:
Caused by: java.util.concurrent.ExecutionException:
org.apache.flink.runtime.rest.util.RestClientException: [Internal server
error., <Exception on server side:
com.ververica.flink.table.gateway.SqlExecutionException: xxx

你可以检查一下sql gateway的日志,看看是否相关的错误

Best,
Godfrey

111 <xi...@163.com> 于2020年3月25日周三 上午8:47写道:

Hi,
最近在使用sql-gateway,当使用
StatementExecuteResponseBody body = getInstance().sendRequest(
host,port,StatementExecuteHeaders.getInstance(),
new SessionMessageParameters(sessionId),
new StatementExecuteRequestBody(stmt, timeout)).get();
提交insert语句时,当任务失败,无法返回对应的异常信息;是目前版本暂时不支持这种特性吗?

Re: 关于sql-gateway insert into 异常捕获的问题

Posted by godfrey he <go...@gmail.com>.
hi, sql gateway当前会把服务端的完整异常栈返回给用户,
例如:
Caused by: java.util.concurrent.ExecutionException:
org.apache.flink.runtime.rest.util.RestClientException: [Internal server
error., <Exception on server side:
com.ververica.flink.table.gateway.SqlExecutionException: xxx

你可以检查一下sql gateway的日志,看看是否相关的错误

Best,
Godfrey

111 <xi...@163.com> 于2020年3月25日周三 上午8:47写道:

> Hi,
> 最近在使用sql-gateway,当使用
> StatementExecuteResponseBody body = getInstance().sendRequest(
> host,port,StatementExecuteHeaders.getInstance(),
>         new SessionMessageParameters(sessionId),
>         new StatementExecuteRequestBody(stmt, timeout)).get();
> 提交insert语句时,当任务失败,无法返回对应的异常信息;是目前版本暂时不支持这种特性吗?