Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exchange creation failing if local address overridden #29

Closed
johnsimons opened this issue Apr 28, 2014 · 14 comments
Closed

Exchange creation failing if local address overridden #29

johnsimons opened this issue Apr 28, 2014 · 14 comments
Milestone

Comments

@johnsimons
Copy link
Member

Who's affected

All users overriding the local address of the endpoint

Symptoms

The endpoint fails when subscribing throwing the following exception:

RabbitMQ.Client.Exceptions.OperationInterruptedException: The AMQP operation was interrupted: AMQP close-reason, initiated by Peer, code=404, text="NOT_FOUND - no exchange 'PubSub.Subscriber1.WhenPublishingAnEventWithOverriddenLocalAddress.RabbitMQ' in vhost '/'", classId=40, methodId=30, cause=
   at RabbitMQ.Client.Impl.SimpleBlockingRpcContinuation.GetReply()
   at RabbitMQ.Client.Impl.ModelBase.ModelRpc(MethodBase method, ContentHeaderBase header, Byte[] body)
   at RabbitMQ.Client.Framing.Impl.v0_9_1.Model._Private_ExchangeBind(String destination, String source, String routingKey, Boolean nowait, IDictionary`2 arguments)
   at RabbitMQ.Client.Impl.ModelBase.ExchangeBind(String destination, String source, String routingKey)
   at NServiceBus.Transports.RabbitMQ.Routing.ConventionalRoutingTopology.SetupSubscription(IModel channel, Type type, String subscriberName) in c:\Projects\NServiceBus.RabbitMQ\src\NServiceBus.RabbitMQ\Routing\ConventionalRoutingTopology.cs:line 34
   at NServiceBus.Transports.RabbitMQ.RabbitMqSubscriptionManager.Subscribe(Type eventType, Address publisherAddress) in c:\Projects\NServiceBus.RabbitMQ\src\NServiceBus.RabbitMQ\RabbitMqSubscriptionManager.cs:line 18
   at NServiceBus.Unicast.UnicastBus.Subscribe(Type messageType, Predicate`1 condition) in y:\BuildAgent\work\31f8c64a6e8a2d7c\src\NServiceBus.Core\Unicast\UnicastBus.cs:line 390
   at NServiceBus.Unicast.UnicastBus.Subscribe(Type messageType) in y:\BuildAgent\work\31f8c64a6e8a2d7c\src\NServiceBus.Core\Unicast\UnicastBus.cs:line 343
   at NServiceBus.Unicast.UnicastBus.Subscribe[T]() in y:\BuildAgent\work\31f8c64a6e8a2d7c\src\NServiceBus.Core\Unicast\UnicastBus.cs:line 334
@johnsimons johnsimons added the bug label Apr 28, 2014
@johnsimons
Copy link
Member Author

Also, this is causing the acceptance tests to hang.
So should we try/catch it?

@andreasohlund
Copy link
Member

I think the test is wrong, since Rabbit needs to use the endpoint name during initalization we can't change it after:

https://github.com/Particular/NServiceBus/blob/badc5717bc2393b5e85dd55a02254fef74cd22af/src/NServiceBus.AcceptanceTests/PubSub/When_publishing_an_event_with_overridden_local_address.cs#L40

I say we modify the test to use IWantToRunBeforeConfiguration instead

@yvesgoeleven
Copy link
Contributor

We can try, but not sure it will fit the order for ASB's case.

@andreasohlund
Copy link
Member

