Project

General

Profile

Pubsub http api call issue

NW NE
Added almost 4 years ago

I setup a tigase 7.0.2 server with http api on a machine and works very fine. I can create nodes and subscribe to them via http api without any problem.

I setup another tigase 7.0.2 server with same settings (except domain name of course) on amazon aws ec2 instance and pubsub related part of http api doesn't work as I excepted based on previous setup.

When I call this on browser 127.0.0.1:8082/rest/pubsub/pubsub.mydomain.co/create-node, the browser just rolling and rolling until timeout. I found these lines int the log:

(I use 8082 port for http api.)

2015-05-29 20:33:39.719 [in_3-message-router]  MessageRouter.processPacket()  FINEST:   Processing packet: from=http@localhost/7977847e-bb17-4883-bf25-ccec2b3116eb, to=null, DATA=<iq to="pubsub.mydomain.co" xmlns="jabber:client" type="set" id="6f487118-ac19-44e4-bffc-6a6c0d0041b2" from="http@localhost/7977847e-bb17-4883-bf25-ccec2b3116eb"><command xmlns="http://jabber.org/protocol/commands" node="create-node"/></iq>, SIZE=247, XMLNS=jabber:client, PRIORITY=NORMAL, PERMISSION=AUTH, TYPE=set
2015-05-29 20:33:39.719 [in_3-message-router]  MessageRouter.getLocalComponent()  FINEST: Called for : pubsub.mydomain.co
2015-05-29 20:33:39.719 [in_3-message-router]  MessageRouter.getLocalComponent()  FINEST: No componentID matches (fast lookup against exact address): pubsub.mydomain.co, for map: [monitor@localhost, bosh@localhost, c2s@localhost, sess-man@localhost, http@localhost, muc@localhost, vhost-man@localhost, message-archive@localhost, srecv@localhost, proxy@localhost, s2s@localhost, ws2s@localhost, stats@localhost, pubsub@localhost, ssend@localhost, basic-conf@localhost]; trying VHost lookup
2015-05-29 20:33:39.719 [in_3-message-router]  MessageRouter.getLocalComponent()  FINEST: No component name matches (VHost lookup against component name): pubsub.mydomain.co, for map: [ssend, c2s, basic-conf, s2s, bosh, proxy, vhost-man, sess-man, ws2s, message-router, message-archive, pubsub, stats, srecv, monitor, http, muc], for all VHosts: [mydomain.co]; trying other forms of addressing
2015-05-29 20:33:39.719 [in_3-message-router]  MessageRouter.getLocalComponent()  FINEST: Component matched: pubsub.mydomain.co, for comp: [ssend, c2s, basic-conf, s2s, bosh, proxy, vhost-man, sess-man, ws2s, message-router, message-archive, pubsub, stats, srecv, monitor, http, muc], basename: mydomain.co
2015-05-29 20:33:39.719 [in_3-message-router]  MessageRouter.getLocalComponent()  FINEST: Called for : pubsub.mydomain.co
2015-05-29 20:33:39.719 [in_3-message-router]  MessageRouter.getLocalComponent()  FINEST: No componentID matches (fast lookup against exact address): pubsub.mydomain.co, for map: [monitor@localhost, bosh@localhost, c2s@localhost, sess-man@localhost, http@localhost, muc@localhost, vhost-man@localhost, message-archive@localhost, srecv@localhost, proxy@localhost, s2s@localhost, ws2s@localhost, stats@localhost, pubsub@localhost, ssend@localhost, basic-conf@localhost]; trying VHost lookup
2015-05-29 20:33:39.720 [in_3-message-router]  MessageRouter.getLocalComponent()  FINEST: No component name matches (VHost lookup against component name): pubsub.mydomain.co, for map: [ssend, c2s, basic-conf, s2s, bosh, proxy, vhost-man, sess-man, ws2s, message-router, message-archive, pubsub, stats, srecv, monitor, http, muc], for all VHosts: [mydomain.co]; trying other forms of addressing
2015-05-29 20:33:39.720 [in_3-message-router]  MessageRouter.getLocalComponent()  FINEST: Component matched: pubsub.mydomain.co, for comp: [ssend, c2s, basic-conf, s2s, bosh, proxy, vhost-man, sess-man, ws2s, message-router, message-archive, pubsub, stats, srecv, monitor, http, muc], basename: mydomain.co
2015-05-29 20:33:39.720 [in_3-message-router]  MessageRouter.processPacket()  FINEST:   1. Packet will be processed by: pubsub@localhost, from=http@localhost/7977847e-bb17-4883-bf25-ccec2b3116eb, to=null, DATA=<iq to="pubsub.mydomain.co" xmlns="jabber:client" type="set" id="6f487118-ac19-44e4-bffc-6a6c0d0041b2" from="http@localhost/7977847e-bb17-4883-bf25-ccec2b3116eb"><command xmlns="http://jabber.org/protocol/commands" node="create-node"/></iq>, SIZE=247, XMLNS=jabber:client, PRIORITY=NORMAL, PERMISSION=AUTH, TYPE=set
2015-05-29 20:33:39.720 [in_1-pubsub]      ModulesManager.process()           FINEST:   Processing packet: from=http@localhost/7977847e-bb17-4883-bf25-ccec2b3116eb, to=null, DATA=<iq to="pubsub.mydomain.co" xmlns="jabber:client" type="set" id="6f487118-ac19-44e4-bffc-6a6c0d0041b2" from="http@localhost/7977847e-bb17-4883-bf25-ccec2b3116eb"><command xmlns="http://jabber.org/protocol/commands" node="create-node"/></iq>, SIZE=247, XMLNS=jabber:client, PRIORITY=NORMAL, PERMISSION=AUTH, TYPE=set
2015-05-29 20:33:39.720 [in_1-pubsub]      ModulesManager.process()           FINER:    Handled by module class tigase.pubsub.modules.AdHocConfigCommandModule
2015-05-29 20:33:39.721 [in_1-pubsub]      ModulesManager.process()           FINEST:   Finished class tigase.pubsub.modules.AdHocConfigCommandModule

and that's all. No more log and no results in the browser.

I tried to use pubsub@mydomain.co instead of pubsub.mydomain.co to see what happen and I get:

<error type="auth" code="403"><forbidden xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/><text xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" xml:lang="en">Only Administrator can call the command.</text></error>

On the first attempt it looks fine, because jid of my pubsub service is pubsub.mydomain.co and I set as admin user in init.properties (along with http.mydomain.co).

But! On my first machine, where everything works fine, it doesn't matter which type of pubsub service jid is used (with or without @), it always works.

Do you have any idea?

NWNE


Replies (4)

(1)

Added by Wojciech Kapcia TigaseTeam almost 4 years ago

As per documentation [[REST API]:

It is also required that jid of Tigase HTTP API Component is added to list of service admin jids to allow execution of ad-hoc commands.

So in your case you should ad: http@localhost to list of administrators.

Added by NW NE almost 4 years ago

Hi,

as I wrote, it is done, I have already added pubsub.mydomain.co and http.mydomain.co to the admin list in init.properties.

Actually I tried to add pubsub@mydomain.co and http@mydomain.co versions as well, but no change. Pubsub related http api calls doesn't work, just rolling.

Here is my related init.properties:

--admins = admin@mydomain.co,pubsub.mydomain.co,http.mydomain.co

--comp-name-4 = http

--comp-name-2 = pubsub

http/http/port[I] = 8082

http/api-keys[s]=open_access

--comp-class-4 = tigase.http.HttpMessageReceiver

--comp-class-2 = tigase.pubsub.PubSubComponent

(1)

Added by Wojciech Kapcia TigaseTeam almost 4 years ago

Please compare address that I provided with the one you added. You need to add JID of the component as internally address by the server (pubsub@hostname, in your case localhost@, thus @http@localhost needs to be addded) and not the address of the component with VHost.

(1)

Added by NW NE almost 4 years ago

Thank you! That was the solution. I didn't realized that the other machine VHost is equal with the hostname. That was the reason the other machine worked, and this new one not.

Thank you!

    (1-4/4)