shish / shimmie2

An easy-to-install community image gallery (aka booru)
http://code.shishnet.org/shimmie2/
GNU General Public License v2.0
406 stars 114 forks source link

Attempting to add tag category results in HTTP 500 error #918

Closed diamondsw closed 1 year ago

diamondsw commented 1 year ago

Server Software

about:
  title: "HomeBooru"
  theme: "danbooru2"

versions:
  shimmie: "2.10.0-alpha"
  schema: 21
  php: "8.2.5"
  db: "pgsql PostgreSQL 11.20 on x86_64-pc-linux-musl, compiled by gcc (Alpine 12.2.1_git20220924-r10) 12.2.1 20220924, 64-bit"
  os: "Linux 4d65c90ec21a 5.10.0-21-amd64 #1 SMP Debian 5.10.162-1 (2023-01-21) x86_64"
  server: "PHP 8.2.5 Development Server"

extensions:
  core: ["admin","alias_editor","bbcode","comment","download","et","ext_manager","four_oh_four","handle_pixel","help_pages","image","index","media","mime","setup","static_files","system","tag_edit","tag_list","upgrade","upload","user","user_config","view"]
  extra: ["favorites","home","pools","random_image","random_list","rating","relationships","tag_categories","tag_tools"]
  handled_mimes: ["image/jpeg","image/gif","image/png","image/webp"]

stats:
  images: 1
  comments: 0
  users: 2

media:
  memory_limit: "8.0MB"
  disk_use: "131.7GB"
  disk_total: "196.7GB"

thumbnails:
  engine: "convert"
  quality: 75
  width: 256
  height: 256
  scaling: 100
  mime: "image/jpeg"

Client Software (please complete the following information)

What steps trigger this bug This is related to the tag_categories extension.

  1. Go to 'https://booru.[redacted].com/tags/categories'
  2. Create a new tag category (e.g. "test"/"Test"/"Test"). Changing color or not appears to make no difference. Submit.

What did you expect to happen? Add a new category, similar to the pre-installed "Series", "Artist", and "Character".

What actually happened?

This page isn't working
booru.[redacted].com is currently unable to handle this request.
HTTP ERROR 500

I'm happy to repeat this and provide whatever logs are helpful.

diamondsw commented 1 year ago

This now appears to be working, but I cannot determine why. I've reverted to 2.9.2 and recreated docker directories. It may be a postgres permissions issue.

shish commented 1 year ago

If this happens again, seeing the docker logs would be useful - that should at least show a stack trace (assuming that the request is reaching shimmie in the first place)

diamondsw commented 9 months ago

Necrobumping this issue, as in creating a new clean copy of shimmie for a new project, I hit the same bug again!

Here's the shimmie docker logs:

2024/01/14 20:01:01 [notice] 77#77 [unit] #13: php message: PHP Fatal error:  Uncaught TypeError: Shimmie2\TagCategories::page_update(): Return value must be of type bool, FFSPHP\PDOStatement returned in /app/ext/tag_categories/main.php:212
Stack trace:
#0 /app/ext/tag_categories/main.php(74): Shimmie2\TagCategories->page_update()
#1 /app/core/send_event.php(156): Shimmie2\TagCategories->onPageRequest()
#2 /app/index.php(89): Shimmie2\send_event()
#3 {main}
  thrown in /app/ext/tag_categories/main.php on line 212

Nothing on the postgres logs; changing permissions as mentioned in the above postgres issue did not affect this.

Given that this is a very fresh setup (just configuring my theme/board/extension settings, no posts at all yet), I'm attaching a tar.gz of the whole Docker install. Should be able to fire it up with a docker compose up -d and see everything I'm seeing. Obviously only in a safe environment because I am a rando on the internet. shimmie-test.tar.gz u:Admin p:admin

shish commented 9 months ago

013ae41 should fix that, and I have no idea why the static type checker isn't complaining about that, even after bumping up the strictness by several notches o_O

diamondsw commented 9 months ago

Confirmed, this is resolved. Thanks for tracking it down!