Can't configure ejabberd yml file for collection nodes

Installed ejabberd 16.09 on Ubuntu. Need to create/use collection nodes. Ejabberd documentation indicates that there are two plugins that need to be loaded: 'dag' and 'nodetree_dag'.
Here is my yml configuration file:

  mod_pubsub:
    access_createnode: pubsub_createnode
    ignore_pep_from_offline: true
    last_item_cache: false
    plugins:
      - "dag"
      - "flat"
      - "pep" # pep requires mod_caps
      - "hometree"
    nodetree:
      - "dag"

This gives an error when I start ejabberd:

2016-11-16 12:39:46.696 [error] <0.39.0>@gen_mod:validate_opts:327
 ignoring invalid value '[<<"dag">>]' for option 'nodetree' of module 'mod_pubsub'

What is wrong here? It seems to be according to the documentation.

As part of trying to figure this out I tried using other 'nodetree' options described in the ejabberd document: "tree" and "virtual", these gave me the same error, invalid value "tree" and invalid value "virtual" for option 'nodetree'

Does anyone know what is the right configuration format for this option and how can I configure ejabberd to work with collection nodes.

I don't use mod_pubsub, but I

I don't use mod_pubsub, but I think I found the problem: the Plugins option accepts many values, but the Nodetree accepts only one. So the plugins are provided as a list, but the nodetree is provided as only one value. In practice, simply remove a - character, see:

  mod_pubsub:
    access_createnode: pubsub_createnode
    ignore_pep_from_offline: true
    last_item_cache: false
    plugins:
      - "dag"
      - "flat"
      - "pep" # pep requires mod_caps
      - "hometree"
    nodetree:
      "dag"

Thanks for your suggestion.

Thanks for your suggestion. Tried it, with this change I get a different error when a client is connecting and none of my pubsub works not only the collection nodes:

{'EXIT',{{case_clause,[{pubsub_node,{{<<"estest1">>,<<"xmpp-dev1">>,<<>>},<<"urn:xmpp:avatar:metadata">>},10,[],<<"pep">>,[{<<"estest1">>,<<"xmpp-dev1">>,<<>>}],[{deliver_payloads,true},{notify_config,false},{notify_delete,false},{notify_retract,false},{purge_offline,false},{persist_items,true},{max_items,1},{subscribe,true},{access_model,presence},{roster_groups_allowed,[]},{publish_model,publishers},{notification_type,headline},{max_payload_size,60000},{send_last_published_item,on_sub_and_presence},{deliver_notifications,true},{presence_based_delivery,true},{itemreply,none}]}]},[{nodetree_dag,find_node,2,[{file,"src/nodetree_dag.erl"},{line,173}]},{nodetree_dag,get_node,2,[{file,"src/nodetree_dag.erl"},{line,101}]},{mod_pubsub,tree_call,3,[{file,"src/mod_pubsub.erl"},{line,4022}]},{mod_pubsub,'-transaction/4-fun-0-',3,[{file,"src/mod_pubsub.erl"},{line,4074}]},{mnesia_tm,non_transaction,5,[{file,"mnesia_tm.erl"},{line,737}]},{mod_pubsub,transaction_retry,6,[{file,"src/mod_pubsub.erl"},{line,4101}]},{mod_pubsub,publish_item,8,[{file,"src/mod_pubsub.erl"},{line,2123}]},{mod_pubsub,iq_sm,3,[{file,"src/mod_pubsub.erl"},{line,1168}]}]}}

It may be a bug. Looking in

It may be a bug. Looking in that module source code history, I see there was a minor change just before 16.09 release: https://github.com/processone/ejabberd/commits/master/src/nodetree_dag.erl

Can you install ejabberd 16.08 (or some older versions), test again, to check in which releases worked correctly, ans since which release it is broken?

Thank you for your help. I

Thank you for your help. I still have problems. I need to have pubsub nodes and collection nodes working. The 'regular' leaf nodes are working but the minute I add "dag" to my config file I can not create any node:

We tried 16.08 but that had registration problems, we could not register any users.
We went down to 16.06 which from the history of the nodetree_dag.erl file goes back two versions. This still has the same problems. When I have no "-" in front of the "dag" option under the "nodetree:" as you suggested I see in the ejabberd console that the "nodetree:" was recognized but the minute I have a user registered I get errors in the log file and no nodes at all can be created.

Do you have any idea at what point the pubsub collection nodes worked and how far back do I have to go? How much of different improvements and bug fixes will I miss that way?

Below is the error I still get, points to the file nodetree_dag.erl but also to mod_pubsub.erl

2016-11-28 09:37:49.197 [error] <0.433.0>@mod_pubsub:transaction_retry:4297 transaction return internal error: {aborted,{function_clause,[{mod_pubsub,'-get_node_subs_by_depth/3-lc$^0/1-0-',[{'EXIT',{{badmatch,[{pubsub_node,{<<"pubsub.xmpp-dev1">>,<<"PidginNotes">>},6,[],<<"dag">>,[{<<"estest1">>,<<"xmpp-dev1">>,<<>>}],[{deliver_payloads,true},{subscribe,true},{publish_model,open},{persist_items,true},{access_model,open},{title,[<<"Pidgin Discussion">>]},{node_type,leaf},{notify_config,false},{notify_delete,false},{notify_retract,true},{purge_offline,false},{max_items,10},{roster_groups_allowed,[]},{notification_type,headline},{max_payload_size,60000},{send_last_published_item,on_sub_and_presence},{deliver_notifications,true},{presence_based_delivery,false},{itemreply,none}]}]},[{nodetree_dag,traversal_helper,6,[{file,"src/nodetree_dag.erl"},{line,209}]},{mod_pubsub,tree_call,3,[{file,"src/mod_pubsub.erl"},{line,4198}]},{mod_pubsub,get_node_subs_by_depth,3,[{file,"src/mod_pubsub.erl"},{line,3480}]},{mod_pubsub,'-create_node/7-fun-2-',7,[{file,"src/mod_pubsub.erl"},{line,1890}]},{mnesia_tm,apply_fun,3,[{file,"mnesia_tm.erl"},{line,833}]},{mnesia_tm,execute_transaction,5,[{file,"mnesia_tm.erl"},{line,808}]},{mod_pubsub,transaction_retry,6,[{file,"src/mod_pubsub.erl"},{line,4277}]},{mod_pubsub,create_node,7,[{file,"src/mod_pubsub.erl"},{line,1912}]}]}}],[{file,"src/mod_pubsub.erl"},{line,3481}]},{mod_pubsub,'-create_node/7-fun-2-',7,[{file,"src/mod_pubsub.erl"},{line,1890}]},{mnesia_tm,apply_fun,3,[{file,"mnesia_tm.erl"},{line,833}]},{mnesia_tm,execute_transaction,5,[{file,"mnesia_tm.erl"},{line,808}]},{mod_pubsub,transaction_retry,6,[{file,"src/mod_pubsub.erl"},{line,4277}]},{mod_pubsub,create_node,7,[{file,"src/mod_pubsub.erl"},{line,1912}]},{mod_pubsub,do_route,7,[{file,"src/mod_pubsub.erl"},{line,992}]},{mod_pubsub,handle_info,2,[{file,"src/mod_pubsub.erl"},{line,866}]}]}}

At this time we went down to

At this time we went down to ejabberd version 15.11 and still have the same errors. With nodetree: - "dag" the plugin is not even loaded, when I omit the "-" before "dag" I don't get errors from several *.erl files and then the pubsub is not working at all.

I see online questions about creating a collection note dating back to 2012 with version 2.1.11 and naturally wonder if collection nodes ever worked.

Please advise.

I'm not sure dag plugin

I'm not sure dag plugin really worked since 2.1.x
XEP-0248 is defered, and the dag plugin is not maintained for years.
I tested and i confirm there is:
1/ a bug nodetree_dag:traversal_helper (result of qlc:e(Q) can not bind Nodes, which is a parameter of the function)
2/ an API issue in nodetree_dag:get_subnodes_tree (which should return [#pubsub_node{}] while now it returns [{int(), [#pubsub_node{}]}])

there are at least those 2 bugs. 1 can be easily fixed, 2 may require a refactor if get_subnodes_tree function. any pull request is welcome and will be tested.

Thank you so much for looking

Thank you so much for looking into the matter, appreciated. We'll have to decide on the next line of actions for my project. We don't have any erlang knowledge at the moment, though that depends on the commitment.
Wondering if the business edition may have collection nodes working for any chance or if we can get some support if we go that way?

Thanks, again, Eugenia.

Syndicate content