Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] HTTP 500 after upgrade #184

Closed
1 task done
scout249 opened this issue Aug 16, 2023 · 7 comments
Closed
1 task done

[BUG] HTTP 500 after upgrade #184

scout249 opened this issue Aug 16, 2023 · 7 comments

Comments

@scout249
Copy link

scout249 commented Aug 16, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

I've tried to upgrade bookstack from amd64-version-v22.10.2 to latest via docker-compose, but it does not work and show HTTP error 500.
I have tried to revert to old version, but bookstack still not show HTTP 500.

Expected Behavior

Should serve Bookstack.

Steps To Reproduce

Copy/paste docker-compose config from README with the addition of APP_URL
Access it through a browser, no error is shown

---
version: "2"
services:
  bookstack:
    image: lscr.io/linuxserver/bookstack:amd64-version-v22.10.2
    container_name: bookstack
    environment:
      - PUID=1000
      - PGID=1000
      - APP_URL=http://bookstack.mycompany.com
      - DB_HOST=bookstack_db
      - DB_USER=bookstack
      - DB_PASS=12345678
      - DB_DATABASE=bookstackapp
    volumes:
      - /home/superman/bookstack/app:/config
    ports:
      - 6875:80
    restart: unless-stopped
    depends_on:
      - bookstack_db
  bookstack_db:
    image: lscr.io/linuxserver/mariadb:amd64-10.6.10-r0-ls75
    container_name: bookstack_db
    environment:
      - PUID=1000
      - PGID=1000
      - MYSQL_ROOT_PASSWORD=12345678
      - TZ=Asia/Hong_Kong
      - MYSQL_DATABASE=bookstackapp
      - MYSQL_USER=bookstack
      - MYSQL_PASSWORD=12345678
    volumes:
      - /home/superman/bookstack/db:/config
    restart: unless-stopped

Modify the script to use latest tag for bookstack:latest and mariadb:latest

---
version: "2"
services:
  bookstack:
    image: lscr.io/linuxserver/bookstack:latest
    container_name: bookstack
    environment:
      - PUID=1000
      - PGID=1000
      - APP_URL=http://bookstack.mycompany.com
      - DB_HOST=bookstack_db
      - DB_USER=bookstack
      - DB_PASS=12345678
      - DB_DATABASE=bookstackapp
    volumes:
      - /home/superman/bookstack/app:/config
    ports:
      - 6875:80
    restart: unless-stopped
    depends_on:
      - bookstack_db
  bookstack_db:
    image: lscr.io/linuxserver/mariadb:latest
    container_name: bookstack_db
    environment:
      - PUID=1000
      - PGID=1000
      - MYSQL_ROOT_PASSWORD=12345678
      - TZ=Asia/Hong_Kong
      - MYSQL_DATABASE=bookstackapp
      - MYSQL_USER=bookstack
      - MYSQL_PASSWORD=12345678
    volumes:
      - /home/superman/bookstack/db:/config
    restart: unless-stopped

Environment

Environment
OS: Ubuntu 16.04
CPU architecture: x86_64
Portainer 2.16.2
How docker service was installed: Like docker's documentation shows

CPU architecture

x86-64

Docker creation

Portainer > Stack > Start

Container logs

[migrations] 01-nginx-site-confs-default: skipped
[migrations] 02-default-location: skipped
[migrations] done
cont-init: info: /etc/cont-init.d/01-migrations exited 0
cont-init: info: running /etc/cont-init.d/10-adduser
-------------------------------------
          _         ()
         | |  ___   _    __
         | | / __| | |  /  \
         | | \__ \ | | | () |
         |_| |___/ |_|  \__/
Brought to you by linuxserver.io
-------------------------------------
To support LSIO projects visit:
https://www.linuxserver.io/donate/
-------------------------------------
GID/UID
-------------------------------------
User uid:    1000
User gid:    1000
-------------------------------------
cont-init: info: /etc/cont-init.d/10-adduser exited 0
cont-init: info: running /etc/cont-init.d/11-folders
cont-init: info: /etc/cont-init.d/11-folders exited 0
cont-init: info: running /etc/cont-init.d/12-samples
cont-init: info: /etc/cont-init.d/12-samples exited 0
cont-init: info: running /etc/cont-init.d/13-nginx
cont-init: info: /etc/cont-init.d/13-nginx exited 0
cont-init: info: running /etc/cont-init.d/14-php
cont-init: info: /etc/cont-init.d/14-php exited 0
cont-init: info: running /etc/cont-init.d/15-keygen
using keys found in /config/keys
cont-init: info: /etc/cont-init.d/15-keygen exited 0
cont-init: info: running /etc/cont-init.d/20-permissions
cont-init: info: /etc/cont-init.d/20-permissions exited 0
cont-init: info: running /etc/cont-init.d/50-config
New container detected. Setting up app folder and fixing permissions.
App Key found - setting variable for seds
Running config - db_user set
**** APP_URL in /config/www/.env is being updated from http://127.0.0.1:6875 to http://bookstack.mycompany.com ****
**** If this is an existing install, you should run the following line from your host terminal to update the database URL entries: ****
************************************************************************
docker exec -it bookstack php /app/www/artisan bookstack:update-url http://127.0.0.1:6875 http://bookstack.mycompany.com
************************************************************************
   Illuminate\Database\QueryException 
  SQLSTATE[HY000] [2002] Connection refused (SQL: select * from information_schema.tables where table_schema = bookstackapp and table_name = migrations and table_type = 'BASE TABLE')
  at /app/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php:712
    708▕         // If an exception occurs when attempting to run a query, we'll format the error
    709▕         // message to include the bindings with SQL, which will make this exception a
    710▕         // lot more helpful to the developer instead of just the database's errors.
    711▕         catch (Exception $e) {
  ➜ 712▕             throw new QueryException(
    713▕                 $query, $this->prepareBindings($bindings), $e
    714▕             );
    715▕         }
    716▕     }
      +36 vendor frames 
  37  /app/www/artisan:37
      Illuminate\Foundation\Console\Kernel::handle()
cont-init: info: /etc/cont-init.d/50-config exited 0
cont-init: info: running /etc/cont-init.d/85-version-checks
**** The following active confs have different version dates than the samples that are shipped. ****
**** This may be due to user customization or an update to the samples. ****
**** You should compare the following files to the samples in the same folder and update them. ****
**** Use the link at the top of the file to view the changelog. ****
/config/nginx/nginx.conf
/config/nginx/site-confs/default.conf
cont-init: info: /etc/cont-init.d/85-version-checks exited 0
cont-init: info: running /etc/cont-init.d/99-custom-files
[custom-init] No custom files found, skipping...
cont-init: info: /etc/cont-init.d/99-custom-files exited 0
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service init-mods: starting
s6-rc: info: service init-mods successfully started
s6-rc: info: service init-mods-package-install: starting
s6-rc: info: service init-mods-package-install successfully started
s6-rc: info: service init-mods-end: starting
s6-rc: info: service init-mods-end successfully started
s6-rc: info: service init-services: starting
s6-rc: info: service init-services successfully started
s6-rc: info: service legacy-services: starting
services-up: info: copying legacy longrun cron (no readiness notification)
services-up: info: copying legacy longrun memcached (no readiness notification)
services-up: info: copying legacy longrun nginx (no readiness notification)
services-up: info: copying legacy longrun php-fpm (no readiness notification)
s6-rc: info: service legacy-services successfully started
s6-rc: info: service 99-ci-service-check: starting
[ls.io-init] done.
s6-rc: info: service 99-ci-service-check successfully started
@github-actions
Copy link

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

@j0nnymoe
Copy link
Member

Your SQL container is refusing connection. You probably want to investigate that.

@scout249
Copy link
Author

@j0nnymoe

This is the log from mariadb container.

230816 17:02:19 mysqld_safe Logging to '/config/databases/dcd59ebc11b2.err'.
230816 17:02:19 mysqld_safe Starting mariadbd daemon with databases from /config/databases
Caught SIGTERM signal!
cat: /var/run/mysqld/mysqld.pid: No such file or directory
230816 17:02:20 mysqld_safe Logging to '/config/databases/dcd59ebc11b2.err'.
230816 17:02:20 mysqld_safe Starting mariadbd daemon with databases from /config/databases
Caught SIGTERM signal!
cat: /var/run/mysqld/mysqld.pid: No such file or directory
230816 17:02:21 mysqld_safe Logging to '/config/databases/dcd59ebc11b2.err'.
230816 17:02:21 mysqld_safe Starting mariadbd daemon with databases from /config/databases
Caught SIGTERM signal!
cat: /var/run/mysqld/mysqld.pid: No such file or directory
230816 17:02:22 mysqld_safe Logging to '/config/databases/dcd59ebc11b2.err'.
230816 17:02:22 mysqld_safe Starting mariadbd daemon with databases from /config/databases
Caught SIGTERM signal!
cat: /var/run/mysqld/mysqld.pid: No such file or directory
230816 17:02:23 mysqld_safe Logging to '/config/databases/dcd59ebc11b2.err'.
230816 17:02:23 mysqld_safe Starting mariadbd daemon with databases from /config/databases
Caught SIGTERM signal!
cat: /var/run/mysqld/mysqld.pid: No such file or directory
230816 17:02:24 mysqld_safe Logging to '/config/databases/dcd59ebc11b2.err'.
230816 17:02:24 mysqld_safe Starting mariadbd daemon with databases from /config/databases
Caught SIGTERM signal!
cat: /var/run/mysqld/mysqld.pid: No such file or directory
230816 17:02:25 mysqld_safe Logging to '/config/databases/dcd59ebc11b2.err'.
230816 17:02:25 mysqld_safe Starting mariadbd daemon with databases from /config/databases
Caught SIGTERM signal!
cat: /var/run/mysqld/mysqld.pid: No such file or directory
230816 17:02:26 mysqld_safe Logging to '/config/databases/dcd59ebc11b2.err'.
230816 17:02:26 mysqld_safe Starting mariadbd daemon with databases from /config/databases
Caught SIGTERM signal!
cat: /var/run/mysqld/mysqld.pid: No such file or directory
230816 17:02:27 mysqld_safe Logging to '/config/databases/dcd59ebc11b2.err'.
230816 17:02:27 mysqld_safe Starting mariadbd daemon with databases from /config/databases
Caught SIGTERM signal!
cat: /var/run/mysqld/mysqld.pid: No such file or directory
230816 17:02:28 mysqld_safe Logging to '/config/databases/dcd59ebc11b2.err'.
230816 17:02:28 mysqld_safe Starting mariadbd daemon with databases from /config/databases
Caught SIGTERM signal!
cat: /var/run/mysqld/mysqld.pid: No such file or directory
230816 17:02:29 mysqld_safe Logging to '/config/databases/dcd59ebc11b2.err'.
230816 17:02:29 mysqld_safe Starting mariadbd daemon with databases from /config/databases
Caught SIGTERM signal!
cat: /var/run/mysqld/mysqld.pid: No such file or directory
230816 17:02:30 mysqld_safe Logging to '/config/databases/dcd59ebc11b2.err'.
230816 17:02:30 mysqld_safe Starting mariadbd daemon with databases from /config/databases
Caught SIGTERM signal!
cat: /var/run/mysqld/mysqld.pid: No such file or directory
230816 17:02:31 mysqld_safe Logging to '/config/databases/dcd59ebc11b2.err'.
230816 17:02:31 mysqld_safe Starting mariadbd daemon with databases from /config/databases
Caught SIGTERM signal!
cat: /var/run/mysqld/mysqld.pid: No such file or directory
230816 17:02:32 mysqld_safe Logging to '/config/databases/dcd59ebc11b2.err'.
230816 17:02:32 mysqld_safe Starting mariadbd daemon with databases from /config/databases
Caught SIGTERM signal!
cat: /var/run/mysqld/mysqld.pid: No such file or directory
230816 17:02:33 mysqld_safe Logging to '/config/databases/dcd59ebc11b2.err'.
230816 17:02:33 mysqld_safe Starting mariadbd daemon with databases from /config/databases
Caught SIGTERM signal!
cat: /var/run/mysqld/mysqld.pid: No such file or directory
230816 17:02:34 mysqld_safe Logging to '/config/databases/dcd59ebc11b2.err'.
230816 17:02:34 mysqld_safe Starting mariadbd daemon with databases from /config/databases
Caught SIGTERM signal!
cat: /var/run/mysqld/mysqld.pid: No such file or directory
230816 17:02:35 mysqld_safe Logging to '/config/databases/dcd59ebc11b2.err'.
230816 17:02:35 mysqld_safe Starting mariadbd daemon with databases from /config/databases
Caught SIGTERM signal!
cat: /var/run/mysqld/mysqld.pid: No such file or directory
230816 17:02:36 mysqld_safe Logging to '/config/databases/dcd59ebc11b2.err'.
230816 17:02:36 mysqld_safe Starting mariadbd daemon with databases from /config/databases
Caught SIGTERM signal!
cat: /var/run/mysqld/mysqld.pid: No such file or directory
230816 17:02:37 mysqld_safe Logging to '/config/databases/dcd59ebc11b2.err'.
230816 17:02:37 mysqld_safe Starting mariadbd daemon with databases from /config/databases
Caught SIGTERM signal!
cat: /var/run/mysqld/mysqld.pid: No such file or directory
230816 17:02:38 mysqld_safe Logging to '/config/databases/dcd59ebc11b2.err'.
230816 17:02:38 mysqld_safe Starting mariadbd daemon with databases from /config/databases
Caught SIGTERM signal!
cat: /var/run/mysqld/mysqld.pid: No such file or directory
230816 17:02:39 mysqld_safe Logging to '/config/databases/dcd59ebc11b2.err'.
230816 17:02:39 mysqld_safe Starting mariadbd daemon with databases from /config/databases
Caught SIGTERM signal!
cat: /var/run/mysqld/mysqld.pid: No such file or directory
230816 17:02:40 mysqld_safe Logging to '/config/databases/dcd59ebc11b2.err'.
230816 17:02:40 mysqld_safe Starting mariadbd daemon with databases from /config/databases
Caught SIGTERM signal!
cat: /var/run/mysqld/mysqld.pid: No such file or directory
230816 17:02:41 mysqld_safe Logging to '/config/databases/dcd59ebc11b2.err'.
230816 17:02:41 mysqld_safe Starting mariadbd daemon with databases from /config/databases
Caught SIGTERM signal!
cat: /var/run/mysqld/mysqld.pid: No such file or directory
230816 17:02:42 mysqld_safe Logging to '/config/databases/dcd59ebc11b2.err'.
230816 17:02:42 mysqld_safe Starting mariadbd daemon with databases from /config/databases
Caught SIGTERM signal!
cat: /var/run/mysqld/mysqld.pid: No such file or directory
230816 17:02:43 mysqld_safe Logging to '/config/databases/dcd59ebc11b2.err'.
230816 17:02:43 mysqld_safe Starting mariadbd daemon with databases from /config/databases
Caught SIGTERM signal!
cat: /var/run/mysqld/mysqld.pid: No such file or directory

@j0nnymoe
Copy link
Member

Yep, you've got a corrupted database there. Follow that guide but also, you're using portainer. We don't support nor recommend it.
https://info.linuxserver.io/issues/2023-05-22-portainer/

@scout249
Copy link
Author

Thank you, this is the first time I heard portainer and Synology will overwrite settings.

I am trying to repair the database, and getting error message.
Is there any specific log I need to check? Thank you.

root@docker:~$ docker ps
CONTAINER ID   IMAGE                                                  COMMAND                  CREATED             STATUS                       PORTS                                                                                  NAMES
09a2e8e159fc   lscr.io/linuxserver/bookstack:amd64-version-v22.10.2   "/init"                  19 seconds ago      Up 18 seconds                443/tcp, 0.0.0.0:6875->80/tcp, :::6875->80/tcp                                         bookstack
fd72148f19b2   lscr.io/linuxserver/mariadb:amd64-10.6.10-r0-ls75      "/init"                  19 seconds ago      Up 18 seconds                3306/tcp                                                                               bookstack_db
root@docker:~$ docker exec -it fd72 bash
root@fd72148f19b2:/# mariadb-check -A
mariadb-check: Got error: 2002: Can't connect to local server through socket '/run/mysqld/mysqld.sock' (2) when trying to connect
root@fd72148f19b2:/# mariadb-check -A -u root
mariadb-check: Got error: 2002: Can't connect to local server through socket '/run/mysqld/mysqld.sock' (2) when trying to connect
root@fd72148f19b2:/# mariadb-check -A -u root -p
Enter password:
mariadb-check: Got error: 2002: Can't connect to local server through socket '/run/mysqld/mysqld.sock' (2) when trying to connect
root@fd72148f19b2:/# mariadb-check -A -u bookstack -p
Enter password:
mariadb-check: Got error: 2002: Can't connect to local server through socket '/run/mysqld/mysqld.sock' (2) when trying to connect
root@fd72148f19b2:/# mariadb-check -a -A
mariadb-check: Got error: 2002: Can't connect to local server through socket '/run/mysqld/mysqld.sock' (2) when trying to connect
root@fd72148f19b2:/# mariadb-check -a -A -u bookstack -p
Enter password:
mariadb-check: Got error: 2002: Can't connect to local server through socket '/run/mysqld/mysqld.sock' (2) when trying to connect
root@fd72148f19b2:/# mariadb-check -a -A -u root -p
Enter password:
mariadb-check: Got error: 2002: Can't connect to local server through socket '/run/mysqld/mysqld.sock' (2) when trying to connect

@drizuid
Copy link
Member

drizuid commented Sep 5, 2023

I am trying to repair the database, and getting error message.
Is there any specific log I need to check? Thank you.

We support the container, not the application. I would suggest that if you wish to repair the db, you consult the official mariadb documentation. The easier thing would be to restore your latest backup prior to the corruption. As a note, we haven't supported or recommended portainer for 5+ years.

@drizuid drizuid closed this as not planned Won't fix, can't repro, duplicate, stale Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

3 participants