我正在使用 Wilma(FIWARE PEP 代理)来保护基于 Http 的服务(更多详细信息,WebHDFS,Hadoop 的 REST API);在此服务中可用的操作中,有一个用于上传和创建文件的操作。
到目前为止,我使用的是过时版本的代理,除了上传二进制文件外,一切都很好:上传文件的大小变得重复,根本不可读。这个问题与另一个类似。
因此,我决定升级到最新版本。现在,似乎没有任何效果:
$ curl -v -L -X PUT -T myjar.jar "http://myhost:myport/webhdfs/v1/user/myuser/myjar.jar?op=CREATE&user.name=myuser" -H "X-Auth-Token: mytoken" -H "Content-Type: application/octet-stream"
* Trying x.x.x.x...
* Connected to myhost (x.x.x.x) port myport (#0)
> PUT /webhdfs/v1/user/myuser/myjar.jar?op=CREATE&user.name=myuser HTTP/1.1
> Host: myhost:myport
> User-Agent: curl/7.43.0
> Accept: */*
> X-Auth-Token: mytoken
> Content-Type: application/octet-stream
> Content-Length: 2566043
> Expect: 100-continue
>
< HTTP/1.1 100 Continue
* We are completely uploaded and fine
< HTTP/1.1 500 Internal Server Error
< X-Powered-By: Express
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Methods: HEAD, POST, PUT, GET, OPTIONS, DELETE
< Access-Control-Allow-Headers: origin, content-type, X-Auth-Token, Tenant-ID, Authorization
< Content-Type: text/html; charset=utf-8
< Content-Length: 136
< ETag: W/"88-CqbD7g/NZPRqVjwFn9UJrA"
< Date: Mon, 20 Jun 2016 07:43:14 GMT
< Connection: keep-alive
<
{"RemoteException":{"message":"Read timed out","exception":"SocketTimeoutException","javaClassName":"java.net.SocketTimeoutException"}}
* Connection #0 to host myhost left intact
我已将日志跟踪添加到代码中,并且在lib/HTTPClient.js
运行代码时发现问题出在xhr.onreadystatechange
:
2016-06-20 09:42:54.543 - ERROR: HTTP-Client - Sending PUT to: http://0.0.0.0:myredirectedport/webhdfs/v1/user/myuser/myjar.jar?op=CREATE&user.name=myuser
2016-06-20 09:42:54.543 - ERROR: HTTP-Client - Headers: { host: 'myhost:myport',
'user-agent': 'curl/7.43.0',
accept: '*/*',
'x-auth-token': 'mytoken',
'content-type': 'application/octet-stream',
'content-length': '2566043',
expect: '100-continue',
'X-Nick-Name': 'myuser',
'X-Display-Name': 'myuser',
'X-Roles': '[{"name":"provider","id":"000"}]',
'X-Organizations': '[]',
'x-forwarded-for': 'y.y.y.y' }
2016-06-20 09:42:54.543 - ERROR: HTTP-Client - Body: <Buffer 50 4b 03 04 0a 00 08 08 08 00 5c 81 ce 48 b5 cd e3 30 5a 00 00 00 66 00 00 00 14 00 00 00 4d 45 54 41 2d 49 4e 46 2f 4d 41 4e 49 46 45 53 54 2e 4d 46 f3 ...>
2016-06-20 09:42:54.543 - ERROR: HTTP-Client - Sendind data
2016-06-20 09:43:14.702 - ERROR: HTTP-Client - Callback error
2016-06-20 09:43:14.702 - ERROR: HTTP-Client - Error: 500 {"RemoteException":{"message":"Read timed out","exception":"SocketTimeoutException","javaClassName":"java.net.SocketTimeoutException"}}
有什么提示吗?谢谢!