Sorting a Book breaks bookstack #1252

Closed
opened 2026-02-05 00:24:44 +03:00 by OVERLORD · 5 comments
Owner

Originally created by @aiveras on GitHub (Jul 5, 2019).

Every time you move a page in a book, the book disappears and you get an error message with "Book not found".
We used version 0.26.2
Every time we want to move a page in an already existing book in the order and press save the book disappears. However, the pages can still be found. Also the URL still shows the book name. But as soon as you only want to display the book the error message will be displayed.

How do I get the book back?

Originally created by @aiveras on GitHub (Jul 5, 2019). Every time you move a page in a book, the book disappears and you get an error message with "Book not found". We used version 0.26.2 Every time we want to move a page in an already existing book in the order and press save the book disappears. However, the pages can still be found. Also the URL still shows the book name. But as soon as you only want to display the book the error message will be displayed. How do I get the book back?
Author
Owner

@ssddanbrown commented on GitHub (Jul 5, 2019):

Hi @aiveras,
Sorry to hear you are having some troubles. This is not something I've been able to re-produce.

Does this occur when using an admin account?
Do you have any details on how you are hosting BookStack or how BookStack was installed?

@ssddanbrown commented on GitHub (Jul 5, 2019): Hi @aiveras, Sorry to hear you are having some troubles. This is not something I've been able to re-produce. Does this occur when using an admin account? Do you have any details on how you are hosting BookStack or how BookStack was installed?
Author
Owner

@aiveras commented on GitHub (Jul 6, 2019):

Hi @ssddanbrown ,

we hosted bookstack as docker-compose. So far the error happened twice in both cases an admin account was used. Whether it also happens without admin account I don't know but could test it out.
Is there a way to display logs in bookstack?

@aiveras commented on GitHub (Jul 6, 2019): Hi @ssddanbrown , we hosted bookstack as docker-compose. So far the error happened twice in both cases an admin account was used. Whether it also happens without admin account I don't know but could test it out. Is there a way to display logs in bookstack?
Author
Owner

@ssddanbrown commented on GitHub (Jul 6, 2019):

@aiveras Details on debugging can be found here. Can you provide any details on the docker-compose setup? Such as the containers you are using?

@ssddanbrown commented on GitHub (Jul 6, 2019): @aiveras Details on debugging [can be found here](https://www.bookstackapp.com/docs/admin/debugging/). Can you provide any details on the docker-compose setup? Such as the containers you are using?
Author
Owner

@aiveras commented on GitHub (Jul 6, 2019):

@ssddanbrown thank you very much for the link. I enabled now debugging. Below you see the used docker-compose.yml

version: '2'

services:

  db:
    container_name: bookstack-mariadb
    image: mariadb:10.4.4
    restart: unless-stopped
    environment:
      MYSQL_ROOT_PASSWORD: 'secret'
      MYSQL_DATABASE: bookstack-db
      MYSQL_USER: bookstack
      MYSQL_PASSWORD: 'secret'
    volumes:
      - /opt/docker/bookstack/mysql:/var/lib/mysql

  redis:
    container_name: bookstack-redis
    image: redis:5.0.4
    restart: unless-stopped


  app:
    container_name: bookstack
    build: .
    depends_on:
      - db
    restart: unless-stopped
    environment:

      - APP_DEBUG=true

      - APP_URL=https://domain.tld

      - STORAGE_TYPE=local_secure

      - MAIL_DRIVER=smtp
      - MAIL_HOST=mail.domain.tld
      - MAIL_PORT=465
      - MAIL_USERNAME=email@domain.tld
      - MAIL_PASSWORD='secret'
      - MAIL_ENCRYPTION=ssl
      - MAIL_FROM=email@domain.tld

      - DB_HOST=db
      - DB_DATABASE=bookstack-db
      - DB_USERNAME=bookstack
      - DB_PASSWORD=secret

      - AUTH_METHOD=ldap
      - LDAP_SERVER=ldap.domain.tld:1389
      - LDAP_BASE_DN=ou=people,dc=ldap,dc=domain,dc=tld
      - LDAP_DN=uid=client,ou=admins,dc=ldap,dc=domain,dc=tld
      - LDAP_PASS=secret
      - LDAP_USER_FILTER="(&(|(uid=$${user})(mail=$${user}))(isMemberOf=cn=[Access] BookStack,ou=groups,dc=ldap,dc=domain,dc=tld))"
      - LDAP_EMAIL_ATTRIBUTE=mail
      - LDAP_USER_TO_GROUPS=true
      - LDAP_GROUP_ATTRIBUTE=isMemberOf
      - LDAP_REMOVE_FROM_GROUPS=true

      - VIRTUAL_HOST=domain.tld
      - LETSENCRYPT_HOST=domain.tld
      - LETSENCRYPT_EMAIL=email@domain.tld

      - CACHE_DRIVER=redis
      - SESSION_DRIVER=redis
      - REDIS_SERVERS=bookstack-redis:6379:0

    volumes:
      - /opt/docker/bookstack/bookstack/public-uploads:/var/www/bookstack/public/uploads
      - /opt/docker/bookstack/bookstack/storage-uploads:/var/www/bookstack/storage/uploads
    networks:
      - default
      - proxy-tier

networks:

  proxy-tier:
    external:
      name: nginx-proxy

Here the Dockerfile:

FROM php:7.1-apache-stretch

ENV BOOKSTACK=BookStack \
    BOOKSTACK_VERSION=0.26.2 \
    BOOKSTACK_HOME="/var/www/bookstack"

RUN apt-get update && apt-get install -y git zlib1g-dev libfreetype6-dev libjpeg62-turbo-dev libmcrypt-dev libpng-dev wget libldap2-dev libtidy-dev \
   && docker-php-ext-install pdo pdo_mysql mbstring zip tidy \
   && docker-php-ext-configure ldap \
   && docker-php-ext-install ldap \
   && docker-php-ext-configure gd --with-freetype-dir=usr/include/ --with-jpeg-dir=/usr/include/ \
   && docker-php-ext-install gd \
   && cd /var/www && curl -sS https://getcomposer.org/installer | php \
   && mv /var/www/composer.phar /usr/local/bin/composer \
   && wget https://github.com/BookStackApp/BookStack/archive/v${BOOKSTACK_VERSION}.tar.gz -O ${BOOKSTACK}.tar.gz \
   && tar -xf ${BOOKSTACK}.tar.gz && mv BookStack-${BOOKSTACK_VERSION} ${BOOKSTACK_HOME} && rm ${BOOKSTACK}.tar.gz  \
   && cd $BOOKSTACK_HOME && composer install \
   && chown -R www-data:www-data $BOOKSTACK_HOME \
   && apt-get -y autoremove \
   && apt-get clean \
   && rm -rf /var/lib/apt/lists/* /var/tmp/* /etc/apache2/sites-enabled/000-*.conf

COPY php.ini /usr/local/etc/php/php.ini
COPY bookstack.conf /etc/apache2/sites-enabled/bookstack.conf
RUN a2enmod rewrite

COPY docker-entrypoint.sh /
RUN chmod +x /docker-entrypoint.sh

WORKDIR $BOOKSTACK_HOME

EXPOSE 80

VOLUME ["$BOOKSTACK_HOME/public/uploads","$BOOKSTACK_HOME/public/storage"]

ENTRYPOINT ["/docker-entrypoint.sh"]

ARG BUILD_DATE
ARG VCS_REF
LABEL org.label-schema.build-date=$BUILD_DATE \
      org.label-schema.docker.dockerfile="/Dockerfile" \
      org.label-schema.license="MIT" \
      org.label-schema.name="bookstack" \
      org.label-schema.vendor="solidnerd" \
      org.label-schema.url="https://github.com/solidnerd/docker-bookstack/" \
      org.label-schema.vcs-ref=$VCS_REF \
      org.label-schema.vcs-url="https://github.com/solidnerd/docker-bookstack.git" \
      org.label-schema.vcs-type="Git"

I was able to narrow the error down further. It doesn't matter if an admin account moves pages or a normal user. The error always occurs when there are enough pages and chapters so that you have to scroll when sorting. With small books with for example 4-10 pages and 1-2 chapters it does not happen. As a test I created a longer book with 6 chapters and 2-3 pages each. Here is the log file of the Docker-compose:

bookstack | bookstack.dev:80 172.18.0.5 - - [06/Jul/2019:13:42:21 +0000] "GET /books/test/sort HTTP/1.1" 200 23744 "https://domain.tld/books/test/sort" "Mozilla/5.0 (X11; Linux x86_64; rv:67.0) Gecko/20100101 Firefox/67.0"
bookstack | bookstack.dev:80 172.18.0.5 - - [06/Jul/2019:13:42:21 +0000] "GET /translations HTTP/1.1" 200 6524 "https://domain.tld/translations" "Mozilla/5.0 (X11; Linux x86_64; rv:67.0) Gecko/20100101 Firefox/67.0"
bookstack | bookstack.dev:80 172.18.0.5 - - [06/Jul/2019:13:42:22 +0000] "GET /ajax/search/entities?types=book&permission=update HTTP/1.1" 200 2526 "https://domain.tld/ajax/search/entities?types=book&permission=update" "Mozilla/5.0 (X11; Linux x86_64; rv:67.0) Gecko/20100101 Firefox/67.0"
bookstack | bookstack.dev:80 172.18.0.5 - - [06/Jul/2019:13:42:32 +0000] "POST /books/test/sort HTTP/1.1" 302 1319 "https://domain.tld/books/test/sort" "Mozilla/5.0 (X11; Linux x86_64; rv:67.0) Gecko/20100101 Firefox/67.0"
bookstack | [Sat Jul 06 13:42:34.106067 2019] [php7:notice] [pid 123] [client 172.18.0.5:57392] [2019-07-06 13:42:34] production.ERROR: Book not found {"userId":4,"email":"forename.surename@domain.tld","exception":"[object] (BookStack\\\\Exceptions\\\\NotFoundException(code: 404): Book not found at /var/www/bookstack/app/Entities/Repos/EntityRepo.php:162)"} [], referer: https://domain.tld/books/test
bookstack | bookstack.dev:80 172.18.0.5 - - [06/Jul/2019:13:42:33 +0000] "GET /books/test HTTP/1.1" 500 1227180 "https://domain.tld/books/test" "Mozilla/5.0 (X11; Linux x86_64; rv:67.0) Gecko/20100101 Firefox/67.0"
bookstack-mariadb | 2019-07-06 13:39:36 0 [Warning] InnoDB: Table mysql/innodb_index_stats has length mismatch in the column name table_name.  Please run mysql_upgrade
bookstack-mariadb | 2019-07-06 13:39:36 0 [Warning] InnoDB: Table mysql/innodb_table_stats has length mismatch in the column name table_name.  Please run mysql_upgrade
bookstack-mariadb | 2019-07-06 13:39:37 189 [ERROR] Transaction not registered for MariaDB 2PC, but transaction is active

I have tried to update the DB, but I still get error messages:

root@41e6c8ab3346:/# mysql_upgrade -p             
Enter password: 
MariaDB upgrade detected
Phase 1/7: Checking and upgrading mysql database
Processing databases
mysql
mysql.column_stats                                 OK
mysql.columns_priv                                 OK
mysql.db                                           OK
mysql.engine_cost                                  OK
mysql.event                                        OK
mysql.func                                         OK
mysql.global_priv                                  OK
mysql.gtid_executed                                OK
mysql.gtid_slave_pos                               OK
mysql.help_category                                OK
mysql.help_keyword                                 OK
mysql.help_relation                                OK
mysql.help_topic                                   OK
mysql.index_stats                                  OK
mysql.innodb_index_stats                           OK
mysql.innodb_table_stats                           OK
mysql.plugin                                       OK
mysql.proc                                         OK
mysql.procs_priv                                   OK
mysql.proxies_priv                                 OK
mysql.roles_mapping                                OK
mysql.server_cost                                  OK
mysql.servers                                      OK
mysql.slave_master_info                            OK
mysql.slave_relay_log_info                         OK
mysql.slave_worker_info                            OK
mysql.table_stats                                  OK
mysql.tables_priv                                  OK
mysql.time_zone                                    OK
mysql.time_zone_leap_second                        OK
mysql.time_zone_name                               OK
mysql.time_zone_transition                         OK
mysql.time_zone_transition_type                    OK
mysql.transaction_registry                         OK
Phase 2/7: Installing used storage engines... Skipped
Phase 3/7: Fixing views from mysql
mysql.user                                         OK
sys.host_summary
Error    : Table 'performance_schema.memory_summary_by_host_by_event_name' doesn't exist
Error    : View 'sys.host_summary' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
error    : Corrupt
sys.host_summary_by_file_io
Error    : Cannot load from mysql.proc. The table is probably corrupted
error    : Corrupt
sys.host_summary_by_file_io_type
Error    : Cannot load from mysql.proc. The table is probably corrupted
error    : Corrupt
sys.host_summary_by_stages
Error    : Cannot load from mysql.proc. The table is probably corrupted
error    : Corrupt
sys.host_summary_by_statement_latency
Error    : Cannot load from mysql.proc. The table is probably corrupted
error    : Corrupt
sys.host_summary_by_statement_type
Error    : Cannot load from mysql.proc. The table is probably corrupted
error    : Corrupt
sys.innodb_buffer_stats_by_schema
Error    : Cannot load from mysql.proc. The table is probably corrupted
error    : Corrupt
sys.innodb_buffer_stats_by_table
Error    : Cannot load from mysql.proc. The table is probably corrupted
error    : Corrupt
sys.innodb_lock_waits
Error    : Cannot load from mysql.proc. The table is probably corrupted
error    : Corrupt
sys.io_by_thread_by_latency
Error    : Cannot load from mysql.proc. The table is probably corrupted
error    : Corrupt
sys.io_global_by_file_by_bytes
Error    : Cannot load from mysql.proc. The table is probably corrupted
error    : Corrupt
sys.io_global_by_file_by_latency
Error    : Cannot load from mysql.proc. The table is probably corrupted
error    : Corrupt
sys.io_global_by_wait_by_bytes
Error    : Cannot load from mysql.proc. The table is probably corrupted
error    : Corrupt
sys.io_global_by_wait_by_latency
Error    : Cannot load from mysql.proc. The table is probably corrupted
error    : Corrupt
sys.latest_file_io
Error    : Cannot load from mysql.proc. The table is probably corrupted
error    : Corrupt
sys.memory_by_host_by_current_bytes
Error    : Table 'performance_schema.memory_summary_by_host_by_event_name' doesn't exist
Error    : View 'sys.memory_by_host_by_current_bytes' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
error    : Corrupt
sys.memory_by_thread_by_current_bytes
Error    : Table 'performance_schema.memory_summary_by_thread_by_event_name' doesn't exist
Error    : View 'sys.memory_by_thread_by_current_bytes' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
error    : Corrupt
sys.memory_by_user_by_current_bytes
Error    : Table 'performance_schema.memory_summary_by_user_by_event_name' doesn't exist
Error    : View 'sys.memory_by_user_by_current_bytes' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
error    : Corrupt
sys.memory_global_by_current_bytes
Error    : Table 'performance_schema.memory_summary_global_by_event_name' doesn't exist
Error    : View 'sys.memory_global_by_current_bytes' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
error    : Corrupt
sys.memory_global_total
Error    : Table 'performance_schema.memory_summary_global_by_event_name' doesn't exist
Error    : View 'sys.memory_global_total' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
error    : Corrupt
sys.metrics
Error    : Table 'performance_schema.global_status' doesn't exist
Error    : View 'sys.metrics' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
error    : Corrupt
sys.processlist
Error    : Table 'performance_schema.events_transactions_current' doesn't exist
Error    : View 'sys.processlist' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
error    : Corrupt
sys.ps_check_lost_instrumentation
Error    : Table 'performance_schema.global_status' doesn't exist
Error    : View 'sys.ps_check_lost_instrumentation' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
error    : Corrupt
sys.schema_auto_increment_columns                  OK
sys.schema_index_statistics
Error    : Cannot load from mysql.proc. The table is probably corrupted
error    : Corrupt
sys.schema_object_overview                         OK
sys.schema_redundant_indexes                       OK
sys.schema_table_lock_waits
Error    : Table 'performance_schema.metadata_locks' doesn't exist
Error    : View 'sys.schema_table_lock_waits' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
error    : Corrupt
sys.schema_table_statistics
Error    : Cannot load from mysql.proc. The table is probably corrupted
error    : Corrupt
sys.schema_table_statistics_with_buffer
Error    : Cannot load from mysql.proc. The table is probably corrupted
error    : Corrupt
sys.schema_tables_with_full_table_scans
Error    : Cannot load from mysql.proc. The table is probably corrupted
error    : Corrupt
sys.schema_unused_indexes                          OK
sys.session
Error    : Table 'performance_schema.events_transactions_current' doesn't exist
Error    : View 'sys.session' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
error    : Corrupt
sys.session_ssl_status
Error    : Table 'performance_schema.status_by_thread' doesn't exist
Error    : View 'sys.session_ssl_status' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
error    : Corrupt
sys.statement_analysis
Error    : Cannot load from mysql.proc. The table is probably corrupted
error    : Corrupt
sys.statements_with_errors_or_warnings
Error    : Cannot load from mysql.proc. The table is probably corrupted
error    : Corrupt
sys.statements_with_full_table_scans
Error    : Cannot load from mysql.proc. The table is probably corrupted
error    : Corrupt
sys.statements_with_runtimes_in_95th_percentile
Error    : Cannot load from mysql.proc. The table is probably corrupted
error    : Corrupt
sys.statements_with_sorting
Error    : Cannot load from mysql.proc. The table is probably corrupted
error    : Corrupt
sys.statements_with_temp_tables
Error    : Cannot load from mysql.proc. The table is probably corrupted
error    : Corrupt
sys.user_summary
Error    : Table 'performance_schema.memory_summary_by_user_by_event_name' doesn't exist
Error    : View 'sys.user_summary' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
error    : Corrupt
sys.user_summary_by_file_io
Error    : Cannot load from mysql.proc. The table is probably corrupted
error    : Corrupt
sys.user_summary_by_file_io_type
Error    : Cannot load from mysql.proc. The table is probably corrupted
error    : Corrupt
sys.user_summary_by_stages
Error    : Cannot load from mysql.proc. The table is probably corrupted
error    : Corrupt
sys.user_summary_by_statement_latency
Error    : Cannot load from mysql.proc. The table is probably corrupted
error    : Corrupt
sys.user_summary_by_statement_type
Error    : Cannot load from mysql.proc. The table is probably corrupted
error    : Corrupt
sys.version                                        OK
sys.wait_classes_global_by_avg_latency
Error    : Cannot load from mysql.proc. The table is probably corrupted
error    : Corrupt
sys.wait_classes_global_by_latency
Error    : Cannot load from mysql.proc. The table is probably corrupted
error    : Corrupt
sys.waits_by_host_by_latency
Error    : Cannot load from mysql.proc. The table is probably corrupted
error    : Corrupt
sys.waits_by_user_by_latency
Error    : Cannot load from mysql.proc. The table is probably corrupted
error    : Corrupt
sys.waits_global_by_latency
Error    : Cannot load from mysql.proc. The table is probably corrupted
error    : Corrupt
sys.x$host_summary
Error    : Table 'performance_schema.memory_summary_by_host_by_event_name' doesn't exist
Error    : View 'sys.x$host_summary' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
error    : Corrupt
sys.x$host_summary_by_file_io                      OK
sys.x$host_summary_by_file_io_type                 OK
sys.x$host_summary_by_stages                       OK
sys.x$host_summary_by_statement_latency            OK
sys.x$host_summary_by_statement_type               OK
sys.x$innodb_buffer_stats_by_schema                OK
sys.x$innodb_buffer_stats_by_table                 OK
sys.x$innodb_lock_waits                            OK
sys.x$io_by_thread_by_latency                      OK
sys.x$io_global_by_file_by_bytes                   OK
sys.x$io_global_by_file_by_latency                 OK
sys.x$io_global_by_wait_by_bytes                   OK
sys.x$io_global_by_wait_by_latency                 OK
sys.x$latest_file_io                               OK
sys.x$memory_by_host_by_current_bytes
Error    : Table 'performance_schema.memory_summary_by_host_by_event_name' doesn't exist
Error    : View 'sys.x$memory_by_host_by_current_bytes' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
error    : Corrupt
sys.x$memory_by_thread_by_current_bytes
Error    : Table 'performance_schema.memory_summary_by_thread_by_event_name' doesn't exist
Error    : View 'sys.x$memory_by_thread_by_current_bytes' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
error    : Corrupt
sys.x$memory_by_user_by_current_bytes
Error    : Table 'performance_schema.memory_summary_by_user_by_event_name' doesn't exist
Error    : View 'sys.x$memory_by_user_by_current_bytes' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
error    : Corrupt
sys.x$memory_global_by_current_bytes
Error    : Table 'performance_schema.memory_summary_global_by_event_name' doesn't exist
Error    : View 'sys.x$memory_global_by_current_bytes' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
error    : Corrupt
sys.x$memory_global_total
Error    : Table 'performance_schema.memory_summary_global_by_event_name' doesn't exist
Error    : View 'sys.x$memory_global_total' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
error    : Corrupt
sys.x$processlist
Error    : Table 'performance_schema.events_transactions_current' doesn't exist
Error    : View 'sys.x$processlist' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
error    : Corrupt
sys.x$ps_digest_95th_percentile_by_avg_us          OK
sys.x$ps_digest_avg_latency_distribution           OK
sys.x$ps_schema_table_statistics_io
Error    : Cannot load from mysql.proc. The table is probably corrupted
error    : Corrupt
sys.x$schema_flattened_keys                        OK
sys.x$schema_index_statistics                      OK
sys.x$schema_table_lock_waits
Error    : Table 'performance_schema.metadata_locks' doesn't exist
Error    : View 'sys.x$schema_table_lock_waits' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
error    : Corrupt
sys.x$schema_table_statistics
Error    : Cannot load from mysql.proc. The table is probably corrupted
error    : Corrupt
sys.x$schema_table_statistics_with_buffer
Error    : Cannot load from mysql.proc. The table is probably corrupted
error    : Corrupt
sys.x$schema_tables_with_full_table_scans          OK
sys.x$session
Error    : Table 'performance_schema.events_transactions_current' doesn't exist
Error    : View 'sys.x$session' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
error    : Corrupt
sys.x$statement_analysis                           OK
sys.x$statements_with_errors_or_warnings           OK
sys.x$statements_with_full_table_scans             OK
sys.x$statements_with_runtimes_in_95th_percentile  OK
sys.x$statements_with_sorting                      OK
sys.x$statements_with_temp_tables                  OK
sys.x$user_summary
Error    : Table 'performance_schema.memory_summary_by_user_by_event_name' doesn't exist
Error    : View 'sys.x$user_summary' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
error    : Corrupt
sys.x$user_summary_by_file_io                      OK
sys.x$user_summary_by_file_io_type                 OK
sys.x$user_summary_by_stages                       OK
sys.x$user_summary_by_statement_latency            OK
sys.x$user_summary_by_statement_type               OK
sys.x$wait_classes_global_by_avg_latency           OK
sys.x$wait_classes_global_by_latency               OK
sys.x$waits_by_host_by_latency                     OK
sys.x$waits_by_user_by_latency                     OK
sys.x$waits_global_by_latency                      OK
Phase 4/7: Running 'mysql_fix_privilege_tables'
Phase 5/7: Fixing table and database names
Phase 6/7: Checking and upgrading tables
Processing databases
bookstack-db
bookstack-db.activities                            OK
bookstack-db.attachments                           OK
bookstack-db.books                                 OK
bookstack-db.bookshelves                           OK
bookstack-db.bookshelves_books                     OK
bookstack-db.cache                                 OK
bookstack-db.chapters                              OK
bookstack-db.comments                              OK
bookstack-db.email_confirmations                   OK
bookstack-db.entity_permissions                    OK
bookstack-db.images                                OK
bookstack-db.joint_permissions                     OK
bookstack-db.migrations                            OK
bookstack-db.page_revisions                        OK
bookstack-db.pages                                 OK
bookstack-db.password_resets                       OK
bookstack-db.permission_role                       OK
bookstack-db.role_permissions                      OK
bookstack-db.role_user                             OK
bookstack-db.roles                                 OK
bookstack-db.search_terms                          OK
bookstack-db.sessions                              OK
bookstack-db.settings                              OK
bookstack-db.social_accounts                       OK
bookstack-db.tags                                  OK
bookstack-db.users                                 OK
bookstack-db.views                                 OK
information_schema
performance_schema
sys
sys.sys_config                                     OK
Phase 7/7: Running 'FLUSH PRIVILEGES'
OK
root@41e6c8ab3346:/# 

For security reasons I have changed all passwords and domains tlds as well as email addresses.

@aiveras commented on GitHub (Jul 6, 2019): @ssddanbrown thank you very much for the link. I enabled now debugging. Below you see the used docker-compose.yml ``` version: '2' services: db: container_name: bookstack-mariadb image: mariadb:10.4.4 restart: unless-stopped environment: MYSQL_ROOT_PASSWORD: 'secret' MYSQL_DATABASE: bookstack-db MYSQL_USER: bookstack MYSQL_PASSWORD: 'secret' volumes: - /opt/docker/bookstack/mysql:/var/lib/mysql redis: container_name: bookstack-redis image: redis:5.0.4 restart: unless-stopped app: container_name: bookstack build: . depends_on: - db restart: unless-stopped environment: - APP_DEBUG=true - APP_URL=https://domain.tld - STORAGE_TYPE=local_secure - MAIL_DRIVER=smtp - MAIL_HOST=mail.domain.tld - MAIL_PORT=465 - MAIL_USERNAME=email@domain.tld - MAIL_PASSWORD='secret' - MAIL_ENCRYPTION=ssl - MAIL_FROM=email@domain.tld - DB_HOST=db - DB_DATABASE=bookstack-db - DB_USERNAME=bookstack - DB_PASSWORD=secret - AUTH_METHOD=ldap - LDAP_SERVER=ldap.domain.tld:1389 - LDAP_BASE_DN=ou=people,dc=ldap,dc=domain,dc=tld - LDAP_DN=uid=client,ou=admins,dc=ldap,dc=domain,dc=tld - LDAP_PASS=secret - LDAP_USER_FILTER="(&(|(uid=$${user})(mail=$${user}))(isMemberOf=cn=[Access] BookStack,ou=groups,dc=ldap,dc=domain,dc=tld))" - LDAP_EMAIL_ATTRIBUTE=mail - LDAP_USER_TO_GROUPS=true - LDAP_GROUP_ATTRIBUTE=isMemberOf - LDAP_REMOVE_FROM_GROUPS=true - VIRTUAL_HOST=domain.tld - LETSENCRYPT_HOST=domain.tld - LETSENCRYPT_EMAIL=email@domain.tld - CACHE_DRIVER=redis - SESSION_DRIVER=redis - REDIS_SERVERS=bookstack-redis:6379:0 volumes: - /opt/docker/bookstack/bookstack/public-uploads:/var/www/bookstack/public/uploads - /opt/docker/bookstack/bookstack/storage-uploads:/var/www/bookstack/storage/uploads networks: - default - proxy-tier networks: proxy-tier: external: name: nginx-proxy ``` Here the Dockerfile: ``` FROM php:7.1-apache-stretch ENV BOOKSTACK=BookStack \ BOOKSTACK_VERSION=0.26.2 \ BOOKSTACK_HOME="/var/www/bookstack" RUN apt-get update && apt-get install -y git zlib1g-dev libfreetype6-dev libjpeg62-turbo-dev libmcrypt-dev libpng-dev wget libldap2-dev libtidy-dev \ && docker-php-ext-install pdo pdo_mysql mbstring zip tidy \ && docker-php-ext-configure ldap \ && docker-php-ext-install ldap \ && docker-php-ext-configure gd --with-freetype-dir=usr/include/ --with-jpeg-dir=/usr/include/ \ && docker-php-ext-install gd \ && cd /var/www && curl -sS https://getcomposer.org/installer | php \ && mv /var/www/composer.phar /usr/local/bin/composer \ && wget https://github.com/BookStackApp/BookStack/archive/v${BOOKSTACK_VERSION}.tar.gz -O ${BOOKSTACK}.tar.gz \ && tar -xf ${BOOKSTACK}.tar.gz && mv BookStack-${BOOKSTACK_VERSION} ${BOOKSTACK_HOME} && rm ${BOOKSTACK}.tar.gz \ && cd $BOOKSTACK_HOME && composer install \ && chown -R www-data:www-data $BOOKSTACK_HOME \ && apt-get -y autoremove \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* /var/tmp/* /etc/apache2/sites-enabled/000-*.conf COPY php.ini /usr/local/etc/php/php.ini COPY bookstack.conf /etc/apache2/sites-enabled/bookstack.conf RUN a2enmod rewrite COPY docker-entrypoint.sh / RUN chmod +x /docker-entrypoint.sh WORKDIR $BOOKSTACK_HOME EXPOSE 80 VOLUME ["$BOOKSTACK_HOME/public/uploads","$BOOKSTACK_HOME/public/storage"] ENTRYPOINT ["/docker-entrypoint.sh"] ARG BUILD_DATE ARG VCS_REF LABEL org.label-schema.build-date=$BUILD_DATE \ org.label-schema.docker.dockerfile="/Dockerfile" \ org.label-schema.license="MIT" \ org.label-schema.name="bookstack" \ org.label-schema.vendor="solidnerd" \ org.label-schema.url="https://github.com/solidnerd/docker-bookstack/" \ org.label-schema.vcs-ref=$VCS_REF \ org.label-schema.vcs-url="https://github.com/solidnerd/docker-bookstack.git" \ org.label-schema.vcs-type="Git" ``` I was able to narrow the error down further. It doesn't matter if an admin account moves pages or a normal user. The error always occurs when there are enough pages and chapters so that you have to scroll when sorting. With small books with for example 4-10 pages and 1-2 chapters it does not happen. As a test I created a longer book with 6 chapters and 2-3 pages each. Here is the log file of the Docker-compose: ``` bookstack | bookstack.dev:80 172.18.0.5 - - [06/Jul/2019:13:42:21 +0000] "GET /books/test/sort HTTP/1.1" 200 23744 "https://domain.tld/books/test/sort" "Mozilla/5.0 (X11; Linux x86_64; rv:67.0) Gecko/20100101 Firefox/67.0" bookstack | bookstack.dev:80 172.18.0.5 - - [06/Jul/2019:13:42:21 +0000] "GET /translations HTTP/1.1" 200 6524 "https://domain.tld/translations" "Mozilla/5.0 (X11; Linux x86_64; rv:67.0) Gecko/20100101 Firefox/67.0" bookstack | bookstack.dev:80 172.18.0.5 - - [06/Jul/2019:13:42:22 +0000] "GET /ajax/search/entities?types=book&permission=update HTTP/1.1" 200 2526 "https://domain.tld/ajax/search/entities?types=book&permission=update" "Mozilla/5.0 (X11; Linux x86_64; rv:67.0) Gecko/20100101 Firefox/67.0" bookstack | bookstack.dev:80 172.18.0.5 - - [06/Jul/2019:13:42:32 +0000] "POST /books/test/sort HTTP/1.1" 302 1319 "https://domain.tld/books/test/sort" "Mozilla/5.0 (X11; Linux x86_64; rv:67.0) Gecko/20100101 Firefox/67.0" bookstack | [Sat Jul 06 13:42:34.106067 2019] [php7:notice] [pid 123] [client 172.18.0.5:57392] [2019-07-06 13:42:34] production.ERROR: Book not found {"userId":4,"email":"forename.surename@domain.tld","exception":"[object] (BookStack\\\\Exceptions\\\\NotFoundException(code: 404): Book not found at /var/www/bookstack/app/Entities/Repos/EntityRepo.php:162)"} [], referer: https://domain.tld/books/test bookstack | bookstack.dev:80 172.18.0.5 - - [06/Jul/2019:13:42:33 +0000] "GET /books/test HTTP/1.1" 500 1227180 "https://domain.tld/books/test" "Mozilla/5.0 (X11; Linux x86_64; rv:67.0) Gecko/20100101 Firefox/67.0" bookstack-mariadb | 2019-07-06 13:39:36 0 [Warning] InnoDB: Table mysql/innodb_index_stats has length mismatch in the column name table_name. Please run mysql_upgrade bookstack-mariadb | 2019-07-06 13:39:36 0 [Warning] InnoDB: Table mysql/innodb_table_stats has length mismatch in the column name table_name. Please run mysql_upgrade bookstack-mariadb | 2019-07-06 13:39:37 189 [ERROR] Transaction not registered for MariaDB 2PC, but transaction is active ``` I have tried to update the DB, but I still get error messages: ``` root@41e6c8ab3346:/# mysql_upgrade -p Enter password: MariaDB upgrade detected Phase 1/7: Checking and upgrading mysql database Processing databases mysql mysql.column_stats OK mysql.columns_priv OK mysql.db OK mysql.engine_cost OK mysql.event OK mysql.func OK mysql.global_priv OK mysql.gtid_executed OK mysql.gtid_slave_pos OK mysql.help_category OK mysql.help_keyword OK mysql.help_relation OK mysql.help_topic OK mysql.index_stats OK mysql.innodb_index_stats OK mysql.innodb_table_stats OK mysql.plugin OK mysql.proc OK mysql.procs_priv OK mysql.proxies_priv OK mysql.roles_mapping OK mysql.server_cost OK mysql.servers OK mysql.slave_master_info OK mysql.slave_relay_log_info OK mysql.slave_worker_info OK mysql.table_stats OK mysql.tables_priv OK mysql.time_zone OK mysql.time_zone_leap_second OK mysql.time_zone_name OK mysql.time_zone_transition OK mysql.time_zone_transition_type OK mysql.transaction_registry OK Phase 2/7: Installing used storage engines... Skipped Phase 3/7: Fixing views from mysql mysql.user OK sys.host_summary Error : Table 'performance_schema.memory_summary_by_host_by_event_name' doesn't exist Error : View 'sys.host_summary' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them error : Corrupt sys.host_summary_by_file_io Error : Cannot load from mysql.proc. The table is probably corrupted error : Corrupt sys.host_summary_by_file_io_type Error : Cannot load from mysql.proc. The table is probably corrupted error : Corrupt sys.host_summary_by_stages Error : Cannot load from mysql.proc. The table is probably corrupted error : Corrupt sys.host_summary_by_statement_latency Error : Cannot load from mysql.proc. The table is probably corrupted error : Corrupt sys.host_summary_by_statement_type Error : Cannot load from mysql.proc. The table is probably corrupted error : Corrupt sys.innodb_buffer_stats_by_schema Error : Cannot load from mysql.proc. The table is probably corrupted error : Corrupt sys.innodb_buffer_stats_by_table Error : Cannot load from mysql.proc. The table is probably corrupted error : Corrupt sys.innodb_lock_waits Error : Cannot load from mysql.proc. The table is probably corrupted error : Corrupt sys.io_by_thread_by_latency Error : Cannot load from mysql.proc. The table is probably corrupted error : Corrupt sys.io_global_by_file_by_bytes Error : Cannot load from mysql.proc. The table is probably corrupted error : Corrupt sys.io_global_by_file_by_latency Error : Cannot load from mysql.proc. The table is probably corrupted error : Corrupt sys.io_global_by_wait_by_bytes Error : Cannot load from mysql.proc. The table is probably corrupted error : Corrupt sys.io_global_by_wait_by_latency Error : Cannot load from mysql.proc. The table is probably corrupted error : Corrupt sys.latest_file_io Error : Cannot load from mysql.proc. The table is probably corrupted error : Corrupt sys.memory_by_host_by_current_bytes Error : Table 'performance_schema.memory_summary_by_host_by_event_name' doesn't exist Error : View 'sys.memory_by_host_by_current_bytes' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them error : Corrupt sys.memory_by_thread_by_current_bytes Error : Table 'performance_schema.memory_summary_by_thread_by_event_name' doesn't exist Error : View 'sys.memory_by_thread_by_current_bytes' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them error : Corrupt sys.memory_by_user_by_current_bytes Error : Table 'performance_schema.memory_summary_by_user_by_event_name' doesn't exist Error : View 'sys.memory_by_user_by_current_bytes' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them error : Corrupt sys.memory_global_by_current_bytes Error : Table 'performance_schema.memory_summary_global_by_event_name' doesn't exist Error : View 'sys.memory_global_by_current_bytes' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them error : Corrupt sys.memory_global_total Error : Table 'performance_schema.memory_summary_global_by_event_name' doesn't exist Error : View 'sys.memory_global_total' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them error : Corrupt sys.metrics Error : Table 'performance_schema.global_status' doesn't exist Error : View 'sys.metrics' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them error : Corrupt sys.processlist Error : Table 'performance_schema.events_transactions_current' doesn't exist Error : View 'sys.processlist' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them error : Corrupt sys.ps_check_lost_instrumentation Error : Table 'performance_schema.global_status' doesn't exist Error : View 'sys.ps_check_lost_instrumentation' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them error : Corrupt sys.schema_auto_increment_columns OK sys.schema_index_statistics Error : Cannot load from mysql.proc. The table is probably corrupted error : Corrupt sys.schema_object_overview OK sys.schema_redundant_indexes OK sys.schema_table_lock_waits Error : Table 'performance_schema.metadata_locks' doesn't exist Error : View 'sys.schema_table_lock_waits' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them error : Corrupt sys.schema_table_statistics Error : Cannot load from mysql.proc. The table is probably corrupted error : Corrupt sys.schema_table_statistics_with_buffer Error : Cannot load from mysql.proc. The table is probably corrupted error : Corrupt sys.schema_tables_with_full_table_scans Error : Cannot load from mysql.proc. The table is probably corrupted error : Corrupt sys.schema_unused_indexes OK sys.session Error : Table 'performance_schema.events_transactions_current' doesn't exist Error : View 'sys.session' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them error : Corrupt sys.session_ssl_status Error : Table 'performance_schema.status_by_thread' doesn't exist Error : View 'sys.session_ssl_status' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them error : Corrupt sys.statement_analysis Error : Cannot load from mysql.proc. The table is probably corrupted error : Corrupt sys.statements_with_errors_or_warnings Error : Cannot load from mysql.proc. The table is probably corrupted error : Corrupt sys.statements_with_full_table_scans Error : Cannot load from mysql.proc. The table is probably corrupted error : Corrupt sys.statements_with_runtimes_in_95th_percentile Error : Cannot load from mysql.proc. The table is probably corrupted error : Corrupt sys.statements_with_sorting Error : Cannot load from mysql.proc. The table is probably corrupted error : Corrupt sys.statements_with_temp_tables Error : Cannot load from mysql.proc. The table is probably corrupted error : Corrupt sys.user_summary Error : Table 'performance_schema.memory_summary_by_user_by_event_name' doesn't exist Error : View 'sys.user_summary' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them error : Corrupt sys.user_summary_by_file_io Error : Cannot load from mysql.proc. The table is probably corrupted error : Corrupt sys.user_summary_by_file_io_type Error : Cannot load from mysql.proc. The table is probably corrupted error : Corrupt sys.user_summary_by_stages Error : Cannot load from mysql.proc. The table is probably corrupted error : Corrupt sys.user_summary_by_statement_latency Error : Cannot load from mysql.proc. The table is probably corrupted error : Corrupt sys.user_summary_by_statement_type Error : Cannot load from mysql.proc. The table is probably corrupted error : Corrupt sys.version OK sys.wait_classes_global_by_avg_latency Error : Cannot load from mysql.proc. The table is probably corrupted error : Corrupt sys.wait_classes_global_by_latency Error : Cannot load from mysql.proc. The table is probably corrupted error : Corrupt sys.waits_by_host_by_latency Error : Cannot load from mysql.proc. The table is probably corrupted error : Corrupt sys.waits_by_user_by_latency Error : Cannot load from mysql.proc. The table is probably corrupted error : Corrupt sys.waits_global_by_latency Error : Cannot load from mysql.proc. The table is probably corrupted error : Corrupt sys.x$host_summary Error : Table 'performance_schema.memory_summary_by_host_by_event_name' doesn't exist Error : View 'sys.x$host_summary' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them error : Corrupt sys.x$host_summary_by_file_io OK sys.x$host_summary_by_file_io_type OK sys.x$host_summary_by_stages OK sys.x$host_summary_by_statement_latency OK sys.x$host_summary_by_statement_type OK sys.x$innodb_buffer_stats_by_schema OK sys.x$innodb_buffer_stats_by_table OK sys.x$innodb_lock_waits OK sys.x$io_by_thread_by_latency OK sys.x$io_global_by_file_by_bytes OK sys.x$io_global_by_file_by_latency OK sys.x$io_global_by_wait_by_bytes OK sys.x$io_global_by_wait_by_latency OK sys.x$latest_file_io OK sys.x$memory_by_host_by_current_bytes Error : Table 'performance_schema.memory_summary_by_host_by_event_name' doesn't exist Error : View 'sys.x$memory_by_host_by_current_bytes' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them error : Corrupt sys.x$memory_by_thread_by_current_bytes Error : Table 'performance_schema.memory_summary_by_thread_by_event_name' doesn't exist Error : View 'sys.x$memory_by_thread_by_current_bytes' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them error : Corrupt sys.x$memory_by_user_by_current_bytes Error : Table 'performance_schema.memory_summary_by_user_by_event_name' doesn't exist Error : View 'sys.x$memory_by_user_by_current_bytes' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them error : Corrupt sys.x$memory_global_by_current_bytes Error : Table 'performance_schema.memory_summary_global_by_event_name' doesn't exist Error : View 'sys.x$memory_global_by_current_bytes' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them error : Corrupt sys.x$memory_global_total Error : Table 'performance_schema.memory_summary_global_by_event_name' doesn't exist Error : View 'sys.x$memory_global_total' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them error : Corrupt sys.x$processlist Error : Table 'performance_schema.events_transactions_current' doesn't exist Error : View 'sys.x$processlist' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them error : Corrupt sys.x$ps_digest_95th_percentile_by_avg_us OK sys.x$ps_digest_avg_latency_distribution OK sys.x$ps_schema_table_statistics_io Error : Cannot load from mysql.proc. The table is probably corrupted error : Corrupt sys.x$schema_flattened_keys OK sys.x$schema_index_statistics OK sys.x$schema_table_lock_waits Error : Table 'performance_schema.metadata_locks' doesn't exist Error : View 'sys.x$schema_table_lock_waits' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them error : Corrupt sys.x$schema_table_statistics Error : Cannot load from mysql.proc. The table is probably corrupted error : Corrupt sys.x$schema_table_statistics_with_buffer Error : Cannot load from mysql.proc. The table is probably corrupted error : Corrupt sys.x$schema_tables_with_full_table_scans OK sys.x$session Error : Table 'performance_schema.events_transactions_current' doesn't exist Error : View 'sys.x$session' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them error : Corrupt sys.x$statement_analysis OK sys.x$statements_with_errors_or_warnings OK sys.x$statements_with_full_table_scans OK sys.x$statements_with_runtimes_in_95th_percentile OK sys.x$statements_with_sorting OK sys.x$statements_with_temp_tables OK sys.x$user_summary Error : Table 'performance_schema.memory_summary_by_user_by_event_name' doesn't exist Error : View 'sys.x$user_summary' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them error : Corrupt sys.x$user_summary_by_file_io OK sys.x$user_summary_by_file_io_type OK sys.x$user_summary_by_stages OK sys.x$user_summary_by_statement_latency OK sys.x$user_summary_by_statement_type OK sys.x$wait_classes_global_by_avg_latency OK sys.x$wait_classes_global_by_latency OK sys.x$waits_by_host_by_latency OK sys.x$waits_by_user_by_latency OK sys.x$waits_global_by_latency OK Phase 4/7: Running 'mysql_fix_privilege_tables' Phase 5/7: Fixing table and database names Phase 6/7: Checking and upgrading tables Processing databases bookstack-db bookstack-db.activities OK bookstack-db.attachments OK bookstack-db.books OK bookstack-db.bookshelves OK bookstack-db.bookshelves_books OK bookstack-db.cache OK bookstack-db.chapters OK bookstack-db.comments OK bookstack-db.email_confirmations OK bookstack-db.entity_permissions OK bookstack-db.images OK bookstack-db.joint_permissions OK bookstack-db.migrations OK bookstack-db.page_revisions OK bookstack-db.pages OK bookstack-db.password_resets OK bookstack-db.permission_role OK bookstack-db.role_permissions OK bookstack-db.role_user OK bookstack-db.roles OK bookstack-db.search_terms OK bookstack-db.sessions OK bookstack-db.settings OK bookstack-db.social_accounts OK bookstack-db.tags OK bookstack-db.users OK bookstack-db.views OK information_schema performance_schema sys sys.sys_config OK Phase 7/7: Running 'FLUSH PRIVILEGES' OK root@41e6c8ab3346:/# ``` For security reasons I have changed all passwords and domains tlds as well as email addresses.
Author
Owner

@ssddanbrown commented on GitHub (Feb 5, 2021):

Sorry for my lack of response, but since this is relatively old I'm going to close this. If the issue remains and is something you still require to be fixed please open a new issue, referencing this one.

From what I can see of re-reviewing the info, The sort itself looks to be occurring fine, but then the book is not deemed visible to the user and hence it goes out of view. Could only think it's something off with permissions, You could attempt regenerating permissions and seeing if the book then becomes visible.

@ssddanbrown commented on GitHub (Feb 5, 2021): Sorry for my lack of response, but since this is relatively old I'm going to close this. If the issue remains and is something you still require to be fixed please open a new issue, referencing this one. From what I can see of re-reviewing the info, The sort itself looks to be occurring fine, but then the book is not deemed visible to the user and hence it goes out of view. Could only think it's something off with permissions, You could attempt regenerating permissions and seeing if the book then becomes visible.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#1252