Bug 240127 - net/samba410 4.10.8 samba-tool ascii' codec can't decode byte 0xe2
Summary: net/samba410 4.10.8 samba-tool ascii' codec can't decode byte 0xe2
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Timur I. Bakeyev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-08-26 15:36 UTC by Vithushan Ka.
Modified: 2020-01-14 01:30 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (timur)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vithushan Ka. 2019-08-26 15:36:15 UTC

    
Comment 1 Vithushan Ka. 2019-08-26 15:40:36 UTC
Build net/samba410 from ports with options :

# This file is auto-generated by 'make config'.
# Options for samba410-4.10.5_1
_OPTIONS_READ=samba410-4.10.5_1
_FILE_COMPLETE_OPTIONS_LIST=ADS AD_DC AESNI CLUSTER CUPS DEBUG DEVELOPER DOCS FAM GLUSTERFS GPGME LDAP MANDOC NTVFS PROFILE QUOTAS SPOTLIGHT SYSLOG UTMP GSSAPI_BUILTIN GSSAPI_MIT NSUPDATE BIND911 BIND913 BIND914 MDNSRESPONDER AVAHI
OPTIONS_FILE_SET+=ADS
OPTIONS_FILE_SET+=AD_DC
OPTIONS_FILE_SET+=AESNI
OPTIONS_FILE_SET+=CLUSTER
OPTIONS_FILE_SET+=CUPS
OPTIONS_FILE_SET+=DEBUG
OPTIONS_FILE_UNSET+=DEVELOPER
OPTIONS_FILE_UNSET+=DOCS
OPTIONS_FILE_SET+=FAM
OPTIONS_FILE_UNSET+=GLUSTERFS
OPTIONS_FILE_SET+=GPGME
OPTIONS_FILE_SET+=LDAP
OPTIONS_FILE_UNSET+=MANDOC
OPTIONS_FILE_UNSET+=NTVFS
OPTIONS_FILE_SET+=PROFILE
OPTIONS_FILE_SET+=QUOTAS
OPTIONS_FILE_UNSET+=SPOTLIGHT
OPTIONS_FILE_SET+=SYSLOG
OPTIONS_FILE_SET+=UTMP
OPTIONS_FILE_SET+=GSSAPI_BUILTIN
OPTIONS_FILE_UNSET+=GSSAPI_MIT
OPTIONS_FILE_UNSET+=NSUPDATE
OPTIONS_FILE_UNSET+=BIND911
OPTIONS_FILE_UNSET+=BIND913
OPTIONS_FILE_SET+=BIND914
OPTIONS_FILE_UNSET+=MDNSRESPONDER
OPTIONS_FILE_SET+=AVAHI


I have this error : 

lvkt-reddc0:/root@[17:31] # samba-tool domain provision --server-role=dc --use-rfc2307 --dns-backend=BIND9_DLZ --realm=lvkt-reddc0.dirtynetwork.lan --domain=dirtynetwork --adminpass=WeLoveTestPassword
INFO 2019-08-26 17:31:56,124 pid:49823 /usr/local/lib/python3.6/site-packages/samba/provision/__init__.py #2096: Looking up IPv4 addresses
INFO 2019-08-26 17:31:56,124 pid:49823 /usr/local/lib/python3.6/site-packages/samba/provision/__init__.py #2113: Looking up IPv6 addresses
WARNING 2019-08-26 17:31:56,124 pid:49823 /usr/local/lib/python3.6/site-packages/samba/provision/__init__.py #2120: No IPv6 address will be assigned
INFO 2019-08-26 17:31:56,519 pid:49823 /usr/local/lib/python3.6/site-packages/samba/provision/__init__.py #2290: Setting up secrets.ldb
INFO 2019-08-26 17:31:56,543 pid:49823 /usr/local/lib/python3.6/site-packages/samba/provision/__init__.py #2296: Setting up the registry
INFO 2019-08-26 17:31:56,558 pid:49823 /usr/local/lib/python3.6/site-packages/samba/provision/__init__.py #2299: Setting up the privileges database
INFO 2019-08-26 17:31:56,597 pid:49823 /usr/local/lib/python3.6/site-packages/samba/provision/__init__.py #2302: Setting up idmap db
INFO 2019-08-26 17:31:56,626 pid:49823 /usr/local/lib/python3.6/site-packages/samba/provision/__init__.py #2309: Setting up SAM db
INFO 2019-08-26 17:31:56,638 pid:49823 /usr/local/lib/python3.6/site-packages/samba/provision/__init__.py #882: Setting up sam.ldb partitions and settings
INFO 2019-08-26 17:31:56,639 pid:49823 /usr/local/lib/python3.6/site-packages/samba/provision/__init__.py #894: Setting up sam.ldb rootDSE
INFO 2019-08-26 17:31:56,643 pid:49823 /usr/local/lib/python3.6/site-packages/samba/provision/__init__.py #1302: Pre-loading the Samba 4 and AD schema
Unable to determine the DomainSID, can not enforce uniqueness constraint on local domainSIDs

