mirror of
https://github.com/BookStackApp/BookStack.git
synced 2026-02-08 03:09:39 +03:00
Error when trying to reorder pages/chapters of a book #5273
Closed
opened 2026-02-05 09:53:04 +03:00 by OVERLORD
·
20 comments
No Branch/Tag Specified
development
further_theme_development
l10n_development
release
llm_only
vectors
v25-11
docker_env
drawio_rendering
user_permissions
ldap_host_failover
svg_image
prosemirror
captcha_example
fix/video-export
v25.12.3
v25.12.2
v25.12.1
v25.12
v25.11.6
v25.11.5
v25.11.4
v24.11.4
v25.11.3
v25.11.2
v25.11.1
v25.11
v25.07.3
v25.07.2
v25.07.1
v25.07
v25.05.2
v25.05.1
v25.05
v25.02.5
v25.02.4
v25.02.3
v25.02.2
v25.02.1
v25.02
v24.12.1
v24.12
v24.10.3
v24.10.2
v24.10.1
v24.10
v24.05.4
v24.05.3
v24.05.2
v24.05.1
v24.05
v24.02.3
v24.02.2
v24.02.1
v24.02
v23.12.3
v23.12.2
v23.12.1
v23.12
v23.10.4
v23.10.3
v23.10.2
v23.10.1
v23.10
v23.08.3
v23.08.2
v23.08.1
v23.08
v23.06.2
v23.06.1
v23.06
v23.05.2
v23.05.1
v23.05
v23.02.3
v23.02.2
v23.02.1
v23.02
v23.01.1
v23.01
v22.11.1
v22.11
v22.10.2
v22.10.1
v22.10
v22.09.1
v22.09
v22.07.3
v22.07.2
v22.07.1
v22.07
v22.06.2
v22.06.1
v22.06
v22.04.2
v22.04.1
v22.04
v22.03.1
v22.03
v22.02.3
v22.02.2
v22.02.1
v22.02
v21.12.5
v21.12.4
v21.12.3
v21.12.2
v21.12.1
v21.12
v21.11.3
v21.11.2
v21.11.1
v21.11
v21.10.3
v21.10.2
v21.10.1
v21.10
v21.08.6
v21.08.5
v21.08.4
v21.08.3
v21.08.2
v21.08.1
v21.08
v21.05.4
v21.05.3
v21.05.2
v21.05.1
v21.05
v21.04.6
v21.04.5
v21.04.4
v21.04.3
v21.04.2
v21.04.1
v21.04
v0.31.8
v0.31.7
v0.31.6
v0.31.5
v0.31.4
v0.31.3
v0.31.2
v0.31.1
v0.31.0
v0.30.7
v0.30.6
v0.30.5
v0.30.4
v0.30.3
v0.30.2
v0.30.1
v0.30.0
v0.29.3
v0.29.2
v0.29.1
v0.29.0
v0.28.3
v0.28.2
v0.28.1
v0.28.0
v0.27.5
v0.27.4
v0.27.3
v0.27.2
v0.27.1
v0.27
v0.26.4
v0.26.3
v0.26.2
v0.26.1
v0.26.0
v0.25.5
v0.25.4
v0.25.3
v0.25.2
v0.25.1
v0.25.0
v0.24.3
v0.24.2
v0.24.1
v0.24.0
v0.23.2
v0.23.1
v0.23.0
v0.22.0
v0.21.0
v0.20.3
v0.20.2
v0.20.1
v0.20.0
v0.19.0
v0.18.5
v0.18.4
v0.18.3
v0.18.2
v0.18.1
v0.18.0
v0.17.4
v0.17.3
v0.17.2
v0.17.1
v0.17.0
v0.16.3
v0.16.2
v0.16.1
v0.16.0
v0.15.3
v0.15.2
v0.15.1
v0.15.0
v0.14.3
v0.14.2
v0.14.1
v0.14.0
v0.13.1
v0.13.0
v0.12.2
v0.12.1
v0.12.0
v0.11.2
v0.11.1
v0.11.0
v0.10.0
v0.9.3
v0.9.2
v0.9.1
v0.9.0
v0.8.2
v0.8.1
v0.8.0
v0.7.6
v0.7.5
v0.7.4
v0.7.3
0.7.2
v.0.7.1
v0.7.0
v0.6.3
v0.6.2
v0.6.1
v0.6.0
v0.5.0
Labels
Clear labels
🎨 Design
📖 Docs Update
🐛 Bug
🐛 Bug
:cat2:🐈 Possible duplicate
💿 Database
☕ Open to discussion
💻 Front-End
🐕 Support
🚪 Authentication
🌍 Translations
🔌 API Task
🏭 Back-End
⛲ Upstream
🔨 Feature Request
🛠️ Enhancement
🛠️ Enhancement
🛠️ Enhancement
❤️ Happy feedback
🔒 Security
🔍 Pending Validation
💆 UX
📝 WYSIWYG Editor
🌔 Out of scope
🔩 API Request
:octocat: Admin/Meta
🖌️ View Customization
❓ Question
🚀 Priority
🛡️ Blocked
🚚 Export System
♿ A11y
🔧 Maintenance
> Markdown Editor
pull-request
Mirrored from GitHub Pull Request
No Label
🐕 Support
Milestone
No items
No Milestone
Projects
Clear projects
No project
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: starred/BookStack#5273
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @lucasplcorrea on GitHub (Apr 30, 2025).
Describe the Bug
Ao clicar em ordenar, uma mensagem de erro é exibida
Steps to Reproduce
Expected Behaviour
Reordering book pages
Screenshots or Additional Context
When analyzing the logs in /app/www/storage/logs, searching for "sort", I received the following record:
My environment runs on docker, BookStack version: v25.02.1
DB: Maria DB 11.4.5
Browser Details
No response
Exact BookStack Version
v25.02.1
@ssddanbrown commented on GitHub (Apr 30, 2025):
Hi @lucasplcorrea,
This error indicates that the database migrations were not run, or failed during run, when perform the upgrade to BookStack v25.02. Is this the default/standard (without modification) linuxserver docker image? If so, restart the bookstack container and it should show the migration status via the container logs during startup. Check those logs, and feel free to share them back here for further assistance if needed.
@lucasplcorrea commented on GitHub (Apr 30, 2025):
Yes, is a default linuxserver image, the startup log:
@ssddanbrown commented on GitHub (Apr 30, 2025):
Okay, so there's a clear issue.
@lucasplcorrea commented on GitHub (Apr 30, 2025):
I haven't done any migration recently, but some time ago, I moved the system behind a domain, changing the URL; it was local and I published it on the internet.
That was the last major change I made to the system. On the other hand, I don't remember having reordered any pages since then.
In the system logs, I see records of book_sort already done after this migration, so I don't believe that's specifically the problem.
In addition, when I try to access the path you suggested: "Sort Rules" (Settings > Sort Rules), the same error occurs.
I searched the system logs for sort_rule_create/update/dele, but I didn't find any records of rules in that sense (I imagined that another user could have created something, but I didn't find anything).
@ssddanbrown commented on GitHub (Apr 30, 2025):
Okay, thanks for the extra info.
Not sure what's occurred here. Either way, we'll need to align the database state so the database migrations can continue.
@lucasplcorrea commented on GitHub (Apr 30, 2025):
1 - Yes, I use Watchtower, which automatically updates my containers
2 - Yes, I am. I use Dbeaver to connect to Bookstack's MariaDB when I need to. I've even done backup and restore tests directly from the Bookstack database a few times
3 - Yes, I am. They're the same ones used in Linux. To make things easier, I use 1Panel, which allows me to run commands inside the container.
@ssddanbrown commented on GitHub (May 1, 2025):
Alrighty, thanks for the answers.
In regards to watchtower, I often hear of these kinds of errors occur in watch-tower based environments. Based on a quick previous look, i assume some kind of timeout can occur during the upgrade leaving things in a bad state.
I'd advise using it for notification of updates only (if possible), and make the updates manually.
Before anything else, backup your data. Especially the database.
Now, can you enter the database and drop the
sort_rulestable?Once done, restart the BookStack container, watching the first start-up logs for any errors or, hopefully if things work, non-error migration notices. Report back any errors, otherwise you should see the
sort_rulestable get re-created, and you should no longer have errors.@lucasplcorrea commented on GitHub (May 2, 2025):
I apologize for the delay in responding, yesterday was a holiday in my city and I couldn't work on it.
I did what you asked, dropped the table, restarted the container, and adjusted the watchtower only for notifications. During the restart, I even saw that it executes the table creation migrations in question, but in Dbeaver they are not displayed, and the error persists when accessing the page reordering section.
I will send you some prints and logs for analysis.
if there is any way to perform this migration manually, maybe I could try it
before performing the action, I made a backup as suggested.
@lucasplcorrea commented on GitHub (May 5, 2025):
Any news regarding this case?
@ssddanbrown commented on GitHub (May 8, 2025):
@lucasplcorrea no, not really.
It's odd that the migrations are running, but you are not seeing changes.
Do these migrations lines (which you highlighted with a red border in your screenshot) re-appear when restarting the container? Or does something else show?
What exactly is this error? What are you seeing? What are the logged messages?
Just wondering if it's actually the same error or something else at play.
@lucasplcorrea commented on GitHub (May 8, 2025):
No, it only appeared once!
A new version of bookstack was recently released, is it safe to update? If I update, will these migrations run again?
In the logs I find the following error filtering by | grep sort
@ssddanbrown commented on GitHub (May 9, 2025):
Okay, that's what I'd expect from a working setup. Means the database state is stable.
They shouldn't do, since they've already ran (and there's no further migrations in the recent patch releases).
This is so strange. I can't see how the table does not exist, since you saw the migrations run in the log, which would have had to create this table.
The most likely thing to me would be that there's maybe multiple instances getting mixed up here? Unlikely but it's something I've seen before when supporting people.
Otherwise, you could access a shell in the active BookStack container, then enter the
/app/wwwfolder in the container, and run:php artisan migrate:status | tail -n 5, just to help confirm which migrations have been run.It's important that this is ran in the running container to be sure it's the instance seen via the browser.
You can maybe test this by running
php artisan downvia the same way. Access via the browser should then show a maintenance message. You could restore the instance viaphp artisan up.@lucasplcorrea commented on GitHub (May 9, 2025):
When I hit
php artisan migrate:status | tail -n 5When I hit
php artisan downAnd up
@ssddanbrown commented on GitHub (May 9, 2025):
That all looks as expected.
What about this from the BookStack container (ran like before)?
This should tell us if the table exists from the PHP code perspective.
@lucasplcorrea commented on GitHub (May 9, 2025):
@ssddanbrown commented on GitHub (May 10, 2025):
Okay, that's super odd.
Maybe we just have to accept the table wasn't created here and create it manually.
Before that though, can you check your
bookstable in the database and confirm if there's asort_rule_idcolumn (might be at the very end of the column list). Need to know if that column creation has also gone wrong.@lucasplcorrea commented on GitHub (May 12, 2025):
Yes, it is a very strange thing to happen, especially since there are logs indicating that the migrations have been completed. If you can help me create it manually, I would be grateful.
there is also no sort_rule_id table that you mentioned.
@ssddanbrown commented on GitHub (May 13, 2025):
@lucasplcorrea Okay, lets try allowing the migrations to re-run.
Before anything, I'd strongly advise a full backup of the instance data, especially the database data.
In the database, look at the
migrationstables.Delete the latest two rows (with the highest IDs). The
batchcolumn value for these should both be4.These should be the
2025_01_29_180933_create_sort_rules_tableand2025_02_05_150842_add_sort_rule_id_to_booksnamed migrations.With that done, restart the BookStack container, watching first start-up logs again.
You should see these migrations run again, and this time hopefully you'll see the relevant database changes, with the
sort_rulestable appearing.@lucasplcorrea commented on GitHub (May 16, 2025):
Works like a charm. I deleted the rows as suggested, and on reboot the tables were recreated, I can order the pages again.
Thanks for the support. Now I will run the container update.
@ssddanbrown commented on GitHub (May 17, 2025):
Great news, Good to hear that finally worked! Not sure why it didn't before, very strange!