Error during installation: Syntax error or access violation: 1061 Duplicate key name 'search' #291

Closed
opened 2026-02-04 18:19:27 +03:00 by OVERLORD · 3 comments
Owner

Originally created by @m3579 on GitHub (Mar 5, 2017).

  • BookStack Version: v0.15.1 release
  • PHP Version: 5.6.11
  • MySQL Version: 5.6.25 (through XAMPP)
Expected Behavior

I was installing BookStack on my Windows 10 machine, following the instructions here for manual installation. I am using Apache and MySQL through XAMPP. I followed all of the instructions in the link, except for making sure that the PHP extensions were installed, but they do not seem to be the cause of this issue. The configuration in .env was the local environment with debug set to true. I was expecting to be able to start Apache and MySQL through XAMPP and then go to localhost:80 to BookStack's web interface.

I had tried installing BookStack once before, but it failed with the same error, so I tried it again and this was what I got.

Actual Behavior

When I ran php artisan migrate in step 8 of the installation instructions, the following errors came:

[Illuminate\Database\QueryException]
  SQLSTATE[42000]: Syntax error or access violation: 1061 Duplicate key name 'search' (SQL: ALTER TABLE pages ADD FULLTEXT search(name, text))



[PDOException]
  SQLSTATE[42000]: Syntax error or access violation: 1061 Duplicate key name 'search'

I checked the output in my browser at localhost:80, and there were two errors:


SQLSTATE[42S22]: Column not found: 1054 Unknown column 'system_name' in 'where clause' (SQL: select * from `users` where `system_name` = public limit 1)
C:\Users\path-to-repo\vendor\laravel\framework\src\Illuminate\Database\Connection.php#647
Illuminate\Database\QueryException

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'system_name' in 'where clause'
C:\Users\path-to-repo\vendor\laravel\framework\src\Illuminate\Database\Connection.php#319

I found the file (BookStack/database/migrations/2015_08_31_175240_add_search_indexes.php) where the line SQL: ALTER TABLE pages ADD FULLTEXT search(name, text) was, which was mentioned in the error message, and it seems that these were the troublesome lines:


    public function up()
    {
        DB::statement('ALTER TABLE pages ADD FULLTEXT search(name, text)');
        DB::statement('ALTER TABLE books ADD FULLTEXT search(name, description)');
        DB::statement('ALTER TABLE chapters ADD FULLTEXT search(name, description)');
    }
Originally created by @m3579 on GitHub (Mar 5, 2017). * BookStack Version: v0.15.1 release * PHP Version: 5.6.11 * MySQL Version: 5.6.25 (through XAMPP) ##### Expected Behavior I was installing BookStack on my Windows 10 machine, following the instructions [here](https://www.bookstackapp.com/docs/admin/installation/) for manual installation. I am using Apache and MySQL through XAMPP. I followed all of the instructions in the link, except for making sure that the PHP extensions were installed, but they do not seem to be the cause of this issue. The configuration in .env was the local environment with debug set to true. I was expecting to be able to start Apache and MySQL through XAMPP and then go to localhost:80 to BookStack's web interface. I had tried installing BookStack once before, but it failed with the same error, so I tried it again and this was what I got. ##### Actual Behavior When I ran `php artisan migrate` in step 8 of the installation instructions, the following errors came: ``` [Illuminate\Database\QueryException] SQLSTATE[42000]: Syntax error or access violation: 1061 Duplicate key name 'search' (SQL: ALTER TABLE pages ADD FULLTEXT search(name, text)) [PDOException] SQLSTATE[42000]: Syntax error or access violation: 1061 Duplicate key name 'search' ``` I checked the output in my browser at localhost:80, and there were two errors: ``` SQLSTATE[42S22]: Column not found: 1054 Unknown column 'system_name' in 'where clause' (SQL: select * from `users` where `system_name` = public limit 1) C:\Users\path-to-repo\vendor\laravel\framework\src\Illuminate\Database\Connection.php#647 Illuminate\Database\QueryException SQLSTATE[42S22]: Column not found: 1054 Unknown column 'system_name' in 'where clause' C:\Users\path-to-repo\vendor\laravel\framework\src\Illuminate\Database\Connection.php#319 ``` I found the file (BookStack/database/migrations/2015_08_31_175240_add_search_indexes.php) where the line `SQL: ALTER TABLE pages ADD FULLTEXT search(name, text)` was, which was mentioned in the error message, and it seems that these were the troublesome lines: ``` public function up() { DB::statement('ALTER TABLE pages ADD FULLTEXT search(name, text)'); DB::statement('ALTER TABLE books ADD FULLTEXT search(name, description)'); DB::statement('ALTER TABLE chapters ADD FULLTEXT search(name, description)'); } ```
OVERLORD added the 🐕 Support label 2026-02-04 18:19:27 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Mar 6, 2017):

Hi @m3579, Did you receive any errors when originally running php artisan migrate? It almost seems like the migration ran partially once and then tried to re-run causing a duplication issue. Was this a fresh install or an instance move?

@ssddanbrown commented on GitHub (Mar 6, 2017): Hi @m3579, Did you receive any errors when originally running `php artisan migrate`? It almost seems like the migration ran partially once and then tried to re-run causing a duplication issue. Was this a fresh install or an instance move?
Author
Owner

@m3579 commented on GitHub (Mar 7, 2017):

I had tried to install it using the Docker image, but there were some issues that I had with that so I deleted the directory and tried installing it again using the installation instructions for cloning the repo. That time and the second time that I tried that, it gave the duplication error. The duplication issue did not come up the first time with Docker.

@m3579 commented on GitHub (Mar 7, 2017): I had tried to install it using the Docker image, but there were some issues that I had with that so I deleted the directory and tried installing it again using the installation instructions for cloning the repo. That time and the second time that I tried that, it gave the duplication error. The duplication issue did not come up the first time with Docker.
Author
Owner

@ssddanbrown commented on GitHub (May 12, 2018):

Thank you for opening this issue. As part of an issue clean-up we're closing off older support issues that may be outdated or irrelevant so therefore I am closing this issue.

If the issue remains and it is one you are still seeking to actively solve please ensure it is still not apparent on the latest version of BookStack then open up a new issue referencing this one.

Sorry if we were not able to solve your original request.

@ssddanbrown commented on GitHub (May 12, 2018): Thank you for opening this issue. As part of an issue clean-up we're closing off older support issues that may be outdated or irrelevant so therefore I am closing this issue. If the issue remains and it is one you are still seeking to actively solve please ensure it is still not apparent on the latest version of BookStack then open up a new issue referencing this one. Sorry if we were not able to solve your original request.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#291