java.io.EOFException when parsing JSON with clojure Transit - json

I am reading from an input stream with (t/read request-body :json)
and I get a java.lang.RuntimeException: java.io.EOFException.
{"A":"B", "C":"D"}
java.lang.RuntimeException: java.io.EOFException
ReaderFactory.java:122 com.cognitect.transit.impl.ReaderFactory$ReaderImpl.read
TransitFactory.java:136 com.cognitect.transit.TransitFactory$DeferredJsonReader.read
transit.clj:285 cognitect.transit/read
Any ideas why this could be?
For clarity the curl POST request:
%curl -X POST ...../word -H "Content-Type: application/json" -d '{"A":"B", "C":"D"}' -v > abc.html
* Hostname was NOT found in DNS cache
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Trying 178.63.65.149...
* Connected to ..... (178.63.65.149) port 80 (#0)
> POST /word HTTP/1.1
> User-Agent: curl/7.37.1
> Host: .....
> Accept: */*
> Content-Type: application/json
> Content-Length: 18
>
} [data not shown]
* upload completely sent off: 18 out of 18 bytes
< HTTP/1.1 500 Server Error
* Server nginx/1.2.1 is not blacklisted
< Server: nginx/1.2.1
< Date: Sat, 04 Apr 2015 19:05:03 GMT
< Content-Type: text/html;charset=ISO-8859-1
< Content-Length: 13190
< Connection: keep-alive
<
{ [data not shown]
100 13208 100 13190 100 18 79062 107 --:--:-- --:--:-- --:--:-- 79457
* Connection #0 to host ..... left intact

Looking at your logging data, your request body is not actually json, it looks like a multi-part/form-data encoded form which includes a json file-upload.

Related

Sending JSON file using relative path with curl

I have a JSON file called people.json:
[
{
"name": "Adam"
},
{
"name": "Eve"
}
]
I'm trying to send this data using a POST request with curl, from the project's root directory:
curl --request POST \
--header 'Content-Type: application/json' 'Accept: application/json' \
--data-binary #src/test/java/com/spring/app/people.json \
http://127.0.0.1:8080/api/v1/person -v -s
I keep getting the "Bad Request" error:
* Closing connection -1
* Trying 127.0.0.1:8080...
* Connected to 127.0.0.1 (127.0.0.1) port 8080 (#0)
> POST /api/v1/person HTTP/1.1
> Host: 127.0.0.1:8080
> User-Agent: curl/7.74.0
> Accept: */*
> Content-Type: application/json
> Content-Length: 80
>
* upload completely sent off: 80 out of 80 bytes
* Mark bundle as not supporting multiuse
< HTTP/1.1 400
< Content-Type: application/json
< Transfer-Encoding: chunked
< Date: Sat, 12 Dec 2020 03:56:38 GMT
< Connection: close
<
* Closing connection 0
{"timestamp":"2020-12-12T03:56:38.822+00:00","status":400,"error":"Bad Request","message":"","path":"/api/v1/person"}%
I've already had a look at this post, but still get the same error.
I've also installed homebrew curl, but even using that doesn't resolve the error.
I would appreciate any help.

CURL json output cuts off

I'm working on centos 7 and has this json request :
curl --output 'json.data.json' -vvv -x '' -X POST -H "Content-Type: application/json" -H "Connection: keep-alive" -d '{"jsonrpc":"2.0","method":"item.get","params":{"output": ["name","lastvalue","lastclock","hostid"],"groupids": ["5"],"filter":{"name":["LDT Security Flag"]},"sortfield": "name" },"auth":"c1cxxxxxxxxx","id":1}' $CURLADDR
Now,
In middle of results I see :
734247","lastvalue":"0"},{"itemid":"192890","name":"LDT Fl* transfer closed with outstanding read data remaining
100 86797 0 86569 100 228 75094 197 0:00:01 0:00:01 --:--:-- 75146
* Closing connection 0
curl: (18) transfer closed with outstanding read data remaining
And after that some more json results.
But I noticed that not matter how many times I run it and redirect output to .json file , file always at the same size : 88K like there some kind of limit on info download size ? what can i do ?
UPDATE:
So i added it and now the error : curl: (18) transfer closed with outstanding Read data remaining is gone. but is still cuts at the middle with : * Closing Connection 0 and file is 88K – Batchen Regev 11 mins ago
also connection data :
> POST /api_jsonrpc.php HTTP/1.0
> User-Agent: curl/7.29.0
> Host: XXXXXX:1080
> Content-Type: application/json;charset=utf-8
> Accept: application/json, text/plain, */*
> Content-Length: 224
>
} [data not shown]
* upload completely sent off: 224 out of 224 bytes
100 224 0 0 100 224 0 223 0:00:01 0:00:01 --:--:-- 223< HTTP/1.1 200 OK
< Server: nginx
< Date: Tue, 25 Dec 2018 15:21:07 GMT
< Content-Type: application/json
< Connection: close
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Headers: Content-Type
< Access-Control-Allow-Methods: POST
< Access-Control-Max-Age: 1000
<
{ [data not shown]
100 86840 0 86616 100 224 77583 200 0:00:01 0:00:01 --:--:-- 77612
* Closing connection 0
This seems to be a server side issue.
You might try to work it around by forcing HTTP 1.0 connection (to avoid chunked transfer which might cause this problem) with the --http1.0 option.
CURLE_PARTIAL_FILE (18)
A file transfer was shorter or larger than expected. This happens when the server first reports an expected transfer size, and then delivers data that doesn't match the previously given size.
Source: https://curl.haxx.se/libcurl/c/libcurl-errors.html

can't populate files into photoscene - error code=4 msg=Not yet implemented

I am trying, unsuccessfully, to populate files into a photoscene with this curl call:
curl -v 'https://developer.api.autodesk.com/photo-to-3d/v1/file' -X 'POST' -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsImtpZCI6Imp3dF9zeW1tZXRyaWNfa2V5In0.eyJ1c2VyaWQiOiJZUlZNSlNFNTdFVzMiLCJleHAiOjE1MzMxNzI5MzgsInNjb3BlIjpbImRhdGE6d3JpdGUiLCJkYXRhOmNyZWF0ZSIsImRhdGE6cmVhZCJdLCJjbGllbnRfaWQiOiJIQXFEdEtPN1ZidVJnSDBuTDBNRkowQjAyRWxCRUszbCIsImdyYW50X2lkIjoiRGRWdk41TjdCODAycUxaaFE2RktzVWMzRUxCTGQydUgiLCJhdWQiOiJodHRwczovL2F1dG9kZXNrLmNvbS9hdWQvand0ZXhwNjAiLCJqdGkiOiJVNXhTVHBFQXllV1haQnM3elc1eElKMGtFRDBhMlZNbFU1OGF5MWJuV0xMeU9Fb05nNUE2SDRLdDVBNGpnSFRxIn0.UAeCITOgg-QRqgi8O9Ws3Uyk5N10eP51wIWB-CawOf0' -d 'photosceneid=sCn1zSOVLb7mPiKkgFRbkxCOTynOhP78F5EuuqbbYig' -d 'type=obj' -d 'scenetype=object' -d 'gpstype=regular' -d 'file[0]=https://prod.sonautics.com/scans/s1-sample-ear-201802062058/snapshot-2018020621001063.jpg' 2> /tmp/s1-sample-ear-201802062058_20180801172526
Stdout =
{"Usage":"0.80453681945801","Resource":"\/file","Error":{"code":"4","msg":"Not yet implemented"}}
The API examples and Field Guide give me no visibility into what is wrong.
StdErr =
* Hostname was NOT found in DNS cache
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Trying 52.10.62.203...
* Connected to developer.api.autodesk.com (52.10.62.203) port 443 (#0)
* successfully set certificate verify locations:
* CAfile: none
CApath: /etc/ssl/certs
* SSLv3, TLS handshake, Client hello (1):
} [data not shown]
* SSLv3, TLS handshake, Server hello (2):
{ [data not shown]
* SSLv3, TLS handshake, CERT (11):
{ [data not shown]
* SSLv3, TLS handshake, Server key exchange (12):
{ [data not shown]
* SSLv3, TLS handshake, Server finished (14):
{ [data not shown]
* SSLv3, TLS handshake, Client key exchange (16):
} [data not shown]
* SSLv3, TLS change cipher, Client hello (1):
} [data not shown]
* SSLv3, TLS handshake, Finished (20):
} [data not shown]
* SSLv3, TLS change cipher, Client hello (1):
{ [data not shown]
* SSLv3, TLS handshake, Finished (20):
{ [data not shown]
* SSL connection using ECDHE-RSA-AES128-GCM-SHA256
* Server certificate:
* subject: businessCategory=Private Organization; 1.3.6.1.4.1.311.60.2.1.3=US; 1.3.6.1.4.1.311.60.2.1.2=Delaware; serialNumber=2401504; C=US; ST=California; L=San Rafael; O=Autodesk, Inc.; OU=IPG - Core Services; CN=developer.api.autodesk.com
* start date: 2018-03-09 00:00:00 GMT
* expire date: 2019-04-20 12:00:00 GMT
* subjectAltName: developer.api.autodesk.com matched
* issuer: C=US; O=DigiCert Inc; OU=www.digicert.com; CN=DigiCert SHA2 Extended Validation Server CA
* SSL certificate verify ok.
> POST /photo-to-3d/v1/file HTTP/1.1
> User-Agent: curl/7.35.0
> Host: developer.api.autodesk.com
> Accept: */*
> Authorization: Bearer eyJhbGciOiJIUzI1NiIsImtpZCI6Imp3dF9zeW1tZXRyaWNfa2V5In0.eyJ1c2VyaWQiOiJZUlZNSlNFNTdFVzMiLCJleHAiOjE1MzMxNzI5MzgsInNjb3BlIjpbImRhdGE6d3JpdGUiLCJkYXRhOmNyZWF0ZSIsImRhdGE6cmVhZCJdLCJjbGllbnRfaWQiOiJIQXFEdEtPN1ZidVJnSDBuTDBNRkowQjAyRWxCRUszbCIsImdyYW50X2lkIjoiRGRWdk41TjdCODAycUxaaFE2RktzVWMzRUxCTGQydUgiLCJhdWQiOiJodHRwczovL2F1dG9kZXNrLmNvbS9hdWQvand0ZXhwNjAiLCJqdGkiOiJVNXhTVHBFQXllV1haQnM3elc1eElKMGtFRDBhMlZNbFU1OGF5MWJuV0xMeU9Fb05nNUE2SDRLdDVBNGpnSFRxIn0.UAeCITOgg-QRqgi8O9Ws3Uyk5N10eP51wIWB-CawOf0
> Content-Length: 196
> Content-Type: application/x-www-form-urlencoded
>
} [data not shown]
* upload completely sent off: 196 out of 196 bytes
100 196 0 0 100 196 0 152 0:00:01 0:00:01 --:--:-- 152< HTTP/1.1 200 OK
< Content-Type: application/json
< Date: Thu, 02 Aug 2018 00:25:30 GMT
* Server Apache/2.4.6 (CentOS) is not blacklisted
< Server: Apache/2.4.6 (CentOS)
< Set-Cookie: AWSALB=dOqkcEp8OYPvUDA9SW86BUbDR9fMvps1hOy9DgDFHWr3nxHMl8qK/pnc2C6ryLHGUZ3fi8W5ZyIujQaqj/JrW47V+ehxQMsKnIHeK4wZEneIQ/L/2dqfdCY5R+pD; Expires=Thu, 09 Aug 2018 00:25:29 GMT; Path=/
< X-Powered-By: PHP/7.0.30
< Content-Length: 97
< Connection: keep-alive
<
{ [data not shown]
100 293 100 97 100 196 63 127 0:00:01 0:00:01 --:--:-- 127
* Connection #0 to host developer.api.autodesk.com left intact
I tried this initially with multiple files, and got the same error whether I do one file or many.
I think that your curl call is "ill-formed":
curl -v 'https://developer.api.autodesk.com/photo-to-3d/v1/file' \
-X 'POST' \
-H 'Authorization: Bearer '$TOKEN \
-d 'photosceneid=sCn1zSOVLb7mPiKkgFRbkxCOTynOhP78F5EuuqbbYig' \
-d 'type=obj' \
-d 'scenetype=object' \
-d 'gpstype=regular' \
-d 'file[0]='$link
According to documentation for adding files to a photoscene, it accepts as params photosceneid, type(survey or image) and file[].
By providing gpstype, scenetype and wrong type, you get the mentioned error.
Your call should look like:
curl -v 'https://developer.api.autodesk.com/photo-to-3d/v1/file' \
-X 'POST' \
-H 'Authorization: Bearer '$TOKEN \
-d 'photosceneid=sCn1zSOVLb7mPiKkgFRbkxCOTynOhP78F5EuuqbbYig' \
-d 'type=image' \
-d 'file[0]='$link
As before, I highly advice using the Postman along with this collection, to avoid falling into these kind of traps.

Couchbase rebalancing mismatch

I´ve been having a problem after configure my cluster, using cuchbase Rest API, when I want to add new nodes, and then rebalancing.
Here what I´m doing
Create account and cluster for machine A
createAccount(){
ip=$1
curl -s -u ${USER}:${PASSWORD} -X POST http://${ip}:8091/pools/default -d memoryQuota=${QUOTA} }
createCluster(){
ip=$1
# Initialize Node
curl -u ${USER}:${PASSWORD} -v -X POST http://${ip}:8091/nodes/self/controller/settings \
-d 'data_path=%2Fopt%2Fcouchbase%2Fvar%2Flib%2Fcouchbase%2Fdata& \
index_path=%2Fopt%2Fcouchbase%2Fvar%2Flib%2Fcouchbase%2Fdata'
# Rename Node
curl -u ${USER}:${PASSWORD} -v -X POST http://${ip}:8091/node/controller/rename \
-d 'hostname=127.0.0.1'
# Setup Services
curl -u ${USER}:${PASSWORD} -v -X POST http://${ip}:8091/node/controller/setupServices \
-d 'services=kv%2Cn1ql%2Cindex'
# Setup Administrator username and password
curl -u ${USER}:${PASSWORD} -v -X POST http://${ip}:8091/settings/web \
-d "password=$PASSWORD&username=$USER&port=SAME"
}
Create account and cluster for machine B (The same script than above)
Then add server B calling server A
addServer(){
curl -u ${USER}:${PASSWORD} http://A:8091/controller/addNode \
-d "hostname=B&user=$USER&password=$PASSWORD&services=kv%2Cn1ql%2Cindex"
}
Then I can see how in A and B server I have B as pending to rebalancing.
But when I try to rebalance calling A
rebalance(){
masterIp=$1
couchbaseNode=$2
curl -v -u ${USER}:${PASSWORD} -X POST http://A:8091/controller/rebalance \
-d "knownNodes=ns_1#A, ns_1#B"
}
Server returns
{"mismatch":1}
What I´m doing wrong here?
Regards
EDIT:
This is the stack of HTTP to give extra information
First machine
----- CREATING COUCHBASE CLUSTER ON 172.31.35.67
* Trying 172.31.35.67...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Connected to 172.31.35.67 (172.31.35.67) port 8091 (#0)
* Server auth using Basic with user 'Administrator'
> POST /nodes/self/controller/settings HTTP/1.1
> Authorization: Basic QWRtaW5pc3RyYXRvcjpwb2xpdHJvbg==
> User-Agent: curl/7.40.0
> Host: 172.31.35.67:8091
> Accept: */*
> Content-Length: 129
> Content-Type: application/x-www-form-urlencoded
>
} [129 bytes data]
* upload completely sent off: 129 out of 129 bytes
100 129 0 0 100 129 0 107 0:00:01 0:00:01 --:--:-- 107< HTTP/1.1 200 OK
< Server: Couchbase Server
< Pragma: no-cache
< Date: Tue, 27 Sep 2016 09:27:59 GMT
< Content-Length: 0
< Cache-Control: no-cache
<
100 129 0 0 100 129 0 79 0:00:01 0:00:01 --:--:-- 80
* Connection #0 to host 172.31.35.67 left intact
* Trying 172.31.35.67...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Connected to 172.31.35.67 (172.31.35.67) port 8091 (#0)
* Server auth using Basic with user 'Administrator'
> POST /node/controller/rename HTTP/1.1
> Authorization: Basic QWRtaW5pc3RyYXRvcjpwb2xpdHJvbg==
> User-Agent: curl/7.40.0
> Host: 172.31.35.67:8091
> Accept: */*
> Content-Length: 18
> Content-Type: application/x-www-form-urlencoded
>
} [18 bytes data]
* upload completely sent off: 18 out of 18 bytes
< HTTP/1.1 200 OK
< Server: Couchbase Server
< Pragma: no-cache
< Date: Tue, 27 Sep 2016 09:27:59 GMT
< Content-Length: 0
< Cache-Control: no-cache
<
100 18 0 0 100 18 0 5253 --:--:-- --:--:-- --:--:-- 6000
* Connection #0 to host 172.31.35.67 left intact
* Trying 172.31.35.67...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Connected to 172.31.35.67 (172.31.35.67) port 8091 (#0)
* Server auth using Basic with user 'Administrator'
> POST /node/controller/setupServices HTTP/1.1
> Authorization: Basic QWRtaW5pc3RyYXRvcjpwb2xpdHJvbg==
> User-Agent: curl/7.40.0
> Host: 172.31.35.67:8091
> Accept: */*
> Content-Length: 26
> Content-Type: application/x-www-form-urlencoded
>
} [26 bytes data]
* upload completely sent off: 26 out of 26 bytes
< HTTP/1.1 200 OK
< Server: Couchbase Server
< Pragma: no-cache
< Date: Tue, 27 Sep 2016 09:27:59 GMT
< Content-Length: 0
< Cache-Control: no-cache
<
100 26 0 0 100 26 0 3992 --:--:-- --:--:-- --:--:-- 4333
* Connection #0 to host 172.31.35.67 left intact
* Trying 172.31.35.67...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Connected to 172.31.35.67 (172.31.35.67) port 8091 (#0)
* Server auth using Basic with user 'Administrator'
> POST /settings/web HTTP/1.1
> Authorization: Basic QWRtaW5pc3RyYXRvcjpwb2xpdHJvbg==
> User-Agent: curl/7.40.0
> Host: 172.31.35.67:8091
> Accept: */*
> Content-Length: 50
> Content-Type: application/x-www-form-urlencoded
>
} [50 bytes data]
* upload completely sent off: 50 out of 50 bytes
< HTTP/1.1 200 OK
< Server: Couchbase Server
< Pragma: no-cache
< Date: Tue, 27 Sep 2016 09:27:59 GMT
< Content-Type: application/json
< Content-Length: 42
< Cache-Control: no-cache
<
{ [42 bytes data]
Second machine
Trying 172.31.134.213...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Connected to 172.31.134.213 (172.31.134.213) port 8091 (#0)
* Server auth using Basic with user 'Administrator'
> POST /nodes/self/controller/settings HTTP/1.1
> Authorization: Basic QWRtaW5pc3RyYXRvcjpwb2xpdHJvbg==
> User-Agent: curl/7.40.0
> Host: 172.31.134.213:8091
> Accept: */*
> Content-Length: 129
> Content-Type: application/x-www-form-urlencoded
>
} [129 bytes data]
* upload completely sent off: 129 out of 129 bytes
100 129 0 0 100 129 0 107 0:00:01 0:00:01 --:--:-- 107< HTTP/1.1 200 OK
< Server: Couchbase Server
< Pragma: no-cache
< Date: Tue, 27 Sep 2016 09:34:03 GMT
< Content-Length: 0
< Cache-Control: no-cache
<
100 129 0 0 100 129 0 81 0:00:01 0:00:01 --:--:-- 81
* Connection #0 to host 172.31.134.213 left intact
* Trying 172.31.134.213...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Connected to 172.31.134.213 (172.31.134.213) port 8091 (#0)
* Server auth using Basic with user 'Administrator'
> POST /node/controller/rename HTTP/1.1
> Authorization: Basic QWRtaW5pc3RyYXRvcjpwb2xpdHJvbg==
> User-Agent: curl/7.40.0
> Host: 172.31.134.213:8091
> Accept: */*
> Content-Length: 18
> Content-Type: application/x-www-form-urlencoded
>
} [18 bytes data]
* upload completely sent off: 18 out of 18 bytes
< HTTP/1.1 200 OK
< Server: Couchbase Server
< Pragma: no-cache
< Date: Tue, 27 Sep 2016 09:34:03 GMT
< Content-Length: 0
< Cache-Control: no-cache
<
100 18 0 0 100 18 0 1976 --:--:-- --:--:-- --:--:-- 2000
* Connection #0 to host 172.31.134.213 left intact
* Trying 172.31.134.213...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Connected to 172.31.134.213 (172.31.134.213) port 8091 (#0)
* Server auth using Basic with user 'Administrator'
> POST /node/controller/setupServices HTTP/1.1
> Authorization: Basic QWRtaW5pc3RyYXRvcjpwb2xpdHJvbg==
> User-Agent: curl/7.40.0
> Host: 172.31.134.213:8091
> Accept: */*
> Content-Length: 26
> Content-Type: application/x-www-form-urlencoded
>
} [26 bytes data]
* upload completely sent off: 26 out of 26 bytes
< HTTP/1.1 200 OK
< Server: Couchbase Server
< Pragma: no-cache
< Date: Tue, 27 Sep 2016 09:34:03 GMT
< Content-Length: 0
< Cache-Control: no-cache
<
100 26 0 0 100 26 0 9626 --:--:-- --:--:-- --:--:-- 13000
* Connection #0 to host 172.31.134.213 left intact
* Trying 172.31.134.213...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Connected to 172.31.134.213 (172.31.134.213) port 8091 (#0)
* Server auth using Basic with user 'Administrator'
> POST /settings/web HTTP/1.1
> Authorization: Basic QWRtaW5pc3RyYXRvcjpwb2xpdHJvbg==
> User-Agent: curl/7.40.0
> Host: 172.31.134.213:8091
> Accept: */*
> Content-Length: 50
> Content-Type: application/x-www-form-urlencoded
>
} [50 bytes data]
* upload completely sent off: 50 out of 50 bytes
< HTTP/1.1 200 OK
< Server: Couchbase Server
< Pragma: no-cache
< Date: Tue, 27 Sep 2016 09:34:03 GMT
< Content-Type: application/json
< Content-Length: 44
< Cache-Control: no-cache
<
{ [44 bytes data]
100 94 100 44 100 50 15422 17525 --:--:-- --:--:-- --:--:-- 25000
* Connection #0 to host 172.31.134.213 left intact
{"newBaseUri":"http://172.31.134.213:8091/"}----- ADD NODE 172.31.134.213 IN COUCHBASE CLUSTER 172.31.35.67
masterID:172.31.35.67
node:172.31.134.213
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 87 0 0 100 87 0 55769 --:--:-- --:--:-- --:--:-- 43500
32 268 0 0 100 87 0 81 0:00:01 0:00:01 --:--:-- 81
100 268 100 181 100 87 169 81 0:00:01 0:00:01 --:--:-- 169
["Join completion call failed. Got HTTP status 500 from REST call post to http://172.31.134.213:8091/completeJoin. Body was: \"[\\\"Unexpected server error, request logged.\\\"]\""]----- REBALANCING NODE 172.31.134.213 IN COUCHBASE CLUSTER 172.31.35.67
* Trying 172.31.35.67...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Connected to 172.31.35.67 (172.31.35.67) port 8091 (#0)
* Server auth using Basic with user 'Administrator'
> POST /controller/rebalance HTTP/1.1
> Authorization: Basic QWRtaW5pc3RyYXRvcjpwb2xpdHJvbg==
> User-Agent: curl/7.40.0
> Host: 172.31.35.67:8091
> Accept: */*
> Content-Length: 30
> Content-Type: application/x-www-form-urlencoded
>
} [30 bytes data]
* upload completely sent off: 30 out of 30 bytes
< HTTP/1.1 400 Bad Request
< Server: Couchbase Server
< Pragma: no-cache
< Date: Tue, 27 Sep 2016 09:34:04 GMT
< Content-Type: application/json
< Content-Length: 14
< Cache-Control: no-cache
<
{ [14 bytes data]
100 44 100 14 100 30 11965 25641 --:--:-- --:--:-- --:--:-- 30000
* Connection #0 to host 172.31.35.67 left intact
{"mismatch":1}
As you can see the last request fail with a 400 code
In the knownNodes list, remove the spaces between the nodes. I was able to replicate it. With the spaces, {"mismatch":1}. Without the spaces, it works.
I have opened a bug on the documentation on this issue.

Box API returns 404 error for folder collaborated or shared by outside user

Have a situation where an outside user collaborates or shares a folder with a enterprise user. API call impersonating the enterprise user returns a 404 error. Please see the http exchange below using curl. Some sensitive information is masked. Appreciate any help.
curl -k -v -H "Authorization: Bearer XXXXXXXXXXXXXXXXXXXX" -H "As-User: 2146XXXXX" https://api.box.com/2.0/folders/1834XXXXXX
* About to connect() to api.box.com port 443 (#0)
* Trying 74.112.185.97... connected
> GET /2.0/folders/1834XXXXXX HTTP/1.1
> User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3
> Host: api.box.com
> Accept: */*
> Authorization: Bearer XXXXXXXXXXXXXXXXXXXX
> As-User: 2146XXXXX
>
< HTTP/1.1 404 Not Found
< Server: nginx
< Date: Wed, 16 Apr 2014 00:34:58 GMT
< Content-Type: application/json
< Content-Length: 323
< Connection: keep-alive
< Cache-Control: no-cache, no-store
<
* Connection #0 to host api.box.com left intact
* Closing connection #0
* SSLv3, TLS alert, Client hello (1):
{"type":"error","status":404,"code":"not_found","context_info":{"errors": [{"reason":"invalid_parameter","name":"item","message":"Invalid value 'd_1834XXXXXX'. 'item' with value 'd_1834XXXXXX' not found"}]},"help_url":"http:\/\/developers.box.com\/docs\/#errors","message":"Not Found","request_id":"1378003773534dd03193806"}