Bug 629926
| Summary: | qpid-winsdk an authentication example missing | ||
|---|---|---|---|
| Product: | Red Hat Enterprise MRG | Reporter: | Frantisek Reznicek <freznice> |
| Component: | qpid-sdk | Assignee: | Chuck Rolke <crolke> |
| Status: | CLOSED ERRATA | QA Contact: | Petra Svobodová <psvobodo> |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | beta | CC: | esammons, gsim, iboverma, jneedle, psvobodo, tross |
| Target Milestone: | 2.0 | ||
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | 1.3.3.1 | Doc Type: | Bug Fix |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2011-06-23 15:46:53 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Frantisek Reznicek
2010-09-03 09:54:25 UTC
For the c++ version of drain and spout there is a --connection-options command line option available through which username and password (and sasl mechanism) can be supplied, e.g.:
drain --connection-options '{username:guest, password:password, sasl-mechanism:PLAIN}' amq.topic
Looks like c# versions have the same option. Testing update:
OK, I can confirm that spout/drain can handle connection options:
C:\qpid\examples\messaging\Release>spout.exe --broker mrg-qe-01.lab.eng.brq.redhat.com --content "Hi!" "addr_%s; {create:sender, delete:receiver}" --connection-options "{username:guest, password:guest}"
C:\qpid\examples\messaging\Release>drain.exe --broker mrg-qe-01.lab.eng.brq.redhat.com "addr_%s; {create:sender, delete:receiver}" --connection-options "{username:guest, password:guest}"
Message(properties={spout-id:478798b3-7f35-44e8-9a68-bd97959f253b:0,x-amqp-0-10
.routing-key:addr_%s}, content='Hi!')
On the .NET side I can see it failing:
C:\qpid\bin>csharp.example.spout.exe --broker mrg-qe-01.lab.eng.brq.redhat.com:5672 --connection-options "{username:guest, password:guest}" "addr_; {create:sender, delete:receiver}"
2010-09-09 17:46:15 warning Broker closed connection: 320, connection-forced: Authentication failed
Exception System.Runtime.InteropServices.SEHException: External component has th
rown an exception.
at qpid.messaging.Connection.open(Connection* )
at Org.Apache.Qpid.Messaging.Connection.Open()
at Org.Apache.Qpid.Messaging.Examples.Spout.Main(String[] args) in c:\qpid\do
tnet_examples\examples\csharp.example.spout\csharp.example.spout.cs:line 73.
Having in the broker's log:
2010-09-09 11:46:41 info SASL: Mechanism list: LOGIN ANONYMOUS PLAIN
2010-09-09 11:46:41 warning Failed to retrieve sasl username
2010-09-09 11:46:41 info SASL: Authentication failed (no username available):SASL(-6): can't request info until later in exchange: Information that was requested is not yet available.
2010-09-09 11:46:41 warning Failed to retrieve sasl username
I believe that example switches need to be documented see bug 629922.
A trace level log from the broker would be useful, to see exactly what is going wrong, Understood, feedback soon (Monday). Retested (.NET case, win 2003 x86 -> rhel5.5 i386):
csharp.example.spout fails to authenticate with broker:
C:\qpid\bin>csharp.example.spout.exe --broker
mrg-qe-01.lab.eng.brq.redhat.com:5672 --connection-options "{username:guest,
password:guest}" "addr_; {create:sender, delete:receiver}"
2010-09-09 17:46:15 warning Broker closed connection: 320, connection-forced:
Authentication failed
Exception System.Runtime.InteropServices.SEHException: External component has
th
rown an exception.
at qpid.messaging.Connection.open(Connection* )
at Org.Apache.Qpid.Messaging.Connection.Open()
at Org.Apache.Qpid.Messaging.Examples.Spout.Main(String[] args) in
c:\qpid\do
tnet_examples\examples\csharp.example.spout\csharp.example.spout.cs:line 73.
Broker's trace+ log:
[root@mrg-qe-01 ~]# rm -rf /tmp/dd /tmp/qpidd.log ;qpidd --auth yes --log-enable trace+ --log-to-file /tmp/qpidd.log --data-dir=/tmp/dd
2010-09-10 02:41:39 info Loaded Module: /usr/lib/qpid/daemon/msgstore.so
2010-09-10 02:41:39 info Loaded Module: /usr/lib/qpid/daemon/replicating_listener.so
2010-09-10 02:41:39 info Loaded Module: /usr/lib/qpid/daemon/ssl.so
2010-09-10 02:41:39 info Loaded Module: /usr/lib/qpid/daemon/cluster.so
2010-09-10 02:41:39 info Loaded Module: /usr/lib/qpid/daemon/watchdog.so
2010-09-10 02:41:39 info Loaded Module: /usr/lib/qpid/daemon/replication_exchange.so
2010-09-10 02:41:39 info Loaded Module: /usr/lib/qpid/daemon/xml.so
2010-09-10 02:41:39 info Loaded Module: /usr/lib/qpid/daemon/acl.so
2010-09-10 02:41:39 info Loaded Module: /usr/lib/qpid/daemon/rdma.so
2010-09-10 02:41:39 info No message store configured, persistence is disabled.
2010-09-10 02:41:39 info Management enabled
2010-09-10 02:41:39 info ManagementAgent generated broker ID: 1ea7725d-4c04-4858-a8d7-96458c3d759b
2010-09-10 02:41:39 debug ManagementAgent boot sequence: 1
2010-09-10 02:41:39 debug ManagementAgent added package org.apache.qpid.broker
2010-09-10 02:41:39 trace SEND PackageInd package=org.apache.qpid.broker to=schema.package
2010-09-10 02:41:39 debug ManagementAgent added class org.apache.qpid.broker:system
2010-09-10 02:41:39 debug ManagementAgent added class org.apache.qpid.broker:broker
2010-09-10 02:41:39 debug ManagementAgent added class org.apache.qpid.broker:agent
2010-09-10 02:41:39 debug ManagementAgent added class org.apache.qpid.broker:vhost
2010-09-10 02:41:39 debug ManagementAgent added class org.apache.qpid.broker:queue
2010-09-10 02:41:39 debug ManagementAgent added class org.apache.qpid.broker:exchange
2010-09-10 02:41:39 debug ManagementAgent added class org.apache.qpid.broker:binding
2010-09-10 02:41:39 debug ManagementAgent added class org.apache.qpid.broker:subscription
2010-09-10 02:41:39 debug ManagementAgent added class org.apache.qpid.broker:connection
2010-09-10 02:41:39 debug ManagementAgent added class org.apache.qpid.broker:link
2010-09-10 02:41:39 debug ManagementAgent added class org.apache.qpid.broker:bridge
2010-09-10 02:41:39 debug ManagementAgent added class org.apache.qpid.broker:session
2010-09-10 02:41:39 debug ManagementAgent added class org.apache.qpid.broker:managementsetupstate
2010-09-10 02:41:39 debug ManagementAgent added class org.apache.qpid.broker:clientConnect
2010-09-10 02:41:39 debug ManagementAgent added class org.apache.qpid.broker:clientConnectFail
2010-09-10 02:41:39 debug ManagementAgent added class org.apache.qpid.broker:clientDisconnect
2010-09-10 02:41:39 debug ManagementAgent added class org.apache.qpid.broker:brokerLinkUp
2010-09-10 02:41:39 debug ManagementAgent added class org.apache.qpid.broker:brokerLinkDown
2010-09-10 02:41:39 debug ManagementAgent added class org.apache.qpid.broker:queueDeclare
2010-09-10 02:41:39 debug ManagementAgent added class org.apache.qpid.broker:queueDelete
2010-09-10 02:41:39 debug ManagementAgent added class org.apache.qpid.broker:exchangeDeclare
2010-09-10 02:41:39 debug ManagementAgent added class org.apache.qpid.broker:exchangeDelete
2010-09-10 02:41:39 debug ManagementAgent added class org.apache.qpid.broker:bind
2010-09-10 02:41:39 debug ManagementAgent added class org.apache.qpid.broker:unbind
2010-09-10 02:41:39 debug ManagementAgent added class org.apache.qpid.broker:subscribe
2010-09-10 02:41:39 debug ManagementAgent added class org.apache.qpid.broker:unsubscribe
2010-09-10 02:41:39 notice Journal "TplStore": Created
2010-09-10 02:41:39 debug Journal "TplStore": Journal directory = "/tmp/dd/rhm/tpl/"; Base file name = "tpl"
2010-09-10 02:41:39 notice Store module initialized; store-dir=/tmp/dd
2010-09-10 02:41:39 info > Default files per journal: 8
2010-09-10 02:41:39 info > Default journal file size: 24 (wpgs)
2010-09-10 02:41:39 info > Default write cache page size: 32 (Kib)
2010-09-10 02:41:39 info > Default number of write cache pages: 32
2010-09-10 02:41:39 info > TPL files per journal: 8
2010-09-10 02:41:39 info > TPL journal file size: 24 (wpgs)
2010-09-10 02:41:39 info > TPL write cache page size: 4 (Kib)
2010-09-10 02:41:39 info > TPL number of write cache pages: 64
2010-09-10 02:41:39 debug ManagementAgent added package com.redhat.rhm.store
2010-09-10 02:41:39 trace SEND PackageInd package=com.redhat.rhm.store to=schema.package
2010-09-10 02:41:39 debug ManagementAgent added class com.redhat.rhm.store:store
2010-09-10 02:41:39 debug ManagementAgent added class com.redhat.rhm.store:journal
2010-09-10 02:41:39 debug ManagementAgent added class com.redhat.rhm.store:enqThresholdExceeded
2010-09-10 02:41:39 debug ManagementAgent added class com.redhat.rhm.store:created
2010-09-10 02:41:39 debug ManagementAgent added class com.redhat.rhm.store:full
2010-09-10 02:41:39 debug ManagementAgent added class com.redhat.rhm.store:recovered
2010-09-10 02:41:39 info Registered replication exchange
2010-09-10 02:41:39 info Registered xml exchange
2010-09-10 02:41:39 info Most recent persistence id found: 0x0
2010-09-10 02:41:39 info SASL enabled
2010-09-10 02:41:39 notice Listening on TCP port 5672
2010-09-10 02:41:39 info SSL plugin not enabled, you must set --ssl-cert-db to enable it.
2010-09-10 02:41:39 info Policy file not specified. ACL Disabled, no ACL checking being done!
2010-09-10 02:41:39 info Rdma: Disabled: no rdma devices found
2010-09-10 02:41:39 notice Broker running
2010-09-10 02:41:49 trace Management agent periodic processing
2010-09-10 02:41:49 trace SEND V1 Multicast ContentInd to=console.obj.1.0.com.redhat.rhm.store.store props=1 stats=1
2010-09-10 02:41:49 trace SEND V1 Multicast ContentInd to=console.obj.1.0.org.apache.qpid.broker.broker props=1 stats=1
2010-09-10 02:41:49 trace SEND V1 Multicast ContentInd to=console.obj.1.0.org.apache.qpid.broker.exchange props=8 stats=8
2010-09-10 02:41:49 trace SEND V1 Multicast ContentInd to=console.obj.1.0.org.apache.qpid.broker.system props=1 stats=0
2010-09-10 02:41:49 trace SEND V1 Multicast ContentInd to=console.obj.1.0.org.apache.qpid.broker.vhost props=1 stats=0
2010-09-10 02:41:49 trace SEND HeartbeatInd to=console.heartbeat.1.0
2010-09-10 02:41:49 debug periodic update management snapshot: packages: 2 objects: 12 new objects: 0
2010-09-10 02:41:59 trace Management agent periodic processing
2010-09-10 02:41:59 trace SEND V1 Multicast ContentInd to=console.obj.1.0.org.apache.qpid.broker.broker props=0 stats=1
2010-09-10 02:41:59 trace SEND V1 Multicast ContentInd to=console.obj.1.0.org.apache.qpid.broker.exchange props=0 stats=1
2010-09-10 02:41:59 trace SEND HeartbeatInd to=console.heartbeat.1.0
2010-09-10 02:41:59 debug periodic update management snapshot: packages: 2 objects: 12 new objects: 0
...
2010-09-10 02:43:49 trace Management agent periodic processing
2010-09-10 02:43:49 trace SEND V1 Multicast ContentInd to=console.obj.1.0.org.apache.qpid.broker.broker props=0 stats=1
2010-09-10 02:43:49 trace SEND V1 Multicast ContentInd to=console.obj.1.0.org.apache.qpid.broker.exchange props=0 stats=1
2010-09-10 02:43:49 trace SEND HeartbeatInd to=console.heartbeat.1.0
2010-09-10 02:43:49 debug periodic update management snapshot: packages: 2 objects: 12 new objects: 0
2010-09-10 02:43:52 debug RECV [10.34.26.201:2038] INIT(0-10)
2010-09-10 02:43:52 debug External ssf=0 and auth=
2010-09-10 02:43:52 debug min_ssf: 0, max_ssf: 256, external_ssf: 0
2010-09-10 02:43:52 info SASL: Mechanism list: LOGIN ANONYMOUS PLAIN
2010-09-10 02:43:52 trace SENT 10.34.26.201:2038 INIT(0-10)
2010-09-10 02:43:52 trace SENT [10.34.26.201:2038]: Frame[BEbe; channel=0; {ConnectionStartBody: server-properties={qpid.federation_tag:V2:36:str16(1ea7725d-4c04-4858-a8d7-96458c3d759b)}; mechanisms=str16{V2:5:str16(LOGIN), V2:9:str16(ANONYMOUS), V2:5:str16(PLAIN)}; locales=str16{V2:5:str16(en_US)}; }]
2010-09-10 02:43:52 trace RECV [10.34.26.201:2038]: Frame[BEbe; channel=0; {ConnectionStartOkBody: client-properties={qpid.client_pid:F4:int32(1404),qpid.client_ppid:F4:int32(0),qpid.client_process:V2:0:str16(),qpid.session_flow:F4:int32(1)}; mechanism=PLAIN; response=xxxxxx; locale=en_US; }]
2010-09-10 02:43:52 debug SASL: Starting authentication with mechanism: PLAIN
2010-09-10 02:43:52 warning Failed to retrieve sasl username
2010-09-10 02:43:52 info SASL: Authentication failed (no username available):SASL(-6): can't request info until later in exchange: Information that was requested is not yet available.
2010-09-10 02:43:52 debug Exception constructed: Authentication failed
2010-09-10 02:43:52 warning Failed to retrieve sasl username
2010-09-10 02:43:52 trace SEND raiseEvent (v1) class=org.apache.qpid.broker.clientConnectFail
2010-09-10 02:43:52 trace SENT [10.34.26.201:2038]: Frame[BEbe; channel=0; {ConnectionCloseBody: reply-code=320; reply-text=connection-forced: Authentication failed; }]
2010-09-10 02:43:53 debug DISCONNECTED [10.34.26.201:2038]
2010-09-10 02:43:53 trace SEND raiseEvent (v1) class=org.apache.qpid.broker.clientDisconnect
2010-09-10 02:43:59 trace Management agent periodic processing
2010-09-10 02:43:59 trace SEND V1 Multicast ContentInd to=console.obj.1.0.org.apache.qpid.broker.broker props=0 stats=1
2010-09-10 02:43:59 trace SEND V1 Multicast ContentInd to=console.obj.1.0.org.apache.qpid.broker.connection props=1 stats=1
2010-09-10 02:43:59 trace SEND V1 Multicast ContentInd to=console.obj.1.0.org.apache.qpid.broker.exchange props=0 stats=1
2010-09-10 02:43:59 trace SEND HeartbeatInd to=console.heartbeat.1.0
2010-09-10 02:43:59 debug periodic update management snapshot: packages: 2 objects: 12 new objects: 0
...
2010-09-10 02:48:59 trace Management agent periodic processing
2010-09-10 02:48:59 trace SEND V1 Multicast ContentInd to=console.obj.1.0.org.apache.qpid.broker.broker props=0 stats=1
2010-09-10 02:48:59 trace SEND V1 Multicast ContentInd to=console.obj.1.0.org.apache.qpid.broker.exchange props=0 stats=1
2010-09-10 02:48:59 trace SEND HeartbeatInd to=console.heartbeat.1.0
2010-09-10 02:48:59 debug periodic update management snapshot: packages: 2 objects: 12 new objects: 0
Win package:
qpid-cpp-x86-0.7.946106-99.zip
RHEL 5.5 packages:
cyrus-sasl-2.1.22-5.el5_4.3
cyrus-sasl-devel-2.1.22-5.el5_4.3
cyrus-sasl-lib-2.1.22-5.el5_4.3
cyrus-sasl-plain-2.1.22-5.el5_4.3
python-qmf-0.7.946106-12.el5
python-qpid-0.7.946106-13.el5
python-saslwrapper-0.1.934605-2.el5
qmf-0.7.946106-12.el5
qmf-devel-0.7.946106-12.el5
qpid-cpp-client-0.7.946106-12.el5
qpid-cpp-client-devel-0.7.946106-12.el5
qpid-cpp-client-devel-docs-0.7.946106-12.el5
qpid-cpp-client-rdma-0.7.946106-12.el5
qpid-cpp-client-ssl-0.7.946106-12.el5
qpid-cpp-mrg-debuginfo-0.7.946106-12.el5
qpid-cpp-server-0.7.946106-12.el5
qpid-cpp-server-cluster-0.7.946106-12.el5
qpid-cpp-server-devel-0.7.946106-12.el5
qpid-cpp-server-rdma-0.7.946106-12.el5
qpid-cpp-server-ssl-0.7.946106-12.el5
qpid-cpp-server-store-0.7.946106-12.el5
qpid-cpp-server-xml-0.7.946106-12.el5
qpid-java-client-0.7.946106-8.el5
qpid-java-common-0.7.946106-8.el5
qpid-tools-0.7.946106-10.el5
rh-qpid-cpp-tests-0.7.946106-12.el5
ruby-qmf-0.7.946106-12.el5
ruby-qpid-0.7.946106-2.el5
ruby-saslwrapper-0.1.934605-2.el5
saslwrapper-0.1.934605-2.el5
saslwrapper-devel-0.1.934605-2.el5
We can trace this problem in separate bugzilla if you agree, as the authentication at least from drain and spout is possible.
I double-checked the qpidd sasl db for existence of expcted guest user [root@mrg-qe-01 ~]# sasldblistusers2 -f /var/lib/qpidd/qpidd.sasldb guest@QPID: userPassword and tried authentication from pre-compiled qpid-perftest.exe and from c++ client authentication works as expected. This looks like the username option is not making it through to the underlying c++ client for some reason? The issue is still present on qpid-cpp-winsdk-1.3.0.24-*.zip The issue comes from the csharp.example.spout example where connection options are not passed to the lib, i.e. Following fix to csharp.example.spout.cs avoids the issue: - connection = new Connection(options.Url); + connection = new Connection(options.Url, options.ConnectionOptions); The fix was checked in with r1041141, 01-Dec-2010. See also BZ 657523. This fix has not been repackaged into a new kit until 1.3.3.1 yesterday. Parameters "options.ConnectionOptions" were added into the constructors (calling spout/drain). The authentication code example was added and is functional. --> VERIFIED An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHEA-2011-0890.html |