Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NotFound: username: stage user not found #10

Open
tiran opened this issue Aug 7, 2015 · 3 comments · May be fixed by #30
Open

NotFound: username: stage user not found #10

tiran opened this issue Aug 7, 2015 · 3 comments · May be fixed by #30

Comments

@tiran
Copy link
Member

tiran commented Aug 7, 2015

I get a "stage user not found" error when the user already exists as an ordinary user. Perhaps the user model should check if the user already exists and print an error message.

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/cherrypy/_cprequest.py", line 670, in respond
    response.body = self.handler()
  File "/usr/lib/python2.7/site-packages/cherrypy/lib/encoding.py", line 217, in __call__
    self.body = self.oldhandler(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/cherrypy/_cpdispatch.py", line 61, in __call__
    return self.callable(*self.args, **self.kwargs)
  File "/srv/freeipa-community-portal/lib/python2.7/site-packages/freeipa_community_portal/app.py", line 66, in POST
    errors = user.save()
  File "/srv/freeipa-community-portal/lib/python2.7/site-packages/freeipa_community_portal/model/user.py", line 55, in save
    self._call_api()
  File "/srv/freeipa-community-portal/lib/python2.7/site-packages/freeipa_community_portal/model/user.py", line 69, in _call_api
    mail=self.email
  File "/usr/lib/python2.7/site-packages/ipalib/frontend.py", line 443, in __call__
    ret = self.run(*args, **options)
  File "/usr/lib/python2.7/site-packages/ipalib/frontend.py", line 761, in run
    return self.forward(*args, **options)
  File "/usr/lib/python2.7/site-packages/ipalib/frontend.py", line 782, in forward
    return self.Backend.rpcclient.forward(self.name, *args, **kw)
  File "/usr/lib/python2.7/site-packages/ipalib/rpc.py", line 888, in forward
    return self._call_command(command, params)
  File "/usr/lib/python2.7/site-packages/ipalib/rpc.py", line 865, in _call_command
    return command(*params)
  File "/usr/lib/python2.7/site-packages/ipalib/rpc.py", line 1016, in _call
    return self.__request(name, args)
  File "/usr/lib/python2.7/site-packages/ipalib/rpc.py", line 1010, in __request
    raise error_class(message=error['message'])
NotFound: username: stage user not found
@tiran
Copy link
Member Author

tiran commented Aug 7, 2015

Correction: I ALWAYS get a NotFound error.

To add extra fun: the stage user 'username' is created although I already have a normal user by that name. FreeIPA doesn't prevent name clashes.

@tiran
Copy link
Member Author

tiran commented Aug 7, 2015

This bug is really two bugs. First of all the portal also needs "System: Read Stage Users". Secondly stage user and normal user don't conflict. The portal should check the normal users to make sure that a stage user doesn't conflict with an ordinary user.

@tiran
Copy link
Member Author

tiran commented Aug 19, 2015

The NotFound exception is gone. The portal also needs 'System: Read Stage User' permission. The requirements is documented and added by create-portal-user.

tiran added a commit that referenced this issue Aug 19, 2015
Check if the username conflicts with an existing user. The check
is not perfect. A user might be created before the stage user is
activated. The code also suffers from a race condition. It's as
good as it can get without a better API, though.

closes #10

see https://fedorahosted.org/freeipa/ticket/5186
@tiran tiran linked a pull request Aug 19, 2015 that will close this issue
tiran added a commit that referenced this issue Aug 20, 2015
Check if the username conflicts with an existing user. The check
is not perfect. A user might be created before the stage user is
activated. The code also suffers from a race condition. It's as
good as it can get without a better API, though.

The commit also improves the error reporting code to report multiple
errors at once. A user doesn't have to 'probe' for errors until she
succeeds. It improves the user experience.

closes #10

see https://fedorahosted.org/freeipa/ticket/5186
tiran added a commit that referenced this issue Aug 20, 2015
Check if the username conflicts with an existing user. The check
is not perfect. A user might be created before the stage user is
activated. The code also suffers from a race condition. It's as
good as it can get without a better API, though.

The commit also improves the error reporting code to report multiple
errors at once. A user doesn't have to 'probe' for errors until she
succeeds. It improves the user experience.

closes #10

see https://fedorahosted.org/freeipa/ticket/5186
tiran added a commit to tiran/freeipa-community-portal that referenced this issue Aug 20, 2015
Check if the username conflicts with an existing user. The check
is not perfect. A user might be created before the stage user is
activated. The code also suffers from a race condition. It's as
good as it can get without a better API, though.

The commit also improves the error reporting code to report multiple
errors at once. A user doesn't have to 'probe' for errors until she
succeeds. It improves the user experience.

closes freeipa#10

see https://fedorahosted.org/freeipa/ticket/5186
tiran added a commit that referenced this issue Aug 20, 2015
The permission name is plural

    System: Read Stage Users

not singular

    System: Read Stage User

Closes #10
Closes #22
tiran added a commit that referenced this issue Aug 26, 2015
The permission name is plural

    System: Read Stage Users

not singular

    System: Read Stage User

Closes #10
Closes #22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant