Bug 42464 - Too long username causes whole import to stop
Too long username causes whole import to stop
Status: RESOLVED WORKSFORME
Product: UCS@school
Classification: Unclassified
Component: Import scripts
UCS@school 4.1 R2
Other Linux
: P5 normal (vote)
: ---
Assigned To: Bugzilla Mailingliste
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2016-09-21 17:24 CEST by Florian Best
Modified: 2016-09-21 17:36 CEST (History)
1 user (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional): Error handling
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2016-09-21 17:24:47 CEST
No users were imported if one of the users produce a fatal error like the username is too long.

My CSV looks like:
"Schulen","Benutzername","Nachname","Klassen","description"
"gsmitte","test[ALWAYSCOUNTER]","Blah","1A","Dies ist ein Schüler"
"gsmitte","test[ALWAYSCOUNTER]","Blah","1A","Dies ist ein Schüler"
"gsmitte","bernd",Blah","1A","Dies ist ein Schüler"

The traceback:
Entry #2: Username 'test[ALWAYSCOUNTER]' is longer than allowed.
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/ucsschool/importer/mass_import/user_import.py", line 106, in create_and_modify_users
    user = self.determine_add_modify_action(imported_user)
  File "/usr/lib/pymodules/python2.7/ucsschool/importer/mass_import/user_import.py", line 195, in determine_add_modify_action
    imported_user.prepare_all(new_user=True)
  File "/usr/lib/pymodules/python2.7/ucsschool/importer/models/import_user.py", line 228, in prepare_all
    self.run_checks(check_username=new_user)
  File "/usr/lib/pymodules/python2.7/ucsschool/importer/models/import_user.py", line 578, in run_checks
    entry=self.entry_count, import_user=self)
UsernameToLong: Username 'test[ALWAYSCOUNTER]' is longer than allowed.
Starting univention-directory-notifier
Notifier was not running! Skipping
More than 0 errors. Exiting. Errors:
2: Username 'test[ALWAYSCOUNTER]' is longer than allowed.

Afterwards no user "bernd" exists:
# univention-ldapsearch -LLL uid=bernd
#
Comment 1 Daniel Tröder univentionstaff 2016-09-21 17:36:58 CEST
> More than 0 errors. Exiting.
Because of tolerate_errors=0 the import was stopped. It was not a crash.