Project

General

Profile

Actions

Bug #5632

open

Missing Parent Folder for Personal Repo lacks proper handling

Added by Andrew Whalan over 3 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
03.08.2020
Due date:
% Done:

0%

Estimated time:
Sorting:
Commit Number:
Affected Version:

Description

If you enable and set a personal repository group with a path in it, eg /u/${username}, and fail to create the parent folder(s), eg 'u' in this case, any user creation will fail. This setting is found at Super-Admin panel -> Settings-> Global -> Personal Repository Group

If you create the user as an admin a generic message is displayed that there was an error while creating the user, but no guidance as to why. There is no exception recorded.

If you sign-up for a new user with this misconfiguration, you will be presented with a 500 error page, and an exception will be recorded.

Suggested resolution is to warn on the configuration page when a parent directory for personal repository groups is set but does not exist.

The exception thrown by signing up when this is the case is:

Request: POST http://code-test.internal.devfu.com.au/_admin/register
192.168.1.10 Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36

Traceback (most recent call last):
  File "/opt/rhodecode/store/da2il1f83gci4333j0sd256nji9nlhpa-python2.7-pyramid-1.10.4/lib/python2.7/site-packages/pyramid/tweens.py", line 41, in excview_tween
    response = handler(request)
  File "/opt/rhodecode/store/da2il1f83gci4333j0sd256nji9nlhpa-python2.7-pyramid-1.10.4/lib/python2.7/site-packages/pyramid/router.py", line 148, in handle_request
    registry, request, context, context_iface, view_name
  File "/opt/rhodecode/store/da2il1f83gci4333j0sd256nji9nlhpa-python2.7-pyramid-1.10.4/lib/python2.7/site-packages/pyramid/view.py", line 667, in _call_view
    response = view_callable(context, request)
  File "/opt/rhodecode/store/da2il1f83gci4333j0sd256nji9nlhpa-python2.7-pyramid-1.10.4/lib/python2.7/site-packages/pyramid/config/views.py", line 169, in __call__
    return view(context, request)
  File "/opt/rhodecode/store/da2il1f83gci4333j0sd256nji9nlhpa-python2.7-pyramid-1.10.4/lib/python2.7/site-packages/pyramid/config/views.py", line 188, in attr_view
    return view(context, request)
  File "/opt/rhodecode/store/da2il1f83gci4333j0sd256nji9nlhpa-python2.7-pyramid-1.10.4/lib/python2.7/site-packages/pyramid/config/views.py", line 214, in predicate_wrapper
    return view(context, request)
  File "/opt/rhodecode/store/da2il1f83gci4333j0sd256nji9nlhpa-python2.7-pyramid-1.10.4/lib/python2.7/site-packages/pyramid/viewderivers.py", line 436, in rendered_view
    result = view(context, request)
  File "/opt/rhodecode/store/da2il1f83gci4333j0sd256nji9nlhpa-python2.7-pyramid-1.10.4/lib/python2.7/site-packages/pyramid/viewderivers.py", line 132, in _class_view
    response = getattr(inst, attr)()
  File "/opt/rhodecode/store/g3hzna3wfnis7bxghysh533snc0majv8-python2.7-rhodecode-enterprise-ce-4.20.1/lib/python2.7/site-packages/rhodecode/lib/auth.py", line 2507, in local_wrapper
    return wrapper(func, *args, **kwds)
  File "/opt/rhodecode/store/g3hzna3wfnis7bxghysh533snc0majv8-python2.7-rhodecode-enterprise-ce-4.20.1/lib/python2.7/site-packages/rhodecode/lib/auth.py", line 1897, in __wrapper
    return func(*fargs, **fkwargs)
  File "/opt/rhodecode/store/g3hzna3wfnis7bxghysh533snc0majv8-python2.7-rhodecode-enterprise-ce-4.20.1/lib/python2.7/site-packages/rhodecode/apps/login/views.py", line 310, in register_post
    form_result, extern_name=extern_name, extern_type=extern_type)
  File "/opt/rhodecode/store/g3hzna3wfnis7bxghysh533snc0majv8-python2.7-rhodecode-enterprise-ce-4.20.1/lib/python2.7/site-packages/rhodecode/model/user.py", line 408, in create_registration
    new_user = self.create(form_data)
  File "/opt/rhodecode/store/g3hzna3wfnis7bxghysh533snc0majv8-python2.7-rhodecode-enterprise-ce-4.20.1/lib/python2.7/site-packages/rhodecode/model/user.py", line 159, in create
    return UserModel().create_or_update(**user_data)
  File "/opt/rhodecode/store/g3hzna3wfnis7bxghysh533snc0majv8-python2.7-rhodecode-enterprise-ce-4.20.1/lib/python2.7/site-packages/rhodecode/model/user.py", line 380, in create_or_update
    new_user, commit_early=False)
  File "/opt/rhodecode/store/g3hzna3wfnis7bxghysh533snc0majv8-python2.7-rhodecode-enterprise-ce-4.20.1/lib/python2.7/site-packages/rhodecode/model/repo_group.py", line 115, in create_personal_repo_group
    commit_early=commit_early)
  File "/opt/rhodecode/store/g3hzna3wfnis7bxghysh533snc0majv8-python2.7-rhodecode-enterprise-ce-4.20.1/lib/python2.7/site-packages/rhodecode/model/repo_group.py", line 251, in create
    'is not yet existing.' % (parent_group_name, group_name))
ValueError: Parent group `u` given in `u/test1` group name is not yet existing.

No data to display

Actions

Also available in: Atom PDF