@yvesgoeleven ok, lets see if this breaks ASB instead :(

That said overriding local address seems like a think we want to do as early as possible?

@andreasohlund andreasohlund reopened this Apr 28, 2014
@yvesgoeleven
Copy link
Contributor

Not sure what the current situation is, but in the past getting timing for this setting right was a big pita as it was initialized rather late (and changed quite a few times over the past years)

@johnsimons
Copy link
Member Author

Have just tried the fix with IWantToRunBeforeConfiguration and still no good.
I'm commenting out this test in the core till it actually works correctly against Rabbit

@andreasohlund
Copy link
Member

Hmm, pretty sure it did work on the buildserver?

On Tue, Apr 29, 2014 at 9:46 AM, John Simons notifications@github.comwrote:

Have just tried the fix with IWantToRunBeforeConfiguration and still no
good.
I'm commenting out this test in the core till it actually works correctly
against Rabbit

Reply to this email directly or view it on GitHubhttps://github.com//issues/29#issuecomment-41649505
.

@johnsimons
Copy link
Member Author

Nope it fails locally for me, try it on your machine

On Tuesday, April 29, 2014, Andreas Öhlund notifications@github.com wrote:

Hmm, pretty sure it did work on the buildserver?

On Tue, Apr 29, 2014 at 9:46 AM, John Simons <notifications@github.comjavascript:_e(%7B%7D,'cvml','notifications@github.com');

wrote:

Have just tried the fix with IWantToRunBeforeConfiguration and still no
good.
I'm commenting out this test in the core till it actually works correctly
against Rabbit

Reply to this email directly or view it on GitHub<
#29 (comment)

.

Reply to this email directly or view it on GitHubhttps://github.com//issues/29#issuecomment-41661826
.

@johnsimons
Copy link
Member Author

@andreasohlund did u test this?

This is the exception I get locally:

RabbitMQ - Started @ 30/04/2014 9:03:04 AM
Failed to unload appdomain PubSub.Publisher.WhenPublishingAnEventWithOverriddenLocalAddress.RabbitMQ, reason: System.CannotUnloadAppDomainException: Error while unloading appdomain. (Exception from HRESULT: 0x80131015)
   at System.AppDomain.Unload(AppDomain domain)
   at NServiceBus.AcceptanceTesting.Support.ScenarioRunner.<UnloadAppDomains>b__17(ActiveRunner runner) in c:\BuildAgent\work\31f8c64a6e8a2d7c\src\NServiceBus.AcceptanceTesting\Support\ScenarioRunner.cs:line 197
Failed to unload appdomain PubSub.Subscriber1.WhenPublishingAnEventWithOverriddenLocalAddress.RabbitMQ, reason: System.CannotUnloadAppDomainException: Error while unloading appdomain. (Exception from HRESULT: 0x80131015)
   at System.AppDomain.Unload(AppDomain domain)
   at NServiceBus.AcceptanceTesting.Support.ScenarioRunner.<UnloadAppDomains>b__17(ActiveRunner runner) in c:\BuildAgent\work\31f8c64a6e8a2d7c\src\NServiceBus.AcceptanceTesting\Support\ScenarioRunner.cs:line 197
RabbitMQ - Finished @ 30/04/2014 9:03:39 AM
Test run aborted due to test failures
------------------------------------------------------
Test summary for: RabbitMQ


Using settings:
   Transport: NServiceBus.RabbitMQ, NServiceBus.Transports.RabbitMQ, Version=1.2.0.0, Culture=neutral, PublicKeyToken=9fc386479f8a226c
   Transport.ConnectionString: host=localhost



Endpoints:
     - PubSub.Publisher.WhenPublishingAnEventWithOverriddenLocalAddress.RabbitMQ
     - PubSub.Subscriber1.WhenPublishingAnEventWithOverriddenLocalAddress.RabbitMQ
Test failed: System.AggregateException: One or more errors occurred. ---> NServiceBus.AcceptanceTesting.Support.ScenarioException: Endpoint failed to start ---> RabbitMQ.Client.Exceptions.OperationInterruptedException: The AMQP operation was interrupted: AMQP close-reason, initiated by Peer, code=404, text="NOT_FOUND - no exchange 'PubSub.Subscriber1.WhenPublishingAnEventWithOverriddenLocalAddress.RabbitMQ' in vhost '/'", classId=40, methodId=30, cause=
   at RabbitMQ.Client.Impl.SimpleBlockingRpcContinuation.GetReply()
   at RabbitMQ.Client.Impl.ModelBase.ModelRpc(MethodBase method, ContentHeaderBase header, Byte[] body)
   at RabbitMQ.Client.Framing.Impl.v0_9_1.Model._Private_ExchangeBind(String destination, String source, String routingKey, Boolean nowait, IDictionary`2 arguments)
   at RabbitMQ.Client.Impl.ModelBase.ExchangeBind(String destination, String source, String routingKey)
   at NServiceBus.Transports.RabbitMQ.Routing.ConventionalRoutingTopology.SetupSubscription(IModel channel, Type type, String subscriberName) in c:\Projects\NServiceBus.RabbitMQ\src\NServiceBus.RabbitMQ\Routing\ConventionalRoutingTopology.cs:line 33
   at NServiceBus.Transports.RabbitMQ.RabbitMqSubscriptionManager.Subscribe(Type eventType, Address publisherAddress) in c:\Projects\NServiceBus.RabbitMQ\src\NServiceBus.RabbitMQ\RabbitMqSubscriptionManager.cs:line 18
   at NServiceBus.Unicast.UnicastBus.Subscribe(Type messageType, Predicate`1 condition) in y:\BuildAgent\work\31f8c64a6e8a2d7c\src\NServiceBus.Core\Unicast\UnicastBus.cs:line 390
   at NServiceBus.Unicast.UnicastBus.Subscribe(Type messageType) in y:\BuildAgent\work\31f8c64a6e8a2d7c\src\NServiceBus.Core\Unicast\UnicastBus.cs:line 343
   at NServiceBus.Unicast.UnicastBus.Subscribe[T]() in y:\BuildAgent\work\31f8c64a6e8a2d7c\src\NServiceBus.Core\Unicast\UnicastBus.cs:line 334
   at NServiceBus.AcceptanceTests.PubSub.When_publishing_an_event_with_overridden_local_address.<Should_be_delivered_to_all_subscribers>b__4(IBus bus, Context context) in c:\Projects\NServiceBus.RabbitMQ\src\NServiceBus.RabbitMQ.AcceptanceTests\App_Packages\NServiceBus.AcceptanceTests\PubSub\When_publishing_an_event_with_overridden_local_address.cs:line 28
   at NServiceBus.AcceptanceTesting.Support.GivenDefinition`1.<>c__DisplayClass2.<GetAction>b__1(IBus bus) in c:\BuildAgent\work\31f8c64a6e8a2d7c\src\NServiceBus.AcceptanceTesting\Support\EndpointBehaviour.cs:line 45
   at NServiceBus.AcceptanceTesting.Support.EndpointRunner.Start() in c:\BuildAgent\work\31f8c64a6e8a2d7c\src\NServiceBus.AcceptanceTesting\Support\EndpointRunner.cs:line 107
   --- End of inner exception stack trace ---
   at NServiceBus.AcceptanceTesting.Support.ScenarioRunner.<>c__DisplayClass22.<StartEndpoints>b__20() in c:\BuildAgent\work\31f8c64a6e8a2d7c\src\NServiceBus.AcceptanceTesting\Support\ScenarioRunner.cs:line 274
   at System.Threading.Tasks.Task.InnerInvoke()
   at System.Threading.Tasks.Task.Execute()
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.WaitAll(Task[] tasks, Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at System.Threading.Tasks.Task.WaitAll(Task[] tasks, Int32 millisecondsTimeout)
   at System.Threading.Tasks.Task.WaitAll(Task[] tasks, TimeSpan timeout)
   at NServiceBus.AcceptanceTesting.Support.ScenarioRunner.StartEndpoints(IEnumerable`1 endpoints) in c:\BuildAgent\work\31f8c64a6e8a2d7c\src\NServiceBus.AcceptanceTesting\Support\ScenarioRunner.cs:line 269
   at NServiceBus.AcceptanceTesting.Support.ScenarioRunner.PerformScenarios(RunDescriptor runDescriptor, IEnumerable`1 runners, Func`1 done) in c:\BuildAgent\work\31f8c64a6e8a2d7c\src\NServiceBus.AcceptanceTesting\Support\ScenarioRunner.cs:line 234
   at NServiceBus.AcceptanceTesting.Support.ScenarioRunner.PerformTestRun(IList`1 behaviorDescriptors, IList`1 shoulds, RunDescriptor runDescriptor, Func`2 done) in c:\BuildAgent\work\31f8c64a6e8a2d7c\src\NServiceBus.AcceptanceTesting\Support\ScenarioRunner.cs:line 160
---> (Inner Exception #0) NServiceBus.AcceptanceTesting.Support.ScenarioException: Endpoint failed to start ---> RabbitMQ.Client.Exceptions.OperationInterruptedException: The AMQP operation was interrupted: AMQP close-reason, initiated by Peer, code=404, text="NOT_FOUND - no exchange 'PubSub.Subscriber1.WhenPublishingAnEventWithOverriddenLocalAddress.RabbitMQ' in vhost '/'", classId=40, methodId=30, cause=
   at RabbitMQ.Client.Impl.SimpleBlockingRpcContinuation.GetReply()
   at RabbitMQ.Client.Impl.ModelBase.ModelRpc(MethodBase method, ContentHeaderBase header, Byte[] body)
   at RabbitMQ.Client.Framing.Impl.v0_9_1.Model._Private_ExchangeBind(String destination, String source, String routingKey, Boolean nowait, IDictionary`2 arguments)
   at RabbitMQ.Client.Impl.ModelBase.ExchangeBind(String destination, String source, String routingKey)
   at NServiceBus.Transports.RabbitMQ.Routing.ConventionalRoutingTopology.SetupSubscription(IModel channel, Type type, String subscriberName) in c:\Projects\NServiceBus.RabbitMQ\src\NServiceBus.RabbitMQ\Routing\ConventionalRoutingTopology.cs:line 33
   at NServiceBus.Transports.RabbitMQ.RabbitMqSubscriptionManager.Subscribe(Type eventType, Address publisherAddress) in c:\Projects\NServiceBus.RabbitMQ\src\NServiceBus.RabbitMQ\RabbitMqSubscriptionManager.cs:line 18
   at NServiceBus.Unicast.UnicastBus.Subscribe(Type messageType, Predicate`1 condition) in y:\BuildAgent\work\31f8c64a6e8a2d7c\src\NServiceBus.Core\Unicast\UnicastBus.cs:line 390
   at NServiceBus.Unicast.UnicastBus.Subscribe(Type messageType) in y:\BuildAgent\work\31f8c64a6e8a2d7c\src\NServiceBus.Core\Unicast\UnicastBus.cs:line 343
   at NServiceBus.Unicast.UnicastBus.Subscribe[T]() in y:\BuildAgent\work\31f8c64a6e8a2d7c\src\NServiceBus.Core\Unicast\UnicastBus.cs:line 334
   at NServiceBus.AcceptanceTests.PubSub.When_publishing_an_event_with_overridden_local_address.<Should_be_delivered_to_all_subscribers>b__4(IBus bus, Context context) in c:\Projects\NServiceBus.RabbitMQ\src\NServiceBus.RabbitMQ.AcceptanceTests\App_Packages\NServiceBus.AcceptanceTests\PubSub\When_publishing_an_event_with_overridden_local_address.cs:line 28
   at NServiceBus.AcceptanceTesting.Support.GivenDefinition`1.<>c__DisplayClass2.<GetAction>b__1(IBus bus) in c:\BuildAgent\work\31f8c64a6e8a2d7c\src\NServiceBus.AcceptanceTesting\Support\EndpointBehaviour.cs:line 45
   at NServiceBus.AcceptanceTesting.Support.EndpointRunner.Start() in c:\BuildAgent\work\31f8c64a6e8a2d7c\src\NServiceBus.AcceptanceTesting\Support\EndpointRunner.cs:line 107
   --- End of inner exception stack trace ---
   at NServiceBus.AcceptanceTesting.Support.ScenarioRunner.<>c__DisplayClass22.<StartEndpoints>b__20() in c:\BuildAgent\work\31f8c64a6e8a2d7c\src\NServiceBus.AcceptanceTesting\Support\ScenarioRunner.cs:line 274
   at System.Threading.Tasks.Task.InnerInvoke()
   at System.Threading.Tasks.Task.Execute()<---

Context:
Subscriber1GotTheEvent = False
Subscriber1Subscribed = False
EndpointsStarted = False
Exceptions = 
System.AggregateException : Test run failed due to one or more exception
  ----> System.AggregateException : One or more errors occurred.
  ----> NServiceBus.AcceptanceTesting.Support.ScenarioException : Endpoint failed to start
  ----> RabbitMQ.Client.Exceptions.OperationInterruptedException : The AMQP operation was interrupted: AMQP close-reason, initiated by Peer, code=404, text="NOT_FOUND - no exchange 'PubSub.Subscriber1.WhenPublishingAnEventWithOverriddenLocalAddress.RabbitMQ' in vhost '/'", classId=40, methodId=30, cause=
   at NServiceBus.AcceptanceTesting.Support.ScenarioRunner.Run(IList`1 runDescriptors, IList`1 behaviorDescriptors, IList`1 shoulds, Func`2 done, Int32 limitTestParallelismTo, Action`1 reports) in c:\BuildAgent\work\31f8c64a6e8a2d7c\src\NServiceBus.AcceptanceTesting\Support\ScenarioRunner.cs: line 86
   at NServiceBus.AcceptanceTesting.ScenarioWithContext`1.Run(Nullable`1 testExecutionTimeout) in c:\BuildAgent\work\31f8c64a6e8a2d7c\src\NServiceBus.AcceptanceTesting\Scenario.cs: line 88
   at NServiceBus.AcceptanceTests.PubSub.When_publishing_an_event_with_overridden_local_address.Should_be_delivered_to_all_subscribers() in When_publishing_an_event_with_overridden_local_address.cs: line 16
--AggregateException
   at System.Threading.Tasks.Task.WaitAll(Task[] tasks, Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at System.Threading.Tasks.Task.WaitAll(Task[] tasks, Int32 millisecondsTimeout)
   at System.Threading.Tasks.Task.WaitAll(Task[] tasks, TimeSpan timeout)
   at NServiceBus.AcceptanceTesting.Support.ScenarioRunner.StartEndpoints(IEnumerable`1 endpoints) in c:\BuildAgent\work\31f8c64a6e8a2d7c\src\NServiceBus.AcceptanceTesting\Support\ScenarioRunner.cs: line 269
   at NServiceBus.AcceptanceTesting.Support.ScenarioRunner.PerformScenarios(RunDescriptor runDescriptor, IEnumerable`1 runners, Func`1 done) in c:\BuildAgent\work\31f8c64a6e8a2d7c\src\NServiceBus.AcceptanceTesting\Support\ScenarioRunner.cs: line 234
   at NServiceBus.AcceptanceTesting.Support.ScenarioRunner.PerformTestRun(IList`1 behaviorDescriptors, IList`1 shoulds, RunDescriptor runDescriptor, Func`2 done) in c:\BuildAgent\work\31f8c64a6e8a2d7c\src\NServiceBus.AcceptanceTesting\Support\ScenarioRunner.cs: line 160
--ScenarioException
   at NServiceBus.AcceptanceTesting.Support.ScenarioRunner.<>c__DisplayClass22.<StartEndpoints>b__20() in c:\BuildAgent\work\31f8c64a6e8a2d7c\src\NServiceBus.AcceptanceTesting\Support\ScenarioRunner.cs: line 274
   at System.Threading.Tasks.Task.InnerInvoke()
   at System.Threading.Tasks.Task.Execute()
--OperationInterruptedException
   at RabbitMQ.Client.Impl.SimpleBlockingRpcContinuation.GetReply()
   at RabbitMQ.Client.Impl.ModelBase.ModelRpc(MethodBase method, ContentHeaderBase header, Byte[] body)
   at RabbitMQ.Client.Framing.Impl.v0_9_1.Model._Private_ExchangeBind(String destination, String source, String routingKey, Boolean nowait, IDictionary`2 arguments)
   at RabbitMQ.Client.Impl.ModelBase.ExchangeBind(String destination, String source, String routingKey)
   at NServiceBus.Transports.RabbitMQ.Routing.ConventionalRoutingTopology.SetupSubscription(IModel channel, Type type, String subscriberName) in ConventionalRoutingTopology.cs: line 33
   at NServiceBus.Transports.RabbitMQ.RabbitMqSubscriptionManager.Subscribe(Type eventType, Address publisherAddress) in RabbitMqSubscriptionManager.cs: line 18
   at NServiceBus.Unicast.UnicastBus.Subscribe(Type messageType, Predicate`1 condition) in y:\BuildAgent\work\31f8c64a6e8a2d7c\src\NServiceBus.Core\Unicast\UnicastBus.cs: line 390
   at NServiceBus.Unicast.UnicastBus.Subscribe(Type messageType) in y:\BuildAgent\work\31f8c64a6e8a2d7c\src\NServiceBus.Core\Unicast\UnicastBus.cs: line 343
   at NServiceBus.Unicast.UnicastBus.Subscribe() in y:\BuildAgent\work\31f8c64a6e8a2d7c\src\NServiceBus.Core\Unicast\UnicastBus.cs: line 334
   at NServiceBus.AcceptanceTests.PubSub.When_publishing_an_event_with_overridden_local_address.<Should_be_delivered_to_all_subscribers>b__4(IBus bus, Context context) in When_publishing_an_event_with_overridden_local_address.cs: line 28
   at NServiceBus.AcceptanceTesting.Support.GivenDefinition`1.<>c__DisplayClass2.<GetAction>b__1(IBus bus) in c:\BuildAgent\work\31f8c64a6e8a2d7c\src\NServiceBus.AcceptanceTesting\Support\EndpointBehaviour.cs: line 45
   at NServiceBus.AcceptanceTesting.Support.EndpointRunner.Start() in c:\BuildAgent\work\31f8c64a6e8a2d7c\src\NServiceBus.AcceptanceTesting\Support\EndpointRunner.cs: line 107

@andreasohlund
Copy link
Member

Works locally and on buildserve, closing as can't repro

@johnsimons
Copy link
Member Author

@andreasohlund I find that very strange, since that test is still marked as Explicit!
Are you running

?

@johnsimons johnsimons reopened this Nov 30, 2014
@johnsimons
Copy link
Member Author

BTW, I ran it again and still same error

@andreasohlund
Copy link
Member

Doh!!

Good catch

On Sun, Nov 30, 2014 at 11:36 PM, John Simons notifications@github.com
wrote:

BTW, I ran it again and still same error


Reply to this email directly or view it on GitHub
#29 (comment)
.

@andreasohlund
Copy link
Member

Fixed by df67c3c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants