Build 901 smuggler restore into instance bug

94 views
Skip to first unread message

nabils

unread,
Apr 30, 2012, 2:39:30 AM4/30/12
to rav...@googlegroups.com
I am not able to restore using smuggler into a db instance other than the default. It does not pick up the switch properly. I am using unstable 901. Is this a known bug?

Oren Eini (Ayende Rahien)

unread,
Apr 30, 2012, 2:44:46 AM4/30/12
to rav...@googlegroups.com
What is the full command you are using?

Phil Jones

unread,
Apr 30, 2012, 6:23:47 AM4/30/12
to ravendb
Experiencing a similar issue with 917 though.


Raven.Smuggler.exe in http://localhost:8080/ 30-4-2012.raven -d Escape

Results in docs going into default

Raven.Smuggler.exe in http://localhost:8080/databases/Escape
30-4-2012.raven

Results in docs going into Escape

Raven.Smuggler.exe in http://localhost:8080/ 30-4-2012.raven -d Escape
-u Phil ...etc....

Results in 401

On Apr 30, 7:44 am, "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
wrote:
> What is the full command you are using?
>
> On Mon, Apr 30, 2012 at 9:39 AM, nabils
> <alt%shuhaiber....@gtempaccount.com>wrote:

nabils

unread,
Apr 30, 2012, 7:23:24 AM4/30/12
to rav...@googlegroups.com
Yes that is pretty much it. I tried all sorts of combinations but none worked.

In the end I had to do the restore manually :(

Oren Eini (Ayende Rahien)

unread,
Apr 30, 2012, 10:55:43 AM4/30/12
to rav...@googlegroups.com
It is actually:
Raven.Smuggler.exe in http://localhost:8080/ 30-4-2012.raven -d=Escape

Note the -database=Escape, not -database Escape

nabils

unread,
Apr 30, 2012, 11:13:34 AM4/30/12
to rav...@googlegroups.com
Ok tried the following and got the below error:

Raven.Smuggler.exe in http://localhost:8080 dump.raven -d=Test

System.InvalidOperationException: Could not parse json:

<html>
        <body>
                <h1>Could not figure out what to do</h1>
                <p>Your request didn't match anything that Raven knows to do, so
rry...</p>
        </body>
</html>
 ---> Newtonsoft.Json.JsonReaderException: Unexpected character encountered whil
e parsing value: <. Line 2, position 1.
   at Newtonsoft.Json.JsonTextReader.ParseValue() in d:\Development\Releases\Jso
n\Working\Src\Newtonsoft.Json\JsonTextReader.cs:line 1117
   at Newtonsoft.Json.JsonTextReader.ReadInternal() in d:\Development\Releases\J
son\Working\Src\Newtonsoft.Json\JsonTextReader.cs:line 557
   at Raven.Json.Linq.RavenJObject.Load(JsonReader reader) in c:\Builds\RavenDB-
Unstable\Raven.Abstractions\Json\Linq\RavenJObject.cs:line 149
   at Raven.Json.Linq.RavenJObject.Parse(String json) in c:\Builds\RavenDB-Unsta
ble\Raven.Abstractions\Json\Linq\RavenJObject.cs:line 232
   --- End of inner exception stack trace ---
   at Raven.Json.Linq.RavenJObject.Parse(String json) in c:\Builds\RavenDB-Unsta
ble\Raven.Abstractions\Json\Linq\RavenJObject.cs:line 238
   at Raven.Abstractions.Connection.HttpRavenRequest.SendRequestToServer(Action`
1 action) in c:\Builds\RavenDB-Unstable\Raven.Abstractions\Connection\HttpRavenR
equest.cs:line 183
   at Raven.Abstractions.Connection.HttpRavenRequest.ExecuteRequest() in c:\Buil
ds\RavenDB-Unstable\Raven.Abstractions\Connection\HttpRavenRequest.cs:line 153
   at Raven.Smuggler.SmugglerApi.EnsureDatabaseExists() in c:\Builds\RavenDB-Uns
table\Raven.Smuggler\SmugglerApi.cs:line 372
   at Raven.Smuggler.SmugglerApi.ImportData(Stream stream, SmugglerOptions optio
ns) in c:\Builds\RavenDB-Unstable\Raven.Smuggler\SmugglerApi.cs:line 183
   at Raven.Smuggler.SmugglerApi.ImportData(SmugglerOptions options) in c:\Build
s\RavenDB-Unstable\Raven.Smuggler\SmugglerApi.cs:line 177
   at Raven.Smuggler.Program.Parse(String[] args) in c:\Builds\RavenDB-Unstable\
Raven.Smuggler\Program.cs:line 110

Oren Eini (Ayende Rahien)

unread,
Apr 30, 2012, 11:15:21 AM4/30/12
to rav...@googlegroups.com
Can you provide a fiddler capture?

Oren Eini (Ayende Rahien)

unread,
Apr 30, 2012, 11:21:37 AM4/30/12
to rav...@googlegroups.com
Just some details:

Trying to export from a non existing database:

C:\work\ravendb\build [master +0 ~2 -0]> .\Raven.Smuggler.exe out http://localhost:8080 test.dump -d=Escape
System.Net.WebException: Error: Could not find a database named: Escape ---> System.Net.WebException: The remote server
returned an error: (400) Bad Request.
   at System.Net.HttpWebRequest.GetResponse()
   at Raven.Abstractions.Connection.HttpRavenRequest.SendRequestToServer(Action`1 action) in c:\Work\ravendb\Raven.Abstr
actions\Connection\HttpRavenRequest.cs:line 163
   --- End of inner exception stack trace ---
   at Raven.Abstractions.Connection.HttpRavenRequest.SendRequestToServer(Action`1 action) in c:\Work\ravendb\Raven.Abstr
actions\Connection\HttpRavenRequest.cs:line 184
   at Raven.Abstractions.Connection.HttpRavenRequest.ExecuteRequest(Action`1 action) in c:\Work\ravendb\Raven.Abstractio
ns\Connection\HttpRavenRequest.cs:line 130
   at Raven.Smuggler.SmugglerApi.ExportIndexes(JsonTextWriter jsonWriter) in c:\Work\ravendb\Raven.Smuggler\SmugglerApi.
cs:line 145
   at Raven.Smuggler.SmugglerApi.ExportData(SmugglerOptions options, Boolean incremental) in c:\Work\ravendb\Raven.Smugg
ler\SmugglerApi.cs:line 101
   at Raven.Smuggler.Program.Parse(String[] args) in c:\Work\ravendb\Raven.Smuggler\Program.cs:line 122

Trying to export from an existing database:

C:\work\ravendb\build [master +0 ~2 -0]> .\Raven.Smuggler.exe out http://localhost:8080 test.dump -d=tea
Reading batch of   1 indexes, read so far:          1
Done with reading indexes, total: 1
Reading batch of   1 documents, read so far:          1
Done with reading documents, total: 1
Done with reading attachments, total: 0

nabils

unread,
Apr 30, 2012, 11:23:07 AM4/30/12
to rav...@googlegroups.com
I sent the fiddler capture by email.

Itamar Syn-Hershko

unread,
May 1, 2012, 12:34:57 PM5/1/12
to rav...@googlegroups.com
We confirmed this to be a bug with the smuggler API, should be fixed in the next build

The quickfix is to use 

Raven.Smuggler.exe in http://server:8080/databases/Test dump.raven 

Instead of

Raven.Smuggler.exe in http://server:8080 dump.raven -d=Test
Reply all
Reply to author
Forward
0 new messages