Oh, Migration tool - I hate ye! (Just for the moment ...)

46 views
Skip to first unread message

Brian Schau

unread,
Aug 25, 2015, 5:03:19 PM8/25/15
to RavenDB - 2nd generation document database
Build #3780 on all systems ...

Migrating attachments on my development PC from the database to a filesstore - works.  Yay!
Migrating attachments on our test rig from the database to a filesstore - works.  Double yay!
Migration attachments on our production system from the database to a filesstore ... kaboom:

C:\RavenDB\Migration>Raven.Migration.exe http://localhost:8080/ --database=MyDatabase --filesystem=MyFS --delete-copied-attachments
System.NullReferenceException: Object reference not set to an instance of an object.
   at Raven.Migration.MigrationTasks.CopyAttachmentsToFileSystem.Execute() in c:\Builds\RavenDB-3.0-Unstable\Raven.Migration\MigrationTasks\CopyAttachmentsToFileSystem.cs:line 52
   at Raven.Migration.Program.Parse(String[] args) in c:\Builds\RavenDB-3.0-Unstable\Raven.Migration\Program.cs:line 94

... apparently the attachmentInfo.Key is null ...

It's 11 o'clock in the evening - this is a bad time for this kind of problem to happen ...   :-)


/brian

Oren Eini (Ayende Rahien)

unread,
Aug 25, 2015, 5:09:44 PM8/25/15
to ravendb
Are you sure that you are using Raven.Migration 3780? The NRE there is because the attachmentInfo is null, and that was fixed three weeks ago

Hibernating Rhinos Ltd  

Oren Eini l CEO Mobile: + 972-52-548-6969

Office: +972-4-622-7811 l Fax: +972-153-4-622-7811

 


--
You received this message because you are subscribed to the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Brian Schau

unread,
Aug 25, 2015, 5:23:31 PM8/25/15
to RavenDB - 2nd generation document database
Yes.  I am aware of that - I raised the issue :-)

But - apparently our database contains "broken" attachments - this is what seems to save the day for me:

		var attachment = commands.GetAttachment(attachmentInfo.Key);
		if (attachment == null)
			continue;


... the last two lines makes the process go on ...    At least from getting absolutely no percentage output to (currently) 3%:

C:\Users\Administrator\Desktop\Debug>Raven.Migration.exe http://localhost:8080/ --database=MyDB --filesystem=MyFS --delete-copied-attachments

System.NullReferenceException: Object reference not set to an instance of an object.
   at Raven.Migration.MigrationTasks.CopyAttachmentsToFileSystem.Execute() in c:\Users\Brian Schau\Desktop\ravendb-build-3780\Raven.Migration\MigrationTasks\CopyAttachmentsToFileSystem.cs:line 54
   at Raven.Migration.Program.Parse(String[] args) in c:\Users\Brian Schau\Desktop\ravendb-build-3780\Raven.Migration\Program.cs:line 94

C:\Users\Administrator\Desktop\Debug>Raven.Migration.exe http://localhost:8080/ --database=MyDB --filesystem=MyFS --delete-copied-attachments
Copied 128 attachments (1 %)
Copied 256 attachments (2 %)
Copied 384 attachments (3 %)

(I hope the patient will pull through :-)


/brian
Reply all
Reply to author
Forward
0 new messages