Replication issues

110 views
Skip to first unread message

Media Lab

unread,
Dec 8, 2016, 8:41:49 AM12/8/16
to RavenDB - 2nd generation document database
We have 2 servers with Raven on them. Both have licenses for replication.

On server 1, we have a table - ApiLogging with replication enabled and a destination to server 2 and vice versa on server 2.

We use API keys for this, and each server has the other server's correct replication key that's marked for Read/Write access to *

On either server, I see this document
{
    "Destinations": [
        {
            "Url": "http://server2",
            "Username": null,
            "Password": null,
            "Domain": null,
            "ApiKey": "RavenReplication/xxxxxxxxxxxx",
            "Database": "ApiLogging",
            "TransitiveReplicationBehavior": "Replicate",
            "IgnoredClient": false,
            "Disabled": false,
            "ClientVisibleUrl": null,
            "SkipIndexReplication": false,
            "SpecifiedCollections": {}
        }
    ],
    "Source": "33d28b1c-81fd-4e43-bf77-fa0bae823b47",
    "ClientConfiguration": {}
}

and this in the confi
    "Id": "ApiLogging",
    "Settings": {
        "Raven/ActiveBundles": "DocumentExpiration,Replication",
        "Raven/DataDir": "~/ApiLogging"
    },
    "SecuredSettings": {},
    "Disabled": false
}

However, both servers complain that replication is not enabled

{
  "Error": "replication bundle not activated in database named: ApiLogging"
}

I have replication working on a FS and another DB on both boxes. I've had trouble getting replication to work so I removed all replication and started adding them back one by one. Now I'm stuck again.

As a side note, trying to get replication topology on server 1 throws a 500 error
{
  "Url": "/admin/replication/topology/global",
  "Error": "System.InvalidOperationException: Couldn't locate ReplicationTask\r\n   at Raven.Database.Bundles.Replication.Impl.ReplicationTopologyDiscoverer..ctor(DocumentDatabase database, RavenJArray from, Int32 ttl, ILog log)\r\n   at Raven.Database.Server.Controllers.Admin.AdminController.<>c__DisplayClass53_0.<CollectReplicationTopology>b__0(DocumentDatabase db)\r\n   at Raven.Database.Server.Tenancy.DatabasesLandlord.ForAllDatabases(Action`1 action, Boolean excludeSystemDatabase)\r\n   at Raven.Database.Server.Controllers.Admin.AdminController.CollectReplicationTopology()\r\n   at Raven.Database.Server.Controllers.Admin.AdminController.<GlobalReplicationTopology>d__52.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Threading.Tasks.TaskHelpersExtensions.<CastToObject>d__3`1.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__0.MoveNext()"
}

So something looks screwy somewhere.


Idan Haim

unread,
Dec 8, 2016, 11:48:30 AM12/8/16
to RavenDB - 2nd generation document database
What version of ravendb you are using?

Media Lab

unread,
Dec 8, 2016, 11:49:56 AM12/8/16
to RavenDB - 2nd generation document database
35180

Idan Haim

unread,
Dec 8, 2016, 12:05:48 PM12/8/16
to RavenDB - 2nd generation document database
Can you please send me screen image of both
databases Raven/Replication/Destinations

and make sure database replication is really enable

Idan Haim

unread,
Dec 8, 2016, 12:11:11 PM12/8/16
to RavenDB - 2nd generation document database
For extra can you open 2 new database and test replication on them 
Thank you

Oren Eini (Ayende Rahien)

unread,
Dec 8, 2016, 3:34:04 PM12/8/16
to ravendb
The actual error indicates that the destination db doesn't have the replciation bundle setup.

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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Media Lab

unread,
Dec 8, 2016, 3:35:27 PM12/8/16
to RavenDB - 2nd generation document database
It *did* though.

I deleted the DB off Server 1 (left the files) and 're added' it back and it magically started working.


On Thursday, December 8, 2016 at 3:34:04 PM UTC-5, Oren Eini wrote:
The actual error indicates that the destination db doesn't have the replciation bundle setup.

Hibernating Rhinos Ltd  

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

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

 


On Thu, Dec 8, 2016 at 7:11 PM, Idan Haim <id...@ravendb.net> wrote:
For extra can you open 2 new database and test replication on them 
Thank you


On Thursday, December 8, 2016 at 7:05:48 PM UTC+2, Idan Haim wrote:
Can you please send me screen image of both
databases Raven/Replication/Destinations

and make sure database replication is really enable

--
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.

Oren Eini (Ayende Rahien)

unread,
Dec 8, 2016, 3:35:55 PM12/8/16
to ravendb
The actual error is likely here:

        "Raven/ActiveBundles": "DocumentExpiration,Replication",


The seprator here is semi colon, not comma, should be:

        "Raven/ActiveBundles": "DocumentExpiration;Replication",

Media Lab

unread,
Dec 8, 2016, 3:39:51 PM12/8/16
to RavenDB - 2nd generation document database
*facepalm*

This is why there's a HUGE RED ALERT telling you manually doing this is bad for your health.

The problem is we didn't have these bundles activated when we created the data & had to activate them afterwards.

I live in .Net. Isn't the first time a semicolon kicked my butt.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.

Jahmai Lay

unread,
Dec 8, 2016, 6:28:03 PM12/8/16
to RavenDB - 2nd generation document database

This has bitten me too, PR to support both separators? :)
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.

Grisha Kotler

unread,
Dec 8, 2016, 6:28:31 PM12/8/16
to rav...@googlegroups.com
Note that you can't activate the replication bundle after the creation of the database (unless you are using RavenDB 3.5)

Hibernating Rhinos Ltd  cid:image001.png@01CF95E2.8ED1B7D0

Grisha Kotler l RavenDB Core Team Developer Mobile: +972-54-586-8647

RavenDB paving the way to "Data Made Simplehttp://ravendb.net/


To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.

Oren Eini (Ayende Rahien)

unread,
Dec 9, 2016, 6:58:10 AM12/9/16
to ravendb
No, this is an unsupported operation to start with. 
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.

Media Lab

unread,
Dec 9, 2016, 7:52:21 AM12/9/16
to RavenDB - 2nd generation document database
We are, so it did work.

However, what would be the correct way to take an existing db and add a bundle? Does deleting it (leaving the files) and recreating it with the appropriate settings keep everything exactly how it was, data wise, but activates the bundle?

Oren Eini (Ayende Rahien)

unread,
Dec 9, 2016, 9:42:04 AM12/9/16
to ravendb
No, that isn't supported either.
The proper way to do it is to export the data, recreate the db and import the data
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.

Jahmai Lay

unread,
Dec 11, 2016, 7:01:47 PM12/11/16
to RavenDB - 2nd generation document database

What? Custom bundles?

Media Lab

unread,
Dec 12, 2016, 12:41:10 PM12/12/16
to RavenDB - 2nd generation document database
AHA! I just found out this wasn't me! 

I went to a Db that didn't have replication and used Studio to turn it on and this happened

No replication


I clicked this link and...


Raven added the , instead of a ;





On Thursday, December 8, 2016 at 3:35:55 PM UTC-5, Oren Eini wrote:
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.

Oren Eini (Ayende Rahien)

unread,
Dec 13, 2016, 6:44:39 AM12/13/16
to ravendb
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages