owncloud / core

:cloud: ownCloud web server core (Files, DAV, etc.)
https://owncloud.com
GNU Affero General Public License v3.0
8.39k stars 2.05k forks source link

Can't create user "tester@noz.de​" #20917

Closed davidak closed 8 years ago

davidak commented 8 years ago

Steps to reproduce

  1. user: test@test.de​ pw: 1

other user names worked, also with this syntax.

can't reproduce it in your public demo with oC 8.2.0

Expected behaviour

the user should get created :)

Actual behaviour

Get error message:

bildschirmfoto 2015-12-03 um 10 36 44

Beim Erstellen des Benutzers ist ein Fehler aufgetreten Benutzer konnte nicht erstellt werden.

Server configuration

Operating system: Ubuntu 12.04.5 LTS

Web server: Apache 2.2

Database: mysql Ver 14.14 Distrib 5.5.44

PHP version: 5.6.15

ownCloud version: 8.1.1

Updated from an older ownCloud or fresh install: fresh install

List of activated apps:

If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
from within your ownCloud installation folder

The content of config/config.php:

If you have access to your command line run e.g.:
sudo -u www-data php occ config:list system --public
from within your ownCloud installation folder

or 

Insert your config.php content here
(Without the database password, passwordsalt and secret)

Are you using external storage, if yes which one: no

Are you using encryption: no

Are you using an external user-backend, if yes which one: no

Client configuration

Browser: Chromium Version 46.0.2490.71 (64-bit)

Operating system: OS X 10.9.5

Logs

Web server error log

none at that time

ownCloud log (data/owncloud.log)

none at that time

Browser log

none at that time
RobinMcCorkell commented 8 years ago

Unable to reproduce on oC 8.2.1

MorrisJobke commented 8 years ago

I can't reproduce this with stable8.1 nor with tag v8.1.1

Can you check the returned response in the web dev tools in the network tab?

davidak commented 8 years ago

@MorrisJobke now it works with username "test@test.de​", but the one i originally wanted to create still leads to this error.

bildschirmfoto 2015-12-04 um 11 21 39

i tested it with that e-mail in the official demo and there is also the error.

bildschirmfoto 2015-12-04 um 11 31 50

this email is for testing only: tester@noz.de​

i also tested in Firefox 42 (OS X 10.9.5) and got also this error (in demo).

so this is an actual bug.

PVince81 commented 8 years ago

Is it a user that you just deleted and tried to recreate ? Because as long as the "Undo" banner is there, the user is not really deleted. See https://github.com/owncloud/core/issues/13589

Is there a matching entry in owncloud.log that might show more clues ?

davidak commented 8 years ago

i tried multiple times to create the user but it never worked. every time this error, also the first time.

i looked at the log with tailf and get no new entries.

PVince81 commented 8 years ago

Since you're still on 8.1.1 I'd recommend at least to try the latest from 8.1.x which is 8.1.4.

So far there isn't enough information to be able to reproduce or debug this.

davidak commented 8 years ago

@PVince81 as i mentioned in my comment above, it also happens in the official demo with version 8.2.0!

just try it yourself: https://demo.owncloud.org/index.php/settings/users

what information can i give you?

PVince81 commented 8 years ago

I saw "can't reproduce it in your public demo with oC 8.2.0" in the first post, maybe a typo. Let me have a try.

RobinMcCorkell commented 8 years ago

It works fine on the demo...

PVince81 commented 8 years ago

Maybe before creating the user, check "oc_users" to see if the user already exists, just in case ?

Looking at the code, Forbidden can be thrown in the following cases on 8.2.0:

PVince81 commented 8 years ago

From what I see, the database (default) implementation of UserManager can only throw an exception if there is an error doing the INSERT, maybe a duplicate ? Or if the password hasher throws. https://github.com/owncloud/core/blob/v8.2.0/lib/private/user/database.php#L66

@davidak you could add some logging statement here https://github.com/owncloud/core/blob/v8.2.0/settings/controller/userscontroller.php#L376 and here https://github.com/owncloud/core/blob/v8.2.0/settings/controller/userscontroller.php#L316 (log the exception) to find out the cause.

davidak commented 8 years ago

i checked the table oc_users in the database and it is definitely not there.

inserted this to my 8.1.1:

                } catch (\Exception $exception) {
error_log($exception, 0);
                        return new DataResponse(

get error message: PHP message: exception 'Exception' with message 'Folgende Zeichen sind im Benutzernamen erlaubt: \xe2\x80\x9ea-z\xe2\x80\x9c, \xe2\x80\x9eA-Z\xe2\x80\x9c, \xe2\x80\x9e0-9\xe2\x80\x9c und \xe2\x80\x9e_.@-\xe2\x80\x9c'

PVince81 commented 8 years ago

Hmm, "@" and "." are allowed. Can you log the user name too to see if it arrived properly ?

davidak commented 8 years ago

error_log( "usr:" . $username . " pw:" . $password);

PHP message: usr:tester@noz.de\xe2\x80\x8b pw:1234
PHP message: usr:tester@noz.de\xe2\x80\x8bd pw:1234
PHP message: usr:tester@noz.de\xe2\x80\x8b pw:123456

name of that Unicode Character: ZERO WIDTH SPACE

so, where does the characters after the username come from? and why only with this name?

answer: copy and paste error. i copied the inital mail adress with that character (don't know why) and it was still there after clearing the input field and change the name to "tester". when i reload the page and type it by hand, it works ;)

to prevent this error, there should at lease be a log entry and better a meaningful error message to the user.

lock[bot] commented 5 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.