Nethvoice settings lead to error

Hi,

I installed Nethvoice and filled out the setting, and it all was saved. Now everytime I go back to setting, I get an error:

Traceback (most recent call last):
  File "/var/lib/nethserver/cluster/actions/list-domain-users/50list_users", line 33, in <module>
    users = Ldapclient.factory(**domain).list_users()
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: agent.ldapclient.Ldapclient.factory() argument after ** must be a mapping, not NoneType

I dismiss the error, and all seems fine, I can see the LDAP users in Nethvoice from the specified domain.

Anybody knows why the error is popping up and what the root cause could be?

TIA

@LayLow that looks like a bug in the validate json, or some variables types declaration from NEthvoice. maybe the nethvoice dev team could look into it, i could be wrong.

:thinking: If list-domain-users fails, how can you still see LDAP users in NethVoice?

Can you attach a screenshot to understand where/when the error occurs?

Under NS8 Domains and Users page, are the users listed?


I can reproduce the same error message, if I try to get the users of a non-existing domain:

# api-cli run list-domain-users --data '{"domain":"x"}'
Warning: using user "cluster" credentials from the environment
Traceback (most recent call last):
  File "/var/lib/nethserver/cluster/actions/list-domain-users/50list_users", line 33, in <module>
    users = Ldapclient.factory(**domain).list_users()
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: agent.ldapclient.Ldapclient.factory() argument after ** must be a mapping, not NoneType
""

Are you sure NethVoice is correctly configured and the LDAP domain it expects still exists?

Yes, NethVoice settings are fine and a domain is chosen from the drop down list.

Did you change the selected Domain by any means after NethVoice was configured?

The error occurs when I click settings AFTER first have filled out the settings selected domain and saved it.

Yes, and adding/modifying a user via portal redirect from NethVoice works perfectly fine.

1 Like

That might be a possibility, but I can’t remember for sure, sorry. It does ring a bell tho!

Please assume yes.

It would be really helpful if you could provide more details about the change!

image

What I can remember (I was merely trying, not really testing) is that I selected the user domain from the picklist to be the one attached to the Node1 FDQN domain. I changed this user domain later to a different user domain on the same node1.

That’s all I can remember.

In the logs I can see:

[1:nethvoice1:agent@nethvoice1] agent.ldapproxy: domain MYDOMAIN.COM should not be used by nethvoice1. Invoke agent.bind_user_domains(["[skylocker.eu](http://MYDOMAIN.COM)"]) to fix this warning.

For every LDAP domain on the same node

Some more snippets after clicking settings from Netvoice log:

2024-08-09T13:47:56+02:00 [1:nethvoice1:reports-api] [GIN] 2024/08/09 - 11:47:56 | 401 |    1.756472ms |    45.85.146.24 | POST     "/login"
2024-08-09T13:47:56+02:00 [1:nethvoice1:reports-api] Error! Reports available only on Enterprise version.
2024-08-09T13:47:56+02:00 [1:nethvoice1:nethvoice1] 2024-08-09T11:47:56+00:00 - warn: [arch_astproxy] logging-in to nethvoice-report - resp code: 401 - req: {"hostname":"NETHVOICE.MYDOMAIN.COM","port":"","path":"/pbx-report-api/login","method":"POST","headers":{"Content-Type":"application/json"}}
2024-08-09T13:47:56+02:00 [1:nethvoice1:agent@nethvoice1] task/module/nethvoice1/7645ca5a-68c6-43a4-b9aa-6eae5b24dbb0: action "get-configuration" status is "completed" (0) at step validate-output.json