Bug 47083 - udm/add (mail/mail): TypeError: sequence item 1: expected string, NoneType found
udm/add (mail/mail): TypeError: sequence item 1: expected string, NoneType found
Status: RESOLVED FIXED
Product: UCS
Classification: Unclassified
Component: UMC - Mail
UCS 4.3
Other Linux
: P5 normal (vote)
: ---
Assigned To: Toni Röhmeyer
Daniel Tröder
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2018-05-25 18:07 CEST by Johannes Keiser
Modified: 2020-10-21 15:14 CEST (History)
2 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 4: Minor Usability: Impairs usability in secondary scenarios
Who will be affected by this bug?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.046
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2018052321000983
Bug group (optional): Error handling, External feedback
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Johannes Keiser univentionstaff 2018-05-25 18:07:57 CEST
Version: 4.3-0 errata84 (Neustadt)

Interner Server-Fehler in "udm/add (mail/mail)".
Request: udm/add (mail/mail)

Traceback (most recent call last):
  File "%PY2.7%/notifier/threads.py", line 82, in _run
    tmp = self._function()
  File "%PY2.7%/notifier/__init__.py", line 104, in __call__
    return self._function( *tmp, **self._kwargs )
  File "%PY2.7%/univention/management/console/modules/udm/__init__.py", line 369, in _thread
    dn = module.create(properties, container=options.get('container'), superordinate=options.get('superordinate'))
  File "%PY2.7%/univention/management/console/modules/udm/udm_ldap.py", line 83, in _decorated
    return method(*args, **kwargs)
  File "%PY2.7%/univention/management/console/ldap.py", line 143, in _decorated
    result = func(*args, **kwargs)
  File "%PY2.7%/univention/management/console/modules/udm/udm_ldap.py", line 394, in create
    obj.create()
  File "%PY2.7%/univention/admin/handlers/__init__.py", line 483, in create
    dn = self._create(response=response, serverctrls=serverctrls)
  File "%PY2.7%/univention/admin/handlers/__init__.py", line 989, in _create
    al.extend(self._ldap_modlist())
  File "%PY2.7%/univention/admin/handlers/mail/folder.py", line 266, in _ldap_modlist
    new_acls_tmp.append(' '.join(acl))
TypeError: sequence item 1: expected string, NoneType found
Comment 1 Toni Röhmeyer univentionstaff 2020-10-06 11:59:56 CEST
Should be already fixed with bug #47810.

*** This bug has been marked as a duplicate of bug 47810 ***
Comment 2 Florian Best univentionstaff 2020-10-06 12:16:23 CEST
(In reply to Toni Röhmeyer from comment #1)
> Should be already fixed with bug #47810.
> 
> *** This bug has been marked as a duplicate of bug 47810 ***
No, your bug is for oxmail/oxfolder.py while this Bug is about mail/folder.py.
Comment 3 Toni Röhmeyer univentionstaff 2020-10-20 17:23:52 CEST
Oh I'm sorry; I overlooked that.
However, the fix from bug#47810 was sufficient to fix this error as well.

I tested it by adding a folder with a group selected, but no acl set.
The warning does not occur anymore for this case.

I pushed my solution with commit 
2f7f1ce87e Bug #47083: check if acl is not None

to branch troehmey/bug47083_no_acl_set_error
Comment 4 Florian Best univentionstaff 2020-10-20 23:12:20 CEST
(In reply to Toni Röhmeyer from comment #3)
> I tested it by adding a folder with a group selected, but no acl set.
> The warning does not occur anymore for this case.
Can you print the UDM commands to reproduce this?
Comment 5 Florian Best univentionstaff 2020-10-21 15:14:15 CEST
Reproducible:
udm mail/folder create --set sharedFolderGroupACL='"Domain Users" "c"' --set name=foo  --set mailDomain=localhost --set mailHomeServer=localhost

curl 'http://Administrator:univention@localhost/univention/command/udm/add' \
  -H 'Accept: application/json; q=1.0, text/html; q=0.3; */*; q=0.1' \
  -H 'X-Requested-With: XMLHttpRequest' \
  -H 'Accept-Language: de-DE' \
  -H 'Content-Type: application/json' \
  --data-binary '{"options":[{"object":{"mailDomain":"school.dev","sharedFolderGroupACL":[["Domain Users",""]],"name":"test","mailHomeServer":"master80.school.dev","$policies$":{}},"options":{"container":"cn=folder,cn=mail,l=school,l=dev","objectType":"mail/folder","objectTemplate":"None"}}],"flavor":"mail/mail"}'