ovflowd / chocolatey

:chocolate_bar: The open source Habbo.com Engine & CMS
GNU General Public License v3.0
50 stars 19 forks source link

Unable create new Avatar via Settings > Avatars #164

Closed s150217754 closed 7 years ago

s150217754 commented 7 years ago

First Reported by @BobyTS

Users are not able to create a new Avatar via Settings > Avatars.

Error message: cannotcreate

Chrome Error Log POST http://localhost/api/user/avatars 500 (Internal Server Error)

Lumen Log

[2017-04-12 16:29:52] lumen.ERROR: PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 's150217754' for key 'username' in C:\xampp\htdocs\vendor\illuminate\database\Connection.php:449
Stack trace:
#0 C:\xampp\htdocs\vendor\illuminate\database\Connection.php(449): PDOStatement->execute()
#1 C:\xampp\htdocs\vendor\illuminate\database\Connection.php(640): Illuminate\Database\Connection->Illuminate\Database\{closure}('insert into `us...', Array)
#2 C:\xampp\htdocs\vendor\illuminate\database\Connection.php(607): Illuminate\Database\Connection->runQueryCallback('insert into `us...', Array, Object(Closure))
#3 C:\xampp\htdocs\vendor\illuminate\database\Connection.php(450): Illuminate\Database\Connection->run('insert into `us...', Array, Object(Closure))
#4 C:\xampp\htdocs\vendor\illuminate\database\Connection.php(404): Illuminate\Database\Connection->statement('insert into `us...', Array)
#5 C:\xampp\htdocs\vendor\illuminate\database\Query\Processors\Processor.php(32): Illuminate\Database\Connection->insert('insert into `us...', Array)
#6 C:\xampp\htdocs\vendor\illuminate\database\Query\Builder.php(2131): Illuminate\Database\Query\Processors\Processor->processInsertGetId(Object(Sofa\Eloquence\Query\Builder), 'insert into `us...', Array, 'id')
#7 C:\xampp\htdocs\vendor\illuminate\database\Eloquent\Builder.php(1242): Illuminate\Database\Query\Builder->insertGetId(Array, 'id')
#8 C:\xampp\htdocs\vendor\illuminate\database\Eloquent\Model.php(674): Illuminate\Database\Eloquent\Builder->__call('insertGetId', Array)
#9 C:\xampp\htdocs\vendor\illuminate\database\Eloquent\Model.php(639): Illuminate\Database\Eloquent\Model->insertAndSetId(Object(Sofa\Eloquence\Builder), Array)
#10 C:\xampp\htdocs\vendor\illuminate\database\Eloquent\Model.php(508): Illuminate\Database\Eloquent\Model->performInsert(Object(Sofa\Eloquence\Builder))
#11 C:\xampp\htdocs\vendor\sofa\hookable\src\Hookable.php(125): Illuminate\Database\Eloquent\Model->save(Array)
#12 C:\xampp\htdocs\app\Models\User.php(187): App\Models\User->save()
#13 C:\xampp\htdocs\app\Http\Controllers\AccountController.php(223): App\Models\User->store('s150217754', 'dfb6662bf7af354...', 'testemailaddress@hotel.com', '127.0.0.1')
#14 C:\xampp\htdocs\app\Http\Controllers\AccountController.php(198): App\Http\Controllers\AccountController->createUser(Object(Illuminate\Http\Request), Array)
#15 [internal function]: App\Http\Controllers\AccountController->createAvatar(Object(Illuminate\Http\Request))
#16 C:\xampp\htdocs\vendor\illuminate\container\BoundMethod.php(29): call_user_func_array(Array, Array)
#17 C:\xampp\htdocs\vendor\illuminate\container\BoundMethod.php(87): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#18 C:\xampp\htdocs\vendor\illuminate\container\BoundMethod.php(31): Illuminate\Container\BoundMethod::callBoundMethod(Object(Laravel\Lumen\Application), Array, Object(Closure))
#19 C:\xampp\htdocs\vendor\illuminate\container\Container.php(531): Illuminate\Container\BoundMethod::call(Object(Laravel\Lumen\Application), Array, Array, NULL)
#20 C:\xampp\htdocs\vendor\laravel\lumen-framework\src\Concerns\RoutesRequests.php(741): Illuminate\Container\Container->call(Array, Array)
#21 C:\xampp\htdocs\vendor\laravel\lumen-framework\src\Concerns\RoutesRequests.php(707): Laravel\Lumen\Application->callControllerCallable(Array, Array)
#22 C:\xampp\htdocs\vendor\laravel\lumen-framework\src\Concerns\RoutesRequests.php(681): Laravel\Lumen\Application->callLumenController(Object(App\Http\Controllers\AccountController), 'createAvatar', Array)
#23 C:\xampp\htdocs\vendor\laravel\lumen-framework\src\Concerns\RoutesRequests.php(643): Laravel\Lumen\Application->callControllerAction(Array)
#24 C:\xampp\htdocs\vendor\laravel\lumen-framework\src\Concerns\RoutesRequests.php(623): Laravel\Lumen\Application->callActionOnArrayBasedRoute(Array)
#25 [internal function]: Laravel\Lumen\Application->Laravel\Lumen\Concerns\{closure}(Object(Illuminate\Http\Request))
#26 C:\xampp\htdocs\vendor\laravel\lumen-framework\src\Routing\Pipeline.php(52): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#27 C:\xampp\htdocs\app\Http\Middleware\Maintenance.php(25): Laravel\Lumen\Routing\Pipeline->Laravel\Lumen\Routing\{closure}(Object(Illuminate\Http\Request))
#28 C:\xampp\htdocs\vendor\illuminate\pipeline\Pipeline.php(148): App\Http\Middleware\Maintenance->handle(Object(Illuminate\Http\Request), Object(Closure))
#29 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#30 C:\xampp\htdocs\vendor\laravel\lumen-framework\src\Routing\Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#31 C:\xampp\htdocs\vendor\illuminate\pipeline\Pipeline.php(102): Laravel\Lumen\Routing\Pipeline->Laravel\Lumen\Routing\{closure}(Object(Illuminate\Http\Request))
#32 C:\xampp\htdocs\vendor\laravel\lumen-framework\src\Concerns\RoutesRequests.php(778): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#33 C:\xampp\htdocs\vendor\laravel\lumen-framework\src\Concerns\RoutesRequests.php(624): Laravel\Lumen\Application->sendThroughPipeline(Array, Object(Closure))
#34 C:\xampp\htdocs\vendor\laravel\lumen-framework\src\Concerns\RoutesRequests.php(528): Laravel\Lumen\Application->handleFoundRoute(Array)
#35 [internal function]: Laravel\Lumen\Application->Laravel\Lumen\Concerns\{closure}(Object(Illuminate\Http\Request))
#36 C:\xampp\htdocs\vendor\laravel\lumen-framework\src\Routing\Pipeline.php(52): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#37 C:\xampp\htdocs\vendor\rdehnhardt\lumen-maintenance-mode\src\Http\Middleware\MaintenanceModeMiddleware.php(49): Laravel\Lumen\Routing\Pipeline->Laravel\Lumen\Routing\{closure}(Object(Illuminate\Http\Request))
#38 C:\xampp\htdocs\vendor\illuminate\pipeline\Pipeline.php(148): Rdehnhardt\MaintenanceMode\Http\Middleware\MaintenanceModeMiddleware->handle(Object(Illuminate\Http\Request), Object(Closure))
#39 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#40 C:\xampp\htdocs\vendor\laravel\lumen-framework\src\Routing\Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#41 C:\xampp\htdocs\vendor\illuminate\pipeline\Pipeline.php(102): Laravel\Lumen\Routing\Pipeline->Laravel\Lumen\Routing\{closure}(Object(Illuminate\Http\Request))
#42 C:\xampp\htdocs\vendor\laravel\lumen-framework\src\Concerns\RoutesRequests.php(778): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#43 C:\xampp\htdocs\vendor\laravel\lumen-framework\src\Concerns\RoutesRequests.php(534): Laravel\Lumen\Application->sendThroughPipeline(Array, Object(Closure))
#44 C:\xampp\htdocs\vendor\laravel\lumen-framework\src\Concerns\RoutesRequests.php(475): Laravel\Lumen\Application->dispatch(NULL)
#45 C:\xampp\htdocs\index.php(26): Laravel\Lumen\Application->run()
#46 {main}

