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

Unknown column 'profile.lastname' / Unknown column 'profile.firstname' #6427

Closed
randyjc opened this issue Jul 13, 2023 · 3 comments
Closed

Comments

@randyjc
Copy link

randyjc commented Jul 13, 2023

What steps will reproduce the problem?

  1. Create a space
  2. Open space
  3. click on members
  4. You get an error

What is the expected result?

Seeing all memberes

What do you get instead?

{
    "url": "/s/test/space/membership/members-list",
    "status": 500,
    "response": {
        "error": true,
        "message": "An internal server error occurred."
    },
    "textStatus": "error",
    "xhr": {
        "readyState": 4,
        "responseText": "{\"error\":true,\"message\":\"An internal server error occurred.\"}",
        "responseJSON": {
            "error": true,
            "message": "An internal server error occurred."
        },
        "status": 500,
        "statusText": "error"
    },
    "dataType": "json",
    "error": true,
    "message": "An internal server error occurred.",
    "errorThrown": "",
    "validationError": false
}

Logging:

PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'profile.lastname' in 'order clause' in /app/code/protected/vendor/yiisoft/yii2/db/Command.php:1302
Stack trace:
#0 /app/code/protected/vendor/yiisoft/yii2/db/Command.php(1302): PDOStatement->execute()
#1 /app/code/protected/vendor/yiisoft/yii2/db/Command.php(1168): yii\db\Command->internalExecute()
#2 /app/code/protected/vendor/yiisoft/yii2/db/Command.php(410): yii\db\Command->queryInternal()
#3 /app/code/protected/vendor/yiisoft/yii2/db/Query.php(249): yii\db\Command->queryAll()
#4 /app/code/protected/vendor/yiisoft/yii2/db/ActiveQuery.php(133): yii\db\Query->all()
#5 /app/code/protected/humhub/modules/user/widgets/UserListBox.php(72): yii\db\ActiveQuery->all()
#6 /app/code/protected/vendor/yiisoft/yii2/base/Widget.php(146): humhub\modules\user\widgets\UserListBox->run()
#7 /app/code/protected/humhub/modules/space/controllers/MembershipController.php(295): yii\base\Widget::widget()
#8 [internal function]: humhub\modules\space\controllers\MembershipController->actionMembersList()
#9 /app/code/protected/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array()
#10 /app/code/protected/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams()
#11 /app/code/protected/vendor/yiisoft/yii2/base/Module.php(552): yii\base\Controller->runAction()
#12 /app/code/protected/vendor/yiisoft/yii2/web/Application.php(103): yii\base\Module->runAction()
#13 /app/code/protected/vendor/yiisoft/yii2/base/Application.php(384): yii\web\Application->handleRequest()
#14 /app/code/index.php(23): yii\base\Application->run()
#15 {main}

Next yii\db\Exception: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'profile.lastname' in 'order clause'
The SQL being executed was: SELECT `user`.* FROM `user` LEFT JOIN `profile` ON `user`.`id` = `profile`.`user_id` LEFT JOIN `space_membership` ON space_membership.user_id=user.id WHERE (`user`.`status`=1) AND (`space_membership`.`status`=3) AND (`space_id`=1) AND (`user`.`status`=1) ORDER BY `profile`.`lastname` LIMIT 8 in /app/code/protected/vendor/yiisoft/yii2/db/Schema.php:676
Stack trace:
#0 /app/code/protected/vendor/yiisoft/yii2/db/Command.php(1307): yii\db\Schema->convertException()
#1 /app/code/protected/vendor/yiisoft/yii2/db/Command.php(1168): yii\db\Command->internalExecute()
#2 /app/code/protected/vendor/yiisoft/yii2/db/Command.php(410): yii\db\Command->queryInternal()
#3 /app/code/protected/vendor/yiisoft/yii2/db/Query.php(249): yii\db\Command->queryAll()
#4 /app/code/protected/vendor/yiisoft/yii2/db/ActiveQuery.php(133): yii\db\Query->all()
#5 /app/code/protected/humhub/modules/user/widgets/UserListBox.php(72): yii\db\ActiveQuery->all()
#6 /app/code/protected/vendor/yiisoft/yii2/base/Widget.php(146): humhub\modules\user\widgets\UserListBox->run()
#7 /app/code/protected/humhub/modules/space/controllers/MembershipController.php(295): yii\base\Widget::widget()
#8 [internal function]: humhub\modules\space\controllers\MembershipController->actionMembersList()
#9 /app/code/protected/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array()
#10 /app/code/protected/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams()
#11 /app/code/protected/vendor/yiisoft/yii2/base/Module.php(552): yii\base\Controller->runAction()
#12 /app/code/protected/vendor/yiisoft/yii2/web/Application.php(103): yii\base\Module->runAction()
#13 /app/code/protected/vendor/yiisoft/yii2/base/Application.php(384): yii\web\Application->handleRequest()
#14 /app/code/index.php(23): yii\base\Application->run()
#15 {main}
Additional Information:
Array
(
[0] => 42S22
[1] => 1054
[2] => Unknown column 'profile.lastname' in 'order clause'
)

Additional info

Q A
HumHub version 1.14.2
PHP version PHP - Version - 8.1.2-1ubuntu2.9
Operating system cloudron - ubuntu

Note: Also provide the full error stacks from Administration --> Information --> Logging and errors from your browser console if possible.

https://paste.cloudbasis.nl/?e32707c295280dbe#FArr2xwN1x7H6jUuxHeJRLkhDwkGuMVFzMpwBHtF1xFW

Note: Please use the community site for any questions on customizing HumHub.

@randyjc
Copy link
Author

randyjc commented Jul 13, 2023

On my other instance I get the exact same errors as above, but then also these:

PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'profile.birthday' in 'field list' in /app/code/protected/vendor/yiisoft/yii2/db/Command.php:1302
Stack trace:
#0 /app/code/protected/vendor/yiisoft/yii2/db/Command.php(1302): PDOStatement->execute()
#1 /app/code/protected/vendor/yiisoft/yii2/db/Command.php(1168): yii\db\Command->internalExecute()
#2 /app/code/protected/vendor/yiisoft/yii2/db/Command.php(410): yii\db\Command->queryInternal()
#3 /app/code/protected/vendor/yiisoft/yii2/db/Query.php(249): yii\db\Command->queryAll()
#4 /app/code/protected/vendor/yiisoft/yii2/db/ActiveQuery.php(133): yii\db\Query->all()
#5 /app/data/modules/calendar/interfaces/event/AbstractCalendarQuery.php(743): yii\db\ActiveQuery->all()
#6 /app/data/modules/calendar/interfaces/event/AbstractCalendarQuery.php(241): humhub\modules\calendar\interfaces\event\AbstractCalendarQuery->all()
#7 /app/data/modules/calendar/interfaces/event/AbstractCalendarQuery.php(299): humhub\modules\calendar\interfaces\event\AbstractCalendarQuery::findForFilter()
#8 /app/data/modules/calendar/integration/BirthdayCalendar.php(52): humhub\modules\calendar\interfaces\event\AbstractCalendarQuery::findForEvent()
#9 /app/data/modules/calendar/Events.php(83): humhub\modules\calendar\integration\BirthdayCalendar::addItems()
#10 [internal function]: humhub\modules\calendar\Events::onFindCalendarItems()
#11 /app/code/protected/vendor/yiisoft/yii2/base/Event.php(312): call_user_func()
#12 /app/code/protected/vendor/yiisoft/yii2/base/Component.php(642): yii\base\Event::trigger()
#13 /app/data/modules/calendar/interfaces/CalendarService.php(135): yii\base\Component->trigger()
#14 /app/data/modules/calendar/interfaces/CalendarService.php(207): humhub\modules\calendar\interfaces\CalendarService->getCalendarItems()
#15 /app/data/modules/calendar/widgets/UpcomingEvents.php(48): humhub\modules\calendar\interfaces\CalendarService->getUpcomingEntries()
#16 /app/code/protected/humhub/components/Widget.php(63): humhub\modules\calendar\widgets\UpcomingEvents->run()
#17 /app/code/protected/humhub/widgets/BaseStack.php(88): humhub\components\Widget::widget()
#18 /app/code/protected/humhub/components/Widget.php(63): humhub\widgets\BaseStack->run()
#19 /app/code/protected/humhub/modules/space/views/space/home.php(60): humhub\components\Widget::widget()
#20 /app/code/protected/vendor/yiisoft/yii2/base/View.php(347): require('...')
#21 /app/code/protected/vendor/yiisoft/yii2/base/View.php(257): yii\base\View->renderPhpFile()
#22 /app/code/protected/vendor/yiisoft/yii2/base/View.php(156): yii\base\View->renderFile()
#23 /app/code/protected/vendor/yiisoft/yii2/base/Controller.php(407): yii\base\View->render()
#24 /app/code/protected/humhub/modules/space/controllers/SpaceController.php(106): yii\base\Controller->render()
#25 [internal function]: humhub\modules\space\controllers\SpaceController->actionHome()
#26 /app/code/protected/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array()
#27 /app/code/protected/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams()
#28 /app/code/protected/vendor/yiisoft/yii2/base/Module.php(552): yii\base\Controller->runAction()
#29 /app/code/protected/vendor/yiisoft/yii2/web/Application.php(103): yii\base\Module->runAction()
#30 /app/code/protected/vendor/yiisoft/yii2/base/Application.php(384): yii\web\Application->handleRequest()
#31 /app/code/index.php(23): yii\base\Application->run()
#32 {main}

Next yii\db\Exception: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'profile.birthday' in 'field list'
The SQL being executed was: SELECT `profile`.*, `user`.*, DATE_ADD(profile.birthday, INTERVAL 2023-YEAR(profile.birthday) YEAR) AS next_birthday FROM `user` LEFT JOIN `profile` ON `user`.`id` = `profile`.`user_id` WHERE (`user`.`status`=1) AND (DATE_ADD(profile.birthday, INTERVAL 2023-YEAR(profile.birthday) YEAR) BETWEEN '2023-07-13' AND '2023-08-13') AND (EXISTS (SELECT `space`.`id` FROM `space_membership` LEFT JOIN `space` ON space.id=space_membership.space_id WHERE (space.id=23) AND (space_membership.user_id=user.id AND space_membership.status=3))) ORDER BY `next_birthday` LIMIT 5 in /app/code/protected/vendor/yiisoft/yii2/db/Schema.php:676
Stack trace:
#0 /app/code/protected/vendor/yiisoft/yii2/db/Command.php(1307): yii\db\Schema->convertException()
#1 /app/code/protected/vendor/yiisoft/yii2/db/Command.php(1168): yii\db\Command->internalExecute()
#2 /app/code/protected/vendor/yiisoft/yii2/db/Command.php(410): yii\db\Command->queryInternal()
#3 /app/code/protected/vendor/yiisoft/yii2/db/Query.php(249): yii\db\Command->queryAll()
#4 /app/code/protected/vendor/yiisoft/yii2/db/ActiveQuery.php(133): yii\db\Query->all()
#5 /app/data/modules/calendar/interfaces/event/AbstractCalendarQuery.php(743): yii\db\ActiveQuery->all()
#6 /app/data/modules/calendar/interfaces/event/AbstractCalendarQuery.php(241): humhub\modules\calendar\interfaces\event\AbstractCalendarQuery->all()
#7 /app/data/modules/calendar/interfaces/event/AbstractCalendarQuery.php(299): humhub\modules\calendar\interfaces\event\AbstractCalendarQuery::findForFilter()
#8 /app/data/modules/calendar/integration/BirthdayCalendar.php(52): humhub\modules\calendar\interfaces\event\AbstractCalendarQuery::findForEvent()
#9 /app/data/modules/calendar/Events.php(83): humhub\modules\calendar\integration\BirthdayCalendar::addItems()
#10 [internal function]: humhub\modules\calendar\Events::onFindCalendarItems()
#11 /app/code/protected/vendor/yiisoft/yii2/base/Event.php(312): call_user_func()
#12 /app/code/protected/vendor/yiisoft/yii2/base/Component.php(642): yii\base\Event::trigger()
#13 /app/data/modules/calendar/interfaces/CalendarService.php(135): yii\base\Component->trigger()
#14 /app/data/modules/calendar/interfaces/CalendarService.php(207): humhub\modules\calendar\interfaces\CalendarService->getCalendarItems()
#15 /app/data/modules/calendar/widgets/UpcomingEvents.php(48): humhub\modules\calendar\interfaces\CalendarService->getUpcomingEntries()
#16 /app/code/protected/humhub/components/Widget.php(63): humhub\modules\calendar\widgets\UpcomingEvents->run()
#17 /app/code/protected/humhub/widgets/BaseStack.php(88): humhub\components\Widget::widget()
#18 /app/code/protected/humhub/components/Widget.php(63): humhub\widgets\BaseStack->run()
#19 /app/code/protected/humhub/modules/space/views/space/home.php(60): humhub\components\Widget::widget()
#20 /app/code/protected/vendor/yiisoft/yii2/base/View.php(347): require('...')
#21 /app/code/protected/vendor/yiisoft/yii2/base/View.php(257): yii\base\View->renderPhpFile()
#22 /app/code/protected/vendor/yiisoft/yii2/base/View.php(156): yii\base\View->renderFile()
#23 /app/code/protected/vendor/yiisoft/yii2/base/Controller.php(407): yii\base\View->render()
#24 /app/code/protected/humhub/modules/space/controllers/SpaceController.php(106): yii\base\Controller->render()
#25 [internal function]: humhub\modules\space\controllers\SpaceController->actionHome()
#26 /app/code/protected/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array()
#27 /app/code/protected/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams()
#28 /app/code/protected/vendor/yiisoft/yii2/base/Module.php(552): yii\base\Controller->runAction()
#29 /app/code/protected/vendor/yiisoft/yii2/web/Application.php(103): yii\base\Module->runAction()
#30 /app/code/protected/vendor/yiisoft/yii2/base/Application.php(384): yii\web\Application->handleRequest()
#31 /app/code/index.php(23): yii\base\Application->run()
#32 {main}
Additional Information:
Array
(
[0] => 42S22
[1] => 1054
[2] => Unknown column 'profile.birthday' in 'field list'
)

I'm also unable to add users to a space manually when searching for them, I then get the exact same error as profile.lastname column not found.

@randyjc
Copy link
Author

randyjc commented Jul 13, 2023

By adding them manually I can open the members page. Need to check if it really fixes the rest of the problems.

ALTER TABLE profile ADD COLUMN lastname VARCHAR(255);
ALTER TABLE profile ADD COLUMN firstname VARCHAR(255);
ALTER TABLE profile ADD COLUMN birthdayVARCHAR(255); 

@randyjc
Copy link
Author

randyjc commented Jul 14, 2023

@randyjc randyjc closed this as completed Jul 14, 2023
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

No branches or pull requests

1 participant