Duplicate column name 'uploaded_to' #4910

Closed
opened 2026-02-05 09:25:31 +03:00 by OVERLORD · 1 comment
Owner

Originally created by @ruanformigoni on GitHub (Aug 13, 2024).

Describe the Bug

Today when I started the application I got this bug:

bookstack     | 
bookstack     |    INFO  Running migrations.  
bookstack     | 
bookstack     |   2016_02_28_084200_add_entity_access_controls .................... 137ms FAIL
bookstack     | 
bookstack     |    Illuminate\Database\QueryException 
bookstack     | 
bookstack     |   SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'uploaded_to' (Connection: mysql, SQL: alter table `images` add `uploaded_to` int not null default '0')
bookstack     | 
bookstack     |   at /app/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php:829
bookstack     |     825▕                     $this->getName(), $query, $this->prepareBindings($bindings), $e
bookstack     |     826▕                 );
bookstack     |     827▕             }
bookstack     |     828▕ 
bookstack     |   ➜ 829▕             throw new QueryException(
bookstack     |     830▕                 $this->getName(), $query, $this->prepareBindings($bindings), $e
bookstack     |     831▕             );
bookstack     |     832▕         }
bookstack     |     833▕     }
bookstack     | 
bookstack     |       +9 vendor frames 
bookstack     | 
bookstack     |   10  /app/www/database/migrations/2016_02_28_084200_add_entity_access_controls.php:14
bookstack     |       Illuminate\Support\Facades\Facade::__callStatic()
bookstack     |       +24 vendor frames 
bookstack     | 
bookstack     |   35  /app/www/artisan:35
bookstack     |       Illuminate\Foundation\Console\Kernel::handle()
bookstack     | 
bookstack     | [custom-init] No custom files found, skipping...
bookstack     | [ls.io-init] done.

I tried backed up the database and tried this, but it resets everything and I lose my books. Any tips on how to recover them?

Steps to Reproduce

I am running the provided docker-compose.yml from linuxserver.io

Expected Behaviour

The web interface to open, it gives out this error instead:
error

Screenshots or Additional Context

No response

Browser Details

No response

Exact BookStack Version

lscr.io/linuxserver/bookstack

Originally created by @ruanformigoni on GitHub (Aug 13, 2024). ### Describe the Bug Today when I started the application I got this bug: ``` bookstack | bookstack | INFO Running migrations. bookstack | bookstack | 2016_02_28_084200_add_entity_access_controls .................... 137ms FAIL bookstack | bookstack | Illuminate\Database\QueryException bookstack | bookstack | SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'uploaded_to' (Connection: mysql, SQL: alter table `images` add `uploaded_to` int not null default '0') bookstack | bookstack | at /app/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php:829 bookstack | 825▕ $this->getName(), $query, $this->prepareBindings($bindings), $e bookstack | 826▕ ); bookstack | 827▕ } bookstack | 828▕ bookstack | ➜ 829▕ throw new QueryException( bookstack | 830▕ $this->getName(), $query, $this->prepareBindings($bindings), $e bookstack | 831▕ ); bookstack | 832▕ } bookstack | 833▕ } bookstack | bookstack | +9 vendor frames bookstack | bookstack | 10 /app/www/database/migrations/2016_02_28_084200_add_entity_access_controls.php:14 bookstack | Illuminate\Support\Facades\Facade::__callStatic() bookstack | +24 vendor frames bookstack | bookstack | 35 /app/www/artisan:35 bookstack | Illuminate\Foundation\Console\Kernel::handle() bookstack | bookstack | [custom-init] No custom files found, skipping... bookstack | [ls.io-init] done. ``` I tried backed up the database and tried [this](https://github.com/BookStackApp/BookStack/issues/2710), but it resets everything and I lose my books. Any tips on how to recover them? ### Steps to Reproduce I am running the provided `docker-compose.yml` from linuxserver.io ### Expected Behaviour The web interface to open, it gives out this error instead: ![error](https://github.com/user-attachments/assets/5180bed5-03b9-4ee5-97ab-567610e8d440) ### Screenshots or Additional Context _No response_ ### Browser Details _No response_ ### Exact BookStack Version lscr.io/linuxserver/bookstack
OVERLORD added the 🐛 Bug label 2026-02-05 09:25:31 +03:00
Author
Owner

@ruanformigoni commented on GitHub (Aug 13, 2024):

Dug around for a bit in my copy of the mariadb database backup, somehow the data is gone, SELECT * FROM users only retuns the default admin user. Weird thing is that I have been running this app for a couple of weeks and did not tinker with it since. Is there an automatic method to export markdown backups for the books to a specified directory?

@ruanformigoni commented on GitHub (Aug 13, 2024): Dug around for a bit in my copy of the mariadb database backup, somehow the data is gone, `SELECT * FROM users` only retuns the default admin user. Weird thing is that I have been running this app for a couple of weeks and did not tinker with it since. Is there an automatic method to export markdown backups for the books to a specified directory?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#4910