#4846 migrate-ds crashes when neither users nor groups are found
Closed: Fixed None Opened 9 years ago by mkosek.

From freeipa-users thread:

> [Fri Jan 16 13:07:42.944666 2015] [:error] [pid 15335] Traceback (most recent call last):
> [Fri Jan 16 13:07:42.944668 2015] [:error] [pid 15335]   File "/usr/lib/python2.7/site-packages/ipaserver/rpcserver.py", line 333, in wsgi_execute
> [Fri Jan 16 13:07:42.944670 2015] [:error] [pid 15335]     result = self.Command[name](*args, **options)
> [Fri Jan 16 13:07:42.944671 2015] [:error] [pid 15335]   File "/usr/lib/python2.7/site-packages/ipalib/frontend.py", line 436, in __call__
> [Fri Jan 16 13:07:42.944673 2015] [:error] [pid 15335]     ret = self.run(*args, **options)
> [Fri Jan 16 13:07:42.944683 2015] [:error] [pid 15335]   File "/usr/lib/python2.7/site-packages/ipalib/frontend.py", line 755, in run
> [Fri Jan 16 13:07:42.944686 2015] [:error] [pid 15335]     result = self.execute(*args, **options)
> [Fri Jan 16 13:07:42.944687 2015] [:error] [pid 15335]   File "/usr/lib/python2.7/site-packages/ipalib/plugins/migration.py", line 894, in execute
> [Fri Jan 16 13:07:42.944689 2015] [:error] [pid 15335]     ldap, config, ds_ldap, ds_base_dn, options
> [Fri Jan 16 13:07:42.944691 2015] [:error] [pid 15335]   File "/usr/lib/python2.7/site-packages/ipalib/plugins/migration.py", line 843, in migrate
> [Fri Jan 16 13:07:42.944692 2015] [:error] [pid 15335]     _update_default_group(ldap, pkey, config, context, True)
> [Fri Jan 16 13:07:42.944694 2015] [:error] [pid 15335] UnboundLocalError: local variable 'pkey' referenced before assignment

The problem is that pkey in migrate-ds is referenced in

        _update_default_group(ldap, pkey, config, context, True)

where it is not guaranteed it is created if for example neither users nor groups return a result.


This should be pretty straightforward.

What should be the desired behavior? Should we raise an error if no users/groups are found or should we just return an empty list of entries?

Up to you (and freeipa-devel discussion), error may be better as it will get the user notified.

master:

  • 06376a4 migrate-ds: exit with error message if no users/groups to migrate are found

ipa-4-1:

  • f7e6102 migrate-ds: exit with error message if no users/groups to migrate are found

Regression introduced by this patch fixed: #4952

ipa-4-1:

  • 3284cbf migrate-ds: print out failed attempts when no users/groups are migrated

master:

  • 5a5e1a2 migrate-ds: print out failed attempts when no users/groups are migrated

Metadata Update from @mkosek:
- Issue assigned to mbabinsk
- Issue set to the milestone: FreeIPA 4.1.3

7 years ago

Login to comment on this ticket.

Metadata