INFO 2019-08-26 17:31:56,685 pid:49823 /usr/local/lib/python3.6/site-packages/samba/provision/__init__.py #1379: Adding DomainDN: DC=lvkt-reddc0,DC=dirtynetwork,DC=lan
INFO 2019-08-26 17:31:56,702 pid:49823 /usr/local/lib/python3.6/site-packages/samba/provision/__init__.py #1411: Adding configuration container
INFO 2019-08-26 17:31:56,717 pid:49823 /usr/local/lib/python3.6/site-packages/samba/provision/__init__.py #1426: Setting up sam.ldb schema
INFO 2019-08-26 17:31:58,668 pid:49823 /usr/local/lib/python3.6/site-packages/samba/provision/__init__.py #1444: Setting up sam.ldb configuration data
ERROR(<class 'UnicodeDecodeError'>): uncaught exception - 'ascii' codec can't decode byte 0xe2 in position 513: ordinal not in range(128)
  File "/usr/local/lib/python3.6/site-packages/samba/netcmd/__init__.py", line 185, in _run
    return self.run(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/samba/netcmd/domain.py", line 537, in run
    backend_store=backend_store)
  File "/usr/local/lib/python3.6/site-packages/samba/provision/__init__.py", line 2351, in provision
    backend_store=backend_store)
  File "/usr/local/lib/python3.6/site-packages/samba/provision/__init__.py", line 1933, in provision_fill
    backend_store=backend_store)
  File "/usr/local/lib/python3.6/site-packages/samba/provision/__init__.py", line 1482, in fill_samdb
    "INC2012": incl_2012,
  File "/usr/local/lib/python3.6/site-packages/samba/provision/common.py", line 54, in setup_add_ldif
    data = read_and_sub_file(ldif_path, subst_vars)
  File "/usr/local/lib/python3.6/site-packages/samba/__init__.py", line 283, in read_and_sub_file
    data = open(file_name, 'r').read()
  File "/usr/local/lib/python3.6/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
lvkt-reddc0:/root@[17:31] # 

Thanks !
Comment 2 Timur I. Bakeyev freebsd_committer 2019-08-27 23:44:26 UTC
(In reply to vit0 from comment #1)
This is kind of frustrating...

Based on https://marc.info/?l=samba-technical&m=155240271425283&w=2 I'd expect this to be fixed in the latest version, but apparently it's not...

As a work around I'd suggest you to set LANG to something with UTF8, like en_US.UTF8 and try again. Or apply the given patch.


I suspect that provisioning will fail with the different error on a later step, but at least this error will be omitted.
Comment 3 Vithushan Ka. 2019-10-27 14:36:59 UTC
(In reply to Timur I. Bakeyev from comment #2)

LANG=en_US.UTF8

work fine, thank you
Comment 4 Timur I. Bakeyev freebsd_committer 2020-01-14 01:30:30 UTC
That was resolved in the latest port revision.