Next Illuminate\Database\QueryException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 's150217754' for key 'username' (SQL: insert into `users` (`username`, `mail`, `motto`, `look`, `auth_ticket`, `password`, `account_created`, `ip_current`) values (s150217754, testemailaddress@hotel.com, I'm new to this game!!, hr-893-35.hd-209-10.ch-3109-82-1408.lg-3023-82.sh-906-64, , c711202a3c5f2f39f662be87d8331bef79f59590f60aa80c4ddb254d6ebcae82, 1492014592, 127.0.0.1)) in C:\xampp\htdocs\vendor\illuminate\database\Connection.php:647
Stack trace:
#0 C:\xampp\htdocs\vendor\illuminate\database\Connection.php(607): Illuminate\Database\Connection->runQueryCallback('insert into `us...', Array, Object(Closure))
#1 C:\xampp\htdocs\vendor\illuminate\database\Connection.php(450): Illuminate\Database\Connection->run('insert into `us...', Array, Object(Closure))
#2 C:\xampp\htdocs\vendor\illuminate\database\Connection.php(404): Illuminate\Database\Connection->statement('insert into `us...', Array)
#3 C:\xampp\htdocs\vendor\illuminate\database\Query\Processors\Processor.php(32): Illuminate\Database\Connection->insert('insert into `us...', Array)
#4 C:\xampp\htdocs\vendor\illuminate\database\Query\Builder.php(2131): Illuminate\Database\Query\Processors\Processor->processInsertGetId(Object(Sofa\Eloquence\Query\Builder), 'insert into `us...', Array, 'id')
#5 C:\xampp\htdocs\vendor\illuminate\database\Eloquent\Builder.php(1242): Illuminate\Database\Query\Builder->insertGetId(Array, 'id')
#6 C:\xampp\htdocs\vendor\illuminate\database\Eloquent\Model.php(674): Illuminate\Database\Eloquent\Builder->__call('insertGetId', Array)
#7 C:\xampp\htdocs\vendor\illuminate\database\Eloquent\Model.php(639): Illuminate\Database\Eloquent\Model->insertAndSetId(Object(Sofa\Eloquence\Builder), Array)
#8 C:\xampp\htdocs\vendor\illuminate\database\Eloquent\Model.php(508): Illuminate\Database\Eloquent\Model->performInsert(Object(Sofa\Eloquence\Builder))
#9 C:\xampp\htdocs\vendor\sofa\hookable\src\Hookable.php(125): Illuminate\Database\Eloquent\Model->save(Array)
#10 C:\xampp\htdocs\app\Models\User.php(187): App\Models\User->save()
#11 C:\xampp\htdocs\app\Http\Controllers\AccountController.php(223): App\Models\User->store('s150217754', 'dfb6662bf7af354...', 'testemailaddress@hotel.com', '127.0.0.1')
#12 C:\xampp\htdocs\app\Http\Controllers\AccountController.php(198): App\Http\Controllers\AccountController->createUser(Object(Illuminate\Http\Request), Array)
#13 [internal function]: App\Http\Controllers\AccountController->createAvatar(Object(Illuminate\Http\Request))
#14 C:\xampp\htdocs\vendor\illuminate\container\BoundMethod.php(29): call_user_func_array(Array, Array)
#15 C:\xampp\htdocs\vendor\illuminate\container\BoundMethod.php(87): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#16 C:\xampp\htdocs\vendor\illuminate\container\BoundMethod.php(31): Illuminate\Container\BoundMethod::callBoundMethod(Object(Laravel\Lumen\Application), Array, Object(Closure))
#17 C:\xampp\htdocs\vendor\illuminate\container\Container.php(531): Illuminate\Container\BoundMethod::call(Object(Laravel\Lumen\Application), Array, Array, NULL)
#18 C:\xampp\htdocs\vendor\laravel\lumen-framework\src\Concerns\RoutesRequests.php(741): Illuminate\Container\Container->call(Array, Array)
#19 C:\xampp\htdocs\vendor\laravel\lumen-framework\src\Concerns\RoutesRequests.php(707): Laravel\Lumen\Application->callControllerCallable(Array, Array)
#20 C:\xampp\htdocs\vendor\laravel\lumen-framework\src\Concerns\RoutesRequests.php(681): Laravel\Lumen\Application->callLumenController(Object(App\Http\Controllers\AccountController), 'createAvatar', Array)
#21 C:\xampp\htdocs\vendor\laravel\lumen-framework\src\Concerns\RoutesRequests.php(643): Laravel\Lumen\Application->callControllerAction(Array)
#22 C:\xampp\htdocs\vendor\laravel\lumen-framework\src\Concerns\RoutesRequests.php(623): Laravel\Lumen\Application->callActionOnArrayBasedRoute(Array)
#23 [internal function]: Laravel\Lumen\Application->Laravel\Lumen\Concerns\{closure}(Object(Illuminate\Http\Request))
#24 C:\xampp\htdocs\vendor\laravel\lumen-framework\src\Routing\Pipeline.php(52): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#25 C:\xampp\htdocs\app\Http\Middleware\Maintenance.php(25): Laravel\Lumen\Routing\Pipeline->Laravel\Lumen\Routing\{closure}(Object(Illuminate\Http\Request))
#26 C:\xampp\htdocs\vendor\illuminate\pipeline\Pipeline.php(148): App\Http\Middleware\Maintenance->handle(Object(Illuminate\Http\Request), Object(Closure))
#27 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#28 C:\xampp\htdocs\vendor\laravel\lumen-framework\src\Routing\Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#29 C:\xampp\htdocs\vendor\illuminate\pipeline\Pipeline.php(102): Laravel\Lumen\Routing\Pipeline->Laravel\Lumen\Routing\{closure}(Object(Illuminate\Http\Request))
#30 C:\xampp\htdocs\vendor\laravel\lumen-framework\src\Concerns\RoutesRequests.php(778): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#31 C:\xampp\htdocs\vendor\laravel\lumen-framework\src\Concerns\RoutesRequests.php(624): Laravel\Lumen\Application->sendThroughPipeline(Array, Object(Closure))
#32 C:\xampp\htdocs\vendor\laravel\lumen-framework\src\Concerns\RoutesRequests.php(528): Laravel\Lumen\Application->handleFoundRoute(Array)
#33 [internal function]: Laravel\Lumen\Application->Laravel\Lumen\Concerns\{closure}(Object(Illuminate\Http\Request))
#34 C:\xampp\htdocs\vendor\laravel\lumen-framework\src\Routing\Pipeline.php(52): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#35 C:\xampp\htdocs\vendor\rdehnhardt\lumen-maintenance-mode\src\Http\Middleware\MaintenanceModeMiddleware.php(49): Laravel\Lumen\Routing\Pipeline->Laravel\Lumen\Routing\{closure}(Object(Illuminate\Http\Request))
#36 C:\xampp\htdocs\vendor\illuminate\pipeline\Pipeline.php(148): Rdehnhardt\MaintenanceMode\Http\Middleware\MaintenanceModeMiddleware->handle(Object(Illuminate\Http\Request), Object(Closure))
#37 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#38 C:\xampp\htdocs\vendor\laravel\lumen-framework\src\Routing\Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#39 C:\xampp\htdocs\vendor\illuminate\pipeline\Pipeline.php(102): Laravel\Lumen\Routing\Pipeline->Laravel\Lumen\Routing\{closure}(Object(Illuminate\Http\Request))
#40 C:\xampp\htdocs\vendor\laravel\lumen-framework\src\Concerns\RoutesRequests.php(778): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#41 C:\xampp\htdocs\vendor\laravel\lumen-framework\src\Concerns\RoutesRequests.php(534): Laravel\Lumen\Application->sendThroughPipeline(Array, Object(Closure))
#42 C:\xampp\htdocs\vendor\laravel\lumen-framework\src\Concerns\RoutesRequests.php(475): Laravel\Lumen\Application->dispatch(NULL)
#43 C:\xampp\htdocs\index.php(26): Laravel\Lumen\Application->run()
#44 {main}  
s150217754 commented 7 years ago

Findings

  1. Chocolatey tries to inserts the user's existing avatar rather than the new name selected (see below for explanation)
  2. Error message shown as above

Explanation for S/N 1. e.g. you're logged into acme@mail.com with username Acme [already registered] Chocolatey tries to insert username Acme rather than the username "Steven" as per post

Related issues

160

ovflowd commented 7 years ago

Fixed it.