User import on NS7

import_emails script does nothing :

[root@nethserver ~]# /usr/share/doc/nethserver-sssd-1.0.8/scripts/import_emails /tmp/userimport-email.tsv
[WARNING] Account indra does not exist, skipped.

and nothing in messages log file

1 Like

Also

[root@nethserver ~]# db accounts show
jabberadmins=group
Description=Jabber Administrators
Members=admin
Removable=no
[root@nethserver ~]#

Shouldnā€™t the new accounts be in there too?
New users are show on the server-manager, Users and groups page, and can login to owncloud with their proper credentials. Didnā€™t try samba as I havenā€™t applied the workgroup fix yet.

Should I run something to sync the users to the database?

No, the accounts DB does not contain user and group entries any longer since ns7.

The jabberadmins entry is probably a legacy one, we should remove it!

1 Like

Any other way on the CLI for checking if the accounts got imported properly?
And anything more I can test for email and maybe groups import scripts? :innocent:

1 Like

Iā€™m working on the ā€œUsers and groupsā€ page and providing a testing package soon! Stay tuned!

2 Likes

Yep. NS7 is a totally different beast.

3 Likes

Hurray - Email import works!

This morning I did another update of nethserver-sssd (Updating : nethserver-sssd-1.0.8-1.33.gab57573.ns7.noarch) and did a /usr/share/doc/nethserver-sssd-1.0.8/scripts/import_emails /tmp/emailimport-test.tsv
and got this in return : [INFO] imported indra.pharazijn@noble-house.tk

this is what I found in messages

Dec 6 08:15:58 nethserver /usr/share/doc/nethserver-sssd-1.0.8/scripts/import_emails[10651]: /var/lib/nethserver/db/accounts: OLD indra.pharazijn@noble-house.tk=(undefined)
Dec 6 08:15:58 nethserver /usr/share/doc/nethserver-sssd-1.0.8/scripts/import_emails[10651]: /var/lib/nethserver/db/accounts: NEW indra.pharazijn@noble-house.tk=pseudonym|Access|public|Account|indra@noble-house.tk|Description|
Dec 6 08:15:58 nethserver import_emails: Event: pseudonym-create indra.pharazijn@noble-house.tk
Dec 6 08:15:58 nethserver import_emails: expanding /etc/postfix/internal_access
Dec 6 08:15:58 nethserver dbus[789]: [system] Activating via systemd: service name=ā€˜org.freedesktop.timedate1ā€™ unit=ā€˜dbus-org.freedesktop.timedate1.serviceā€™
Dec 6 08:15:58 nethserver dbus-daemon: dbus[789]: [system] Activating via systemd: service name=ā€˜org.freedesktop.timedate1ā€™ unit=ā€˜dbus-org.freedesktop.timedate1.serviceā€™
Dec 6 08:15:58 nethserver systemd: Starting Time & Date Serviceā€¦
Dec 6 08:15:58 nethserver dbus[789]: [system] Successfully activated service ā€˜org.freedesktop.timedate1ā€™
Dec 6 08:15:58 nethserver systemd: Started Time & Date Service.
Dec 6 08:15:58 nethserver dbus-daemon: dbus[789]: [system] Successfully activated service ā€˜org.freedesktop.timedate1ā€™
Dec 6 08:15:58 nethserver import_emails: expanding /etc/postfix/virtual
Dec 6 08:15:58 nethserver import_emails: Action: /etc/e-smith/events/actions/generic_template_expand SUCCESS [0.301509]
Dec 6 08:15:59 nethserver import_emails: Action: /etc/e-smith/events/pseudonym-create/S30nethserver-mail-postmap-update SUCCESS [0.403681]
Dec 6 08:15:59 nethserver import_emails: Event: pseudonym-create SUCCESS

Looks great, now Iā€™ll try with multiple aliases. And will there be a script for adding users to groups?

Ps [root@nethserver ~]# db accounts show

indra.pharazijn@noble-house.tk=pseudonym
Access=public
Account=indra@noble-house.tk
Description=
jabberadmins=group
Description=Jabber Administrators
Members=admin
Removable=no

2 Likes

Weā€™ll fix it soon for the next nethserver-ejabberd release /cc @giacomo

Oh yes, I know. np
Just added the accounts thingy for the pseudonym entry.
I donā€™t know what is expected behavior, just sharing what I think might be related, but not necessarily faulty :innocent:

Entry removed:

2 Likes

Updated to nethserver-ejabberd-1.1.2-1.4.gefc8d63.ns7.noarch from nethserver-testing
Anything I can do to test expected behavior on the running test server or should it be tested on a fresh install?

I just pushed the commit, but I havenā€™t built a new rpm. I think there is no need to test this fix which is trivial :slight_smile:

But thanks for your offer!

1 Like

Just moved on #development it doesnā€™t look a support discussion anymore :slight_smile: Thanks @indra great topic!

1 Like

With pleasure, and thank you for all the help.
Iā€™m not a great fan of discussions anyways, I like to get results :innocent:

Ps @davidep, no rush but just wonderin if there is a group import script in the pipeline :slight_smile:

Yes, of course! It should be trivial to write it down, as long as the input format reflects the group-create event arguments. It should be:

<groupname> SEP <member1> SEP <member2> [ SEP <memberN> ]...

BTW, for very large groups, I think we should support reading the group members from a file. We could introduce a new convention: if any of the memberX arguments to group-create and group-modify begins with /tmp it is a temporary file containing group members, one per line. /cc @dev_team

Edit: nevermind, the args limit seems large enough:

xargs --show-limits
Your environment variables take up 2269 bytes
POSIX upper limit on argument length (this system): 2092835
POSIX smallest allowable upper limit on argument length (all systems): 4096
Maximum length of command we could actually use: 2090566
Size of command buffer we are actually using: 131072
2 Likes

Right, forgive my ignorance, Iā€™ve got used to debian/ubuntu ways. Of course group management is available from the command line through signal-event group-create and group-modify. Iā€™m such a noob :blush:

So yes anyways, I did signal-event group-create group1 user1 user2 user3
Works perfectly as expected, thanks again. :smile:

2 Likes

Now when I want to import the email aliases on my VM test server, it still doesnā€™t find the accounts :

[WARNING] Account indra does not exist, skipped.

Upgraded nethserver-sssd from testing, but still no import. very strange.

Tried it again on a freshly installed test server (not VM) and works without a glitch.
Dunno whats wrong with the VM, is clean install too though.

Ok, tried it again with a VM, duplicating install procedure from bare metal install : interactive install, setting public main domain .tk io .lan, apply fix for workgroups and update nethserver-sssd from testing.

Users and email imports work perfectly.

Retried it on the first VM, going back a few snapshots, and works perfectly. Dunno what happened yesterday but it all works now.

added some of this to the docs :

3 Likes

Good job, @indra.:heart_eyes:
That will be useful for many people.

We must remind to update the document once nethserver-sssd is moved from testing (or write a comment on the minimum version where the import scripts are available). And maybe explicitly mention the import_emails script.

3 Likes