You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@sqoop.apache.org by Preston Cheung <zh...@gmail.com> on 2016/04/08 11:53:51 UTC

REST API occur Invalid HTTP request

Hi all,

I got Invalid HTTP request error with message "Detected incorrect link
config structure" when using REST API to create a MySQL link.

My sqoop version is 1.99.6.

I am using "POST /v1/link" API with request body:

{"link":{"id":-1,"enabled":true,"link-config-values":[{"id":1,"inputs":[{"id":1,"name":"linkConfig.jdbcDriver","value":"com.mysql.jdbc.Driver","type":"STRING","size":255,"editable":"ANY","sensitive":false},{"id":2,"name":"linkConfig.connectionString","value":"jdbc:mysql\/\/
tempt61.qserver.com:3306
\/sqoop","type":"STRING","size":255,"editable":"ANY","sensitive":false},{"id":3,"name":"linkConfig.username","value":"sqoop","type":"STRING","size":5,"editable":"ANY","sensitive":false},{"id":4,"name":"linkConfig.password","value":"sqoop","type":"STRING","size":5,"editable":"ANY","sensitive":false},{"id":5,"name":"linkConfig.jdbcProperties","value":{"useUnicode":true},"type":"MAP","editable":"ANY","sensitive":false}],"name":"linkConfig","type":"LINK"}],"update-user":"sqoop","name":"testMysqlLink","creation-date":1460108824566,"connector-id":4,"update-date":1460108824566,"creation-user":"sqoop"}}

I got the response as followed:

HTTP/1.1 500 Internal Server Error
Server: Apache-Coyote/1.1
sqoop-error-code: 2000
sqoop-error-message: ERROR
sqoop-internal-error-code: SERVER_0003
sqoop-internal-error-message: SERVER_0003:Invalid HTTP request - Detected
incorrect link config structure
Content-Type: application/json;charset=UTF-8
Content-Length: 3039
Date: Fri, 08 Apr 2016 09:47:03 GMT
Connection: close

{"message":"Detected incorrect link config
structure","error-code-class":"org.apache.sqoop.server.common.ServerError","stack-trace":[{"file":"LinkRequestHandler.java","line":149,"class":"org.apache.sqoop.handler.LinkRequestHandler","method":"createUpdateLink"},{"file":"LinkRequestHandler.java","line":69,"class":"org.apache.sqoop.handler.LinkRequestHandler","method":"handleEvent"},{"file":"LinkServlet.java","line":72,"class":"org.apache.sqoop.server.v1.LinkServlet","method":"handlePostRequest"},{"file":"SqoopProtocolServlet.java","line":63,"class":"org.apache.sqoop.server.SqoopProtocolServlet","method":"doPost"},{"file":"HttpServlet.java","line":643,"class":"javax.servlet.http.HttpServlet","method":"service"},{"file":"HttpServlet.java","line":723,"class":"javax.servlet.http.HttpServlet","method":"service"},{"file":"ApplicationFilterChain.java","line":290,"class":"org.apache.catalina.core.ApplicationFilterChain","method":"internalDoFilter"},{"file":"ApplicationFilterChain.java","line":206,"class":"org.apache.catalina.core.ApplicationFilterChain","method":"doFilter"},{"file":"AuthenticationFilter.java","line":595,"class":"org.apache.hadoop.security.authentication.server.AuthenticationFilter","method":"doFilter"},{"file":"DelegationTokenAuthenticationFilter.java","line":291,"class":"org.apache.hadoop.security.token.delegation.web.DelegationTokenAuthenticationFilter","method":"doFilter"},{"file":"AuthenticationFilter.java","line":554,"class":"org.apache.hadoop.security.authentication.server.AuthenticationFilter","method":"doFilter"},{"file":"ApplicationFilterChain.java","line":235,"class":"org.apache.catalina.core.ApplicationFilterChain","method":"internalDoFilter"},{"file":"ApplicationFilterChain.java","line":206,"class":"org.apache.catalina.core.ApplicationFilterChain","method":"doFilter"},{"file":"StandardWrapperValve.java","line":233,"class":"org.apache.catalina.core.StandardWrapperValve","method":"invoke"},{"file":"StandardContextValve.java","line":191,"class":"org.apache.catalina.core.StandardContextValve","method":"invoke"},{"file":"StandardHostValve.java","line":127,"class":"org.apache.catalina.core.StandardHostValve","method":"invoke"},{"file":"ErrorReportValve.java","line":103,"class":"org.apache.catalina.valves.ErrorReportValve","method":"invoke"},{"file":"StandardEngineValve.java","line":109,"class":"org.apache.catalina.core.StandardEngineValve","method":"invoke"},{"file":"CoyoteAdapter.java","line":293,"class":"org.apache.catalina.connector.CoyoteAdapter","method":"service"},{"file":"Http11Processor.java","line":861,"class":"org.apache.coyote.http11.Http11Processor","method":"process"},{"file":"Http11Protocol.java","line":606,"class":"org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler","method":"process"},{"file":"JIoEndpoint.java","line":489,"class":"org.apache.tomcat.util.net.JIoEndpoint$Worker","method":"run"},{"file":"Thread.java","line":722,"class":"java.lang.Thread","method":"run"}],"error-code":"SERVER_0003","class":"org.apache.sqoop.common.SqoopException"}"


Could some one help me figure out where my issue is?

Thanks a lot!
-- 
by Preston Cheung