Skip to content

New install, cannot register admin #495

@lukebarone

Description

@lukebarone

Hi folks,

Attempted to install on a fresh Debian Bookworm server with PHP 8.2, MariaDB, and Apache 2.

After commenting out two ALTER TABLE lines in /database_schema/upgrades/2.9/schema.sql, I can get through the install (the tables pending_reservations and users_customers do not exist, so the ALTER TABLE statements throw an error), I can get through the installation, but cannot register any users.

Checking the log, I get the following when attempting to register my admin user:

[2025-03-25T21:39:28.461028+00:00] app.ERROR: [User=  ()] ProcessAction Error. Action register, Error Exception: There was an error executing your query\nCannot add or update a child row: a foreign key constraint fails (`librebooking`.`users`, CONSTRAINT `users_ibfk_1` FOREIGN KEY (`status_id`) REFERENCES `user_statuses` (`status_id`) ON UPDATE CASCADE) in /var/www/booking/lib/Database/MySQL/MySqlConnection.php:119 Stack trace: #0 /var/www/booking/lib/Database/MySQL/MySqlConnection.php(106): MySqlConnection->_handleError() #1 /var/www/booking/lib/Database/Database.php(79): MySqlConnection->Execute() #2 /var/www/booking/Domain/Access/UserRepository.php(406): Database->ExecuteInsert() #3 /var/www/booking/lib/Application/Authentication/Registration.php(108): UserRepository->Add() #4 /var/www/booking/Presenters/RegistrationPresenter.php(138): Registration->Register() #5 /var/www/booking/Presenters/ActionPresenter.php(68): RegistrationPresenter->Register() #6 /var/www/booking/Pages/RegistrationPage.php(229): ActionPresenter->ProcessAction() #7 /var/www/booking/Pages/ActionPage.php(27): RegistrationPage->ProcessAction() #8 /var/www/booking/Web/register.php(8): ActionPage->PageLoad() #9 {main} [File=/var/www/booking/Presenters/ActionPresenter.php,Line=71] [] {"url":"/booked/Web/register.php?action=register","ip":"10.3.11.139","http_method":"POST","server":"10.3.10.13","referrer":"http://10.3.10.13/booked/Web/register.php"}

This is fixed if we switch to the master branch

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions