philomena-dev / philomena

Next-generation imageboard
GNU Affero General Public License v3.0
84 stars 29 forks source link

Thumbnail Generator Worker no Work #173

Closed KamillaPup closed 1 year ago

KamillaPup commented 1 year ago

Describe the bug Likely not a bug but a user error... All images show missing thumbnail, even newly added ones. Fetching am image shows a broken icon.

To Reproduce Steps to reproduce the behavior:

  1. Build and Up from default docker-compose.yml file
  2. Log into Philomena.
  3. No images :(
  4. Upload new post and tag.
  5. Thumbnail generation never completes.

Can't fetch from url either :(

Expected behavior All thumbnails should be generated.

Desktop (please complete the following information):

Additional context I originally tried putting in my Linode cdn with no success but even with leaving it default s3 it still fails. I see in the logs there's a failure with the thumbnail generator worker.

liamwhite commented 1 year ago

I just tried it with a fresh install and clean philomena master, and it is generating and delivering thumbnails for me. Not sure what would be going wrong?

KamillaPup commented 1 year ago

Maybe this will help?

app_1            |     (philomena 1.1.0) lib/philomena/images/thumbnailer.ex:76: Philomena.Images.Thumbnailer.generate_thumbnails/1
app_1            |     (philomena 1.1.0) lib/philomena/workers/thumbnail_worker.ex:6: Philomena.ThumbnailWorker.perform/1
app_1            |     (exq 0.16.2) lib/exq/worker/server.ex:175: anonymous fn/4 in Exq.Worker.Server.dispatch_work/3
app_1            |     (elixir 1.14.2) lib/task/supervised.ex:89: Task.Supervised.invoke_mfa/2
app_1            |     (stdlib 4.2) proc_lib.erl:240: :proc_lib.init_p_do_apply/3
app_1            | Function: #Function<0.45755892/0 in Exq.Worker.Server.dispatch_work/3>
app_1            |     Args: []
app_1            | [info] Queueing job 23711cfa-25d2-42dd-8e93-2c150daf9f8e to retry in 34.0 seconds
app_1            | [warning] {{:badkey, :body, nil},
app_1            |  [
app_1            |    {Philomena.Objects, :download_file, 2,
app_1            |     [file: 'lib/philomena/objects.ex', line: 26]},
app_1            |    {Philomena.Images.Thumbnailer, :download_image_file, 1,
app_1            |     [file: 'lib/philomena/images/thumbnailer.ex', line: 125]},
app_1            |    {Philomena.Images.Thumbnailer, :generate_thumbnails, 1,
app_1            |     [file: 'lib/philomena/images/thumbnailer.ex', line: 76]},
app_1            |    {Philomena.ThumbnailWorker, :perform, 1,
app_1            |     [file: 'lib/philomena/workers/thumbnail_worker.ex', line: 6]},
app_1            |    {Exq.Worker.Server, :"-dispatch_work/3-fun-0-", 4,
app_1            |     [file: 'lib/exq/worker/server.ex', line: 175]},
app_1            |    {Task.Supervised, :invoke_mfa, 2, [file: 'lib/task/supervised.ex', line: 89]},
app_1            |    {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 240]}
app_1            |  ]}
app_1            | [warning] Elixir.Philomena.ThumbnailWorker[23711cfa-25d2-42dd-8e93-2c150daf9f8e] fail: 44ms

app_1            | SELECT i0."id", i0."user_id", i0."deleted_by_id", i0."image", i0."image_name", i0."image_width", i0."image_height", i0."image_size", i0."image_format", i0."image_mime_type", i0."image_aspect_ratio", i0."image_duration", i0."is_animated", i0."ip", i0."fingerprint", i0."user_agent", i0."referrer", i0."anonymous", i0."score", i0."faves_count", i0."upvotes_count", i0."downvotes_count", i0."votes_count", i0."source_url", i0."description", i0."image_sha512_hash", i0."image_orig_sha512_hash", i0."deletion_reason", i0."duplicate_id", i0."comments_count", i0."processed", i0."thumbnails_generated", i0."duplication_checked", i0."hidden_from_users", i0."tag_editing_allowed", i0."description_editing_allowed", i0."commenting_allowed", i0."first_seen_at", i0."destroyed_content", i0."hidden_image_key", i0."scratchpad", i0."hides_count", i0."approved", i0."tag_list_cache", i0."tag_list_plus_alias_cache", i0."file_name_cache", i0."created_at", i0."updated_at" FROM "images" AS i0 WHERE (i0."id" = $1) [9]
app_1            | [error] Task #PID<0.857.0> started from #PID<0.856.0> terminating
liamwhite commented 1 year ago

Is the s3proxy service running? (philomena_files_1)

KamillaPup commented 1 year ago

Yes the service is running but it was popping up errors. Do I need to setup S3 on AWS or does files emulate that?

liamwhite commented 1 year ago

No, the philomena_files_1 is supposed to provide a local testing environment for files without contacting S3.

KamillaPup commented 1 year ago

Thanks for your help! So I got to run with thumbnails but it seems to still be using the old database as my login isn't working anymore nor is the default example login. How do I wipe and start over without wiping my entire server? Basically when I build again even after removing the philomena folder I cloned, it says philomena_dev already exists. Where is this stored? I checked /var/lib/postgresql/data and it doesn't exist, which it shows as the drive that's being used.

Sorry for being high maintenance :<

Meow commented 1 year ago

Try completely wiping everything and recreating:

# stop containers
docker-compose down
# delete all unused containers, volumes and images
docker container prune
docker volume prune
docker image prune --all
# delete all files ignored by git
git clean -xfdf
# build new images
docker-compose build
# start
docker-compose up
KamillaPup commented 1 year ago

Sweet! Up and running <3 Thank you.