Importing JSON databases through the REST API #25
Comments
The documentation around this is extremely scarce (it's here) and slightly confusing (e.g., it says to Let's assume I connected to the curl --user root:root -X GET 'http://localhost:2480/connect/MarcoPoloTest' \
-H 'Accept-Encoding: gzip,deflate' and that I wrote down the Let's assume we have a file called curl --user root:root -X GET 'http://localhost:2480/export/MarcoPoloTest' \
-H 'Accept-Encoding: gzip,deflate' \
-H 'Content-Type: application/json' \
--cookie 'OSESSIONID=...' \
> db.gzip Then, let's assume I've unzipped curl -v --user root:root -X GET 'http://localhost:2480/connect/ImportDest' \
-H 'Accept-Encoding: gzip,deflate' HTTP/1.1 204 OK
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Date: Fri Mar 11 13:30:53 CET 2016
Content-Type: text/plain; charset=utf-8
Server: OrientDB Server v.2.2.0-beta (build develop@r4cbc24a66f17f023a2e59da300a29b91fdb5d1fa; 2016-02-22 17:46:44+0000)
Connection: Keep-Alive
Set-Cookie: OSESSIONID=OS1457699453268-4591488868473251284; Path=/; HttpOnly
Content-Length: 0 If I make a curl -v --user root:root -X POST 'http://localhost:2480/import/ImportDest' \
-H 'Accept-Encoding: gzip,deflate' \
-H 'Content-Type: application/json' \
--cookie 'OSESSIONID=OS1457699453268-4591488868473251284' \
-d @db HTTP/1.1 405 Request is not multipart/form-data
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Date: Fri Mar 11 13:32:53 CET 2016
Content-Type: text/plain; charset=utf-8
Server: OrientDB Server v.2.2.0-beta (build develop@r4cbc24a66f17f023a2e59da300a29b91fdb5d1fa; 2016-02-22 17:46:44+0000)
Connection: Keep-Alive
Set-Cookie: OSESSIONID=OS1457699453268-4591488868473251284; Path=/; HttpOnly
Content-Length: 34
Request is not multipart/form-data If I do what the error message suggests and change the content-type to curl -v -X POST 'http://localhost:2480/import/ImportDest' \
-H 'Accept-Encoding: gzip,deflate' \
--cookie 'OSESSIONID=OS1457703457177-2218910698106246248' \
-F file=@db HTTP/1.1 405 Wrong request: Expected CR/LF
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Date: Fri Mar 11 14:40:14 CET 2016
Content-Type: text/plain; charset=utf-8
Server: OrientDB Server v.2.2.0-beta (build develop@r4cbc24a66f17f023a2e59da300a29b91fdb5d1fa; 2016-02-22 17:46:44+0000)
Connection: Keep-Alive
Set-Cookie: OSESSIONID=OS1457703457177-2218910698106246248; Path=/; HttpOnly
Content-Length: 29
* HTTP error before end of send, stop sending
Wrong request: Expected CR/LF This error should come from here. Apparently, the import does something on the server. This is the server log:
but the actual import doesn't seem to work as I can't see the classes from This is taking me a quite long time, so it would be super-nice if someone from @MyMedsAndMe/voyagers could help in finding a |
Hey Andrea, There is a request open for this issue: It suppose to be fixed in OrientDB 2.2 Beta which is available here: |
Hey @yelps, I assumed this wasn't related to the |
Oh, I see. Then it's probably best to ask the support team of Orient Technologies. |
I managed to reproduce the same error: curl --user root:secret -X POST 'http://localhost:2480/import/demo_db' \
-H 'Accept-Encoding: gzip,deflate' \
-H 'Content-Type: multipart/form-data' \
--cookie 'OSESSIONID=OS1457699453268-4591488868473251284; Path=/; HttpOnly' \
--form "filename=@db.gzip"
I tried decompressing the gzip file, converting LF to CR LF while recompressing it, but still no luck. Anyway I think this is something that should be addressed in the OrientDB repo, as I would expect the REST API to be able to accept |
@simonewebdesign absolutely, it makes much more sense to POST a JSON database as just JSON binary with |
This is on hold waiting for @tglman to let us know when a release including the changes described in orientechnologies/orientdb#5837 and implemented in orientechnologies/orientdb@253e3cf will be released in a new OrientDB 2.2 beta version. |
OrientDB 2.2 beta2 has been released. |
This was hopefully implemented in e567aef. I don't fully trust the OrientDB side yet, but I think we're doing everything right on the client (MarcoPolo) side, so I'm gonna close this for now. |
No description provided.
The text was updated successfully, but these errors were encountered: