2017-07-31 60 views
0

我試圖刪除用戶使用ejabberd,但我收到400 /修改錯誤請求錯誤。據我所知,斯馬克發送的詩節依據規範[1];它也適用於OpenFire。ejabberd在嘗試刪除用戶時報告錯誤的請求/修改

Ejabberd在rroemhild/docker-ejabberd docker容器版本17.03-1(最新版本,因爲我沒有使用processone容器的原因參見[2])中運行,配置文件從那裏出庫(刪除了部分;在完全複製[3]) hosts: - "xmppserver.com" auth_method: - internal acl: admin: user: - "admin": "xmppserver.com" - "adminaccount": "xmppserver.com" local: user_regexp: "" access: (nothing of interest here) modules: mod_adhoc: {} host_config: "xmppserver.com": domain_certfile: "/opt/ejabberd/ssl/xmppserver.com.pem" (是的,我會正確配置SSL一旦我確認它爲我的作品)

首先,我確認用戶被授權發行管理命令:

SENT <iq to='xmppserver.com' id='Ghtu9-15' type='get'> <query xmlns='http://jabber.org/protocol/disco#items' node='http://jabber.org/protocol/commands'/> </iq>

收到 <iq xml:lang='en' to='[email protected]/39058022031067483561501494598609310' from='xmppserver.com' type='result' id='Ghtu9-15'> <query node='http://jabber.org/protocol/commands' xmlns='http://jabber.org/protocol/disco#items'> ... <item node='http://jabber.org/protocol/admin#add-user' name='Add User' jid='xmppserver.com'/> <item node='http://jabber.org/protocol/admin#delete-user' name='Delete User' jid='xmppserver.com'/> ... </query> </iq>

正如你可以看到delete-user命令被列爲可用。然後,我開始刪除用戶:

SENT <iq to='xmppserver.com' id='2vM3f-17' type='set'> <command xmlns='http://jabber.org/protocol/commands' action='execute' node='http://jabber.org/protocol/admin#delete-user'></command> </iq>

收到 <iq xml:lang='en' to='[email protected]/163923254889085958281501260654263394' from='xmppserver.com' type='result' id='2vM3f-17'> <command status='executing' sessionid='2017-07-28T16:51:12.784282Z' node='http://jabber.org/protocol/admin#delete-user' xmlns='http://jabber.org/protocol/commands'> <actions execute='complete'> <complete/> </actions> <x type='form' xmlns='jabber:x:data'> <title>Delete User</title> <field var='FORM_TYPE' type='hidden'> <value>http://jabber.org/protocol/admin</value> </field> <field var='accountjids' type='jid-multi' label='Jabber ID'> <required/> </field> </x> </command> </iq>

在這裏我不知道該<行動... >標籤是什麼;它在XEP-133中沒有提及。除此之外,表格看起來不錯。

SENT <iq to='xmppserver.com' id='2vM3f-19' type='set'> <command xmlns='http://jabber.org/protocol/commands' sessionid='2017-07-28T16:51:12.784282Z' node='http://jabber.org/protocol/admin#delete-user'> <x xmlns='jabber:x:data' type='submit'> <field var='FORM_TYPE' type='hidden'> <value>http://jabber.org/protocol/admin</value> </field> <field var='accountjids' type='jid-multi'> <value>[email protected]</value> </field> </x> </command> </iq>

RECEIVED <iq xml:lang='en' to='[email protected]/163923254889085958281501260654263394' from='xmppserver.com' type='error' id='2vM3f-19'> <command sessionid='2017-07-28T16:51:12.784282Z' node='http://jabber.org/protocol/admin#delete-user' xmlns='http://jabber.org/protocol/commands'> <x type='submit' xmlns='jabber:x:data'> <field var='FORM_TYPE' type='hidden'> <value>http://jabber.org/protocol/admin</value> </field> <field var='accountjids' type='jid-multi'> <value>[email protected]</value> </field> </x> </command> <error code='400' type='modify'> <bad-request xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> </error> </iq> 我還試圖發送裸露的JID(即沒有主機名部分),但結果是相同的。

這不是特別有用的錯誤消息。

我在做什麼錯?

[1] https://xmpp.org/extensions/xep-0133.html#delete-user

[2] https://github.com/processone/ejabberd/issues/1890

[3] https://pastebin.com/5D0rEbFR

回答

0

顯然<錯誤代碼= '400' 類型= '修改' >是說「用戶不是eJabberD的方式發現,沒有東西可以刪除'。