Bug 11573 - Uncaught exception at ldb_modules/password_hash.c:2241 during new domain provision
Summary: Uncaught exception at ldb_modules/password_hash.c:2241 during new domain prov...
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: AD: LDB/DSDB/SAMDB (show other bugs)
Version: 4.3.1
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
URL:
Keywords:
: 12488 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-10-26 03:52 UTC by Andrey Cherepanov
Modified: 2018-06-27 08:35 UTC (History)
3 users (show)

See Also:


Attachments
Build log with TDB_NO_FSYNC=1 make test (1.22 MB, text/x-log)
2015-11-12 15:26 UTC, Andrey Cherepanov
no flags Details
[PATCH 1/2] heimdal: add include/includedir directives for krb5.conf (8.05 KB, patch)
2017-11-25 19:19 UTC, Evgeny Sinelnikov
no flags Details
[PATCH 2/2] heimdal: fix CR comments on include/includedir (6.42 KB, patch)
2017-11-25 19:24 UTC, Evgeny Sinelnikov
no flags Details
[PATCH 1/2] heimdal: add include/includedir directives for krb5.conf (8.43 KB, patch)
2017-11-29 09:48 UTC, Evgeny Sinelnikov
no flags Details
[PATCH 2/2] heimdal: fix CR comments on include/includedir (6.76 KB, patch)
2017-11-29 09:48 UTC, Evgeny Sinelnikov
no flags Details
Patches for 11573, cherry-picked from master (12.08 KB, patch)
2018-06-18 19:54 UTC, Björn Baumbach
bbaumbach: review-
Details
Fix for 11573, cherry-picked from master (2.57 KB, patch)
2018-06-20 09:15 UTC, Björn Baumbach
abartlet: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrey Cherepanov 2015-10-26 03:52:32 UTC
Samba 4.3.1, libldb-1.1.21 (as external library). smb.conf is removed, /var/lib/samba is contain only empty /var/lib/samba/sysvol

# samba-tool domain provision 
Realm [OFFICE.ALTLINUX.RU]: office.alt
 Domain [office]: 
 Server Role (dc, member, standalone) [dc]: 
 DNS backend (SAMBA_INTERNAL, BIND9_FLATFILE, BIND9_DLZ, NONE) [SAMBA_INTERNAL]: 
 DNS forwarder IP address (write 'none' to disable forwarding) [10.4.0.1]: 
Administrator password: 
Retype password: 
Looking up IPv4 addresses
Looking up IPv6 addresses
No IPv6 address will be assigned
Setting up share.ldb
Setting up secrets.ldb
Setting up the registry
Setting up the privileges database
Setting up idmap db
Setting up SAM db
Setting up sam.ldb partitions and settings
Setting up sam.ldb rootDSE
Pre-loading the Samba 4 and AD schema
Adding DomainDN: DC=office,DC=alt
Adding configuration container
Setting up sam.ldb schema
Setting up sam.ldb configuration data
Setting up display specifiers
Modifying display specifiers
Adding users container
Modifying users container
Adding computers container
Modifying computers container
Setting up sam.ldb data
Setting up well known security principals
Setting up sam.ldb users and groups
ERROR(ldb): uncaught exception - operations error at ../source4/dsdb/samdb/ldb_modules/password_hash.c:2241
  File "/usr/lib64/python2.7/site-packages/samba/netcmd/__init__.py", line 175, in _run
    return self.run(*args, **kwargs)
  File "/usr/lib64/python2.7/site-packages/samba/netcmd/domain.py", line 442, in run
    nosync=ldap_backend_nosync, ldap_dryrun_mode=ldap_dryrun_mode)
  File "/usr/lib64/python2.7/site-packages/samba/provision/__init__.py", line 2172, in provision
    skip_sysvolacl=skip_sysvolacl)
  File "/usr/lib64/python2.7/site-packages/samba/provision/__init__.py", line 1795, in provision_fill
    next_rid=next_rid, dc_rid=dc_rid)
  File "/usr/lib64/python2.7/site-packages/samba/provision/__init__.py", line 1453, in fill_samdb
    "KRBTGTPASS_B64": b64encode(krbtgtpass.encode('utf-16-le'))
  File "/usr/lib64/python2.7/site-packages/samba/provision/common.py", line 55, in setup_add_ldif
    ldb.add_ldif(data, controls)
  File "/usr/lib64/python2.7/site-packages/samba/__init__.py", line 225, in add_ldif
    self.add(msg, controls)
Comment 1 Andrey Cherepanov 2015-11-11 16:09:40 UTC
I hope it will be useful:

# ldbsearch \* -H /var/lib/samba/private/sam.ldb
dsdb_get_schema: refresh_fn() failed
schema_load_init: dsdb_get_schema failed
module schema_load initialization failed : Operations error
module rootdse initialization failed : Operations error
module samba_dsdb initialization failed : Operations error
Unable to load modules for /var/lib/samba/private/sam.ldb: schema_load_init: dsdb_get_schema failed
Failed to connect to /var/lib/samba/private/sam.ldb - schema_load_init: dsdb_get_schema failed
Comment 2 Andrey Cherepanov 2015-11-11 16:16:20 UTC
ldbsearch with -d 255:

Searching for dsServiceName in rootDSE failed: operations error at ../source4/dsdb/samdb/ldb_modules/rootdse.c:516
Failed to find our own NTDS Settings DN in the ldb!
dsdb_get_schema: refresh_fn() failed
Comment 3 Andrey Cherepanov 2015-11-12 15:26:04 UTC
Created attachment 11593 [details]
Build log with TDB_NO_FSYNC=1 make test

Build package with make test.
Comment 4 Andrey Cherepanov 2015-11-16 10:35:35 UTC
Sorry, it's local misconfiguration in /etc/krb5.conf.
Comment 5 Andrew Bartlett 2017-03-11 18:48:27 UTC
We need to backport:

https://github.com/heimdal/heimdal/commit/fe43be85587f834266623adb0ecf2793d212a7ca
Comment 6 Evgeny Sinelnikov 2017-11-25 19:19:44 UTC
Created attachment 13809 [details]
[PATCH 1/2] heimdal: add include/includedir directives for krb5.conf

Backport incudedir support from Heimdal based on next commits:
https://github.com/heimdal/heimdal/commit/fe43be85587f834266623adb0ecf2793d212a7ca
https://github.com/heimdal/heimdal/commit/b7cf5e7caf9b270f4d4151d2690177b11a7a1bdf
Comment 7 Evgeny Sinelnikov 2017-11-25 19:24:16 UTC
Created attachment 13810 [details]
[PATCH 2/2] heimdal: fix CR comments on include/includedir

Backport incudedir support from Heimdal based on next commits:
https://github.com/heimdal/heimdal/commit/0259f1c44927ab8f5906212804693dec48c9a04a
https://github.com/heimdal/heimdal/commit/31a00d664715fb4c7b90c1617a3b4c2580282d7b
Comment 8 Evgeny Sinelnikov 2017-11-25 19:26:56 UTC
(In reply to Andrew Bartlett from comment #5)
Ok. I did it and tested in ALT Linux environment with Samba DC installation.
Please, review it.
Comment 9 Andrew Bartlett 2017-11-26 03:48:39 UTC
(In reply to Evgeny Sinelnikov from comment #8)
Can you update the commit messages to indicate if these are simply cherry-picks or modified patches, and which patches they are cherry-picked from or modified from.

This helps us when we update heimdal in Samba as we can show that the patches are already upstream and so can be overwritten.
Comment 10 Andrew Bartlett 2017-11-26 03:52:23 UTC
(In reply to Andrew Bartlett from comment #9)
Also for cherry-picked commits, please preserve the original authorship
Comment 11 Evgeny Sinelnikov 2017-11-29 09:48:00 UTC
Created attachment 13819 [details]
[PATCH 1/2] heimdal: add include/includedir directives for krb5.conf
Comment 12 Evgeny Sinelnikov 2017-11-29 09:48:54 UTC
Created attachment 13820 [details]
[PATCH 2/2] heimdal: fix CR comments on include/includedir
Comment 13 Evgeny Sinelnikov 2017-11-29 09:53:27 UTC
(In reply to Andrew Bartlett from comment #10)
Sorry, I do not understand how to do this correctly.
Comment 14 Björn Baumbach 2018-06-18 19:54:48 UTC
Created attachment 14239 [details]
Patches for 11573, cherry-picked from master

This patch set applies to all recent Samba versions.
Comment 15 Björn Baumbach 2018-06-19 11:48:06 UTC
Comment on attachment 14239 [details]
Patches for 11573, cherry-picked from master

I have just seen smbd crashes with this patch. I'll fix this as soon as possible.
Comment 16 Björn Baumbach 2018-06-20 09:15:45 UTC
Created attachment 14246 [details]
Fix for 11573, cherry-picked from master
Comment 17 Björn Baumbach 2018-06-25 11:00:52 UTC
*** Bug 12488 has been marked as a duplicate of this bug. ***
Comment 18 Karolin Seeger 2018-06-25 11:09:10 UTC
Pushed to autobuild-v4-[8,7]-test.
Comment 19 Karolin Seeger 2018-06-27 08:35:46 UTC
(In reply to Karolin Seeger from comment #18)
Pushed to both branches.
Closing out bug report.

Thanks!