Bug #2806

Samba SAM db migration fails on group_mapping.ldb

Added by Davide Principi about 7 years ago. Updated almost 7 years ago.

Status:CLOSEDStart date:
Priority:NormalDue date:
Assignee:-% Done:

100%

Category:nethserver-samba
Target version:v6.5
Security class: Resolution:
Affected version:v6.5-final NEEDINFO:No

Description

The action nethserver-samba-migrate-sam exits prematurely with the follwing error, if /var/lib/samba/group_mapping.ldb exists in the migration backup set:

Jul  8 09:01:24 hostx esmith::event[16722]: [ERROR] Could not read group mappings: No such file or directory

SAM DB is not migrated

The original server had been:
  • NethService 7.3, upgraded to
  • NethService 8.1

Server role is PDC.

    # rpm -qa | grep -F .ns6 | sort
ardad-2.9.4-6.ns6.x86_64
c-icap-0.2.5-1.ns6.x86_64
c-icap-libs-0.2.5-1.ns6.x86_64
dovecot-antispam-0.0.49-1.ns6.x86_64
lsm-0.163-1.ns6.x86_64
nethserver-antivirus-1.0.7-1.ns6.noarch
nethserver-avahi-1.0.2-1.ns6.noarch
nethserver-backup-config-1.1.0-1.ns6.noarch
nethserver-backup-data-1.0.11-1.ns6.noarch
nethserver-base-2.2.1-1.ns6.noarch
nethserver-cgp-1.0.0-1.ns6.noarch
nethserver-c-icap-1.0.2-1.ns6.noarch
nethserver-collectd-1.0.3-1.ns6.noarch
nethserver-collectd-web-1.0.2-1.ns6.noarch
nethserver-cups-1.1.0-1.ns6.noarch
nethserver-directory-2.0.3-1.ns6.noarch
nethserver-dnsmasq-1.1.1-1.ns6.noarch
nethserver-ejabberd-1.0.3-1.ns6.noarch
nethserver-faxweb2-1.0.3-1.ns6.noarch
nethserver-fetchmail-1.0.4-1.ns6.noarch
nethserver-firewall-base-1.1.0-1.ns6.noarch
nethserver-hosts-1.0.7-1.ns6.noarch
nethserver-httpd-2.3.1-1.ns6.noarch
nethserver-httpd-admin-1.2.3-1.ns6.noarch
nethserver-hylafax-1.0.7-1.ns6.noarch
nethserver-iaxmodem-1.0.2-1.ns6.noarch
nethserver-ibays-2.0.3-1.ns6.noarch
nethserver-ipsec-1.0.1-1.ns6.noarch
nethserver-lib-2.0.3-1.ns6.noarch
nethserver-lightsquid-1.0.2-1.ns6.noarch
nethserver-lsm-0.0.3-1.0git883d4ec4.ns6.noarch
nethserver-mail-common-1.3.3-1.ns6.noarch
nethserver-mail-filter-1.1.6-1.ns6.noarch
nethserver-mail-server-1.7.0-1.ns6.noarch
nethserver-memcached-1.0.2-1.ns6.noarch
nethserver-mysql-1.0.5-1.ns6.noarch
nethserver-nethgui-1.5.0-1.ns6.noarch
nethserver-nethserverenterprise-branding-1.0.1-1.ns6.noarch
nethserver-ntopng-1.1.2-1.ns6.noarch
nethserver-ntp-1.0.6-1.ns6.noarch
nethserver-openssh-1.0.5-1.ns6.noarch
nethserver-openvpn-1.0.2-1.ns6.noarch
nethserver-owncloud-1.0.2-1.ns6.noarch
nethserver-php-1.1.1-1.ns6.noarch
nethserver-redis-1.0.0-1.ns6.noarch
nethserver-register-2.0.1-1.ns6.noarch
nethserver-release-6.5-5.ns6.noarch
nethserver-roundcubemail-1.0.0-1.ns6.noarch
nethserver-samba-1.4.5-1.ns6.noarch
nethserver-samba-audit-1.0.3-1.ns6.noarch
nethserver-shorewall-1.0.4-1.ns6.noarch
nethserver-smartd-1.0.1-1.ns6.noarch
nethserver-sogo-1.4.0-1.ns6.noarch
nethserver-sogo-thunderbird-1.1.1-1.ns6.noarch
nethserver-squid-1.1.1-1.ns6.noarch
nethserver-squidclamav-1.0.4-1.ns6.noarch
nethserver-squidguard-1.0.4-1.ns6.noarch
nethserver-vpn-1.1.2-1.ns6.noarch
nethserver-yum-1.3.1-1.ns6.noarch
sogo-frontends-1.3.0-1.ns6.noarch
squidclamav-6.10-1.ns6.x86_64

Removing /var/lib/migration/var/lib/samba/group_mapping.ldb and running the action again seems to workaround the problem.


Related issues

Related to NethServer 6 - Bug #2832: Samba machine accounts not migrated CLOSED
Related to NethServer 6 - Enhancement #2803: Edit workgroup name when role is Workstation CLOSED

Associated revisions

Revision 604a0d11
Added by Davide Principi almost 7 years ago

nethserver-samba-migrate-sam: removed getSambaGroupDb() function. Refs #2806

The function failed because the ldb3search command was not provided by
any available package (formerly it came from samba3x*?).

Revision d00da324
Added by Davide Principi almost 7 years ago

nethserver-samba-migrate-sam ($useGroupMappingDb): removed unused variable. Refs #2806

History

#1 Updated by Davide Principi about 7 years ago

  • Related to Bug #2832: Samba machine accounts not migrated added

#2 Updated by Davide Principi almost 7 years ago

  • Status changed from NEW to TRIAGED
  • % Done changed from 0 to 20

#3 Updated by Davide Principi almost 7 years ago

  • Status changed from TRIAGED to ON_DEV
  • Assignee set to Davide Principi
  • % Done changed from 20 to 30

On branch b2803 Refs #2803

#4 Updated by Davide Principi almost 7 years ago

nethserver-samba-migrate-sam action: removed getSambaGroupDb() function. This effectively applies the proposed workaround strategy.

Group RIDs are always allocated by the algorithmic formula, based on Unix GIDs.

#5 Updated by Davide Principi almost 7 years ago

#6 Updated by Davide Principi almost 7 years ago

  • Status changed from ON_DEV to MODIFIED
  • Assignee deleted (Davide Principi)
  • % Done changed from 30 to 60

Test case

Check the bug is not reproducible on the modified version

#7 Updated by Davide Principi almost 7 years ago

  • Status changed from MODIFIED to ON_QA
  • % Done changed from 60 to 70

In nethserver-testing:
nethserver-samba-1.4.5-1.14git5c2b63f.ns6.noarch.rpm

#8 Updated by Giacomo Sanchietti almost 7 years ago

This is odd, the /var/lib/samba/group_mapping.ldb is not inside any backup set.
I can't reproduce the bug.

#9 Updated by Giacomo Sanchietti almost 7 years ago

  • Assignee set to Giacomo Sanchietti

#10 Updated by Giacomo Sanchietti almost 7 years ago

  • Status changed from ON_QA to VERIFIED
  • Assignee deleted (Giacomo Sanchietti)
  • % Done changed from 70 to 90

The bug is reproducible only if the migration is done from a disk of the old server: this is not a supported scenario.

But for QA purpose, just created the file with:

touch /var/lib/samba/group_mapping.ldb

The file is now ignored during migration:

...
Jun 24 12:22:29 localhost esmith::event[13500]: Action: /etc/e-smith/events/migration-import/S30nethserver-samba-migrate-sam SUCCESS [3.58683]
...

The bug and the fix don't affect any normal migration.

#11 Updated by Giacomo Sanchietti almost 7 years ago

  • Status changed from VERIFIED to CLOSED
  • % Done changed from 90 to 100
Package in nethserver-updates:
  • nethserver-samba-1.4.6-1.ns6.noarch.rpm

Also available in: Atom PDF