php artisan migrate failed #3950

Closed
opened 2026-02-05 07:55:51 +03:00 by OVERLORD · 4 comments
Owner

Originally created by @donatid on GitHub (Aug 2, 2023).

Describe the Bug

Hello,

I'd tried to install the Bookstack on a VPS server using MariaDB 10.6 and PHP 8.2, but I found an error during the php artisan migrate, please see below:

  SQLSTATE[HY000]: General error: 1364 Field 'password' doesn't have a default value (SQL: insert into `users` (`email`, `name`, `system_name`, `email_confirmed`, `created_at`, `updated_at`) values (guest@example.com, Guest, public, 1, 2023-08-02 18:46:58, 2023-08-02 18:46:58))  

  SQLSTATE[HY000]: General error: 1364 Field 'password' doesn't have a default value  

Steps to Reproduce

  1. sudo su - bookstack
  2. git clone https://github.com/BookStackApp/BookStack.git --branch release --single-branch www
  3. composer install --no-dev

Expected Behaviour

"php artisan migrate" should be successful without error

Screenshots or Additional Context

Screenshot 2023-08-03 at 01 49 26

Browser Details

No response

Exact BookStack Version

v23.06.2

PHP Version

82

Hosting Environment

AlmaLinux 9.2, installed using manual method.

Originally created by @donatid on GitHub (Aug 2, 2023). ### Describe the Bug Hello, I'd tried to install the Bookstack on a VPS server using MariaDB 10.6 and PHP 8.2, but I found an error during the php artisan migrate, please see below: ``` SQLSTATE[HY000]: General error: 1364 Field 'password' doesn't have a default value (SQL: insert into `users` (`email`, `name`, `system_name`, `email_confirmed`, `created_at`, `updated_at`) values (guest@example.com, Guest, public, 1, 2023-08-02 18:46:58, 2023-08-02 18:46:58)) SQLSTATE[HY000]: General error: 1364 Field 'password' doesn't have a default value ``` ### Steps to Reproduce 1. sudo su - bookstack 2. git clone https://github.com/BookStackApp/BookStack.git --branch release --single-branch www 3. composer install --no-dev ### Expected Behaviour "php artisan migrate" should be successful without error ### Screenshots or Additional Context ![Screenshot 2023-08-03 at 01 49 26](https://github.com/BookStackApp/BookStack/assets/59122475/f591969b-1cc8-4feb-a527-fe9e04f589d9) ### Browser Details _No response_ ### Exact BookStack Version v23.06.2 ### PHP Version 82 ### Hosting Environment AlmaLinux 9.2, installed using manual method.
OVERLORD added the 🐛 Bug label 2026-02-05 07:55:51 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Aug 3, 2023):

Hi @donatid,

  • What's the output of running git status from your BookStack install directory?
  • Have you installed php and/or mariadb from external repos? I'm not seeing those versions within default Alma 9 repositories.
  • Have you applied any specific changes to mariadb-server config after install?
@ssddanbrown commented on GitHub (Aug 3, 2023): Hi @donatid, - What's the output of running `git status` from your BookStack install directory? - Have you installed php and/or mariadb from external repos? I'm not seeing those versions within default Alma 9 repositories. - Have you applied any specific changes to mariadb-server config after install?
Author
Owner

@donatid commented on GitHub (Aug 3, 2023):

Hi @ssddanbrown

  • Here is the output from git status command:
    git status
    On branch release
    Your branch is up to date with 'origin/release.'

Changes to be committed:
(use "git restore --staged ..." to unstage)
modified: app/Config/database.php

Here is what I have added to databases.php:

        'mysql_ssl' => [
            'driver' => 'mysql',
            'url' => env('DATABASE_URL'),
            'host' => env('DB_HOST', '127.0.0.1'),
            'port' => env('DB_PORT', '3306'),
            'database' => env('DB_DATABASE', 'forge'),
            'username' => env('DB_USERNAME', 'forge'),
            'password' => env('DB_PASSWORD', ''),
            'unix_socket' => env('DB_SOCKET', ''),
            'charset' => 'utf8mb4',
            'collation' => 'utf8mb4_unicode_ci',
            'prefix' => '',
            'prefix_indexes' => true,
            'strict' => true,
            'engine' => null,
                        'sslmode' => env('DB_SSLMODE', 'prefer'),
            'options' => extension_loaded('pdo_mysql') ? [
                                PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT => false,
                                PDO::MYSQL_ATTR_SSL_CA => env('DB_MYSQL_ATTR_SSL_CA'),
                                PDO::MYSQL_ATTR_SSL_KEY => env('DB_MYSQL_ATTR_SSL_KEY'),
                                PDO::MYSQL_ATTR_SSL_CERT => env('DB_MYSQL_ATTR_SSL_CERT'),
            ] : [],
        ],
  • Yes, I'm using MariaDB 10.6 cluster and connected through SSL. The PHP was compiled and installed from the source. The MariaDB client version is MariaDB-client-10.10.5-1.el8.x86_64
  • I'm unsure about the questions. I'm using this server for several Laravel apps, which works fine.

Thanks

@donatid commented on GitHub (Aug 3, 2023): Hi @ssddanbrown - Here is the output from git status command: git status On branch release Your branch is up to date with 'origin/release.' Changes to be committed: (use "git restore --staged <file>..." to unstage) modified: app/Config/database.php Here is what I have added to databases.php: ``` 'mysql_ssl' => [ 'driver' => 'mysql', 'url' => env('DATABASE_URL'), 'host' => env('DB_HOST', '127.0.0.1'), 'port' => env('DB_PORT', '3306'), 'database' => env('DB_DATABASE', 'forge'), 'username' => env('DB_USERNAME', 'forge'), 'password' => env('DB_PASSWORD', ''), 'unix_socket' => env('DB_SOCKET', ''), 'charset' => 'utf8mb4', 'collation' => 'utf8mb4_unicode_ci', 'prefix' => '', 'prefix_indexes' => true, 'strict' => true, 'engine' => null, 'sslmode' => env('DB_SSLMODE', 'prefer'), 'options' => extension_loaded('pdo_mysql') ? [ PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT => false, PDO::MYSQL_ATTR_SSL_CA => env('DB_MYSQL_ATTR_SSL_CA'), PDO::MYSQL_ATTR_SSL_KEY => env('DB_MYSQL_ATTR_SSL_KEY'), PDO::MYSQL_ATTR_SSL_CERT => env('DB_MYSQL_ATTR_SSL_CERT'), ] : [], ], ``` - Yes, I'm using MariaDB 10.6 cluster and connected through SSL. The PHP was compiled and installed from the source. The MariaDB client version is MariaDB-client-10.10.5-1.el8.x86_64 - I'm unsure about the questions. I'm using this server for several Laravel apps, which works fine. Thanks
Author
Owner

@ssddanbrown commented on GitHub (Aug 3, 2023):

Okay, yeah, we don't support or advise custom changes to app files, like those you've made to the db config file.
Changes to app files may cause issues and/or interfere with updates.
It's specifically the 'strict' => true, part of the added config that's causing trouble, since we don't use strict mode in the default connection.

@ssddanbrown commented on GitHub (Aug 3, 2023): Okay, yeah, we don't support or advise custom changes to app files, like those you've made to the db config file. Changes to app files may cause issues and/or interfere with updates. It's specifically the `'strict' => true,` part of the added config that's causing trouble, since we don't use strict mode in the default connection.
Author
Owner

@donatid commented on GitHub (Aug 3, 2023):

Hi @ssddanbrown

You're correct, the error is gone, and the migration was successful after I changed the strict value to false.

I'll close this issue.

Thank you very much

@donatid commented on GitHub (Aug 3, 2023): Hi @ssddanbrown You're correct, the error is gone, and the migration was successful after I changed the strict value to false. I'll close this issue. Thank you very much
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#3950