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

When pictrs cant fetch site logo, entire site breaks #2211

Closed
4 tasks done
pallebone opened this issue Nov 4, 2023 · 6 comments · Fixed by #2619
Closed
4 tasks done

When pictrs cant fetch site logo, entire site breaks #2211

pallebone opened this issue Nov 4, 2023 · 6 comments · Fixed by #2619
Labels
bug Something isn't working
Milestone

Comments

@pallebone
Copy link

Requirements

  • This is a bug report, and if not, please post to https://lemmy.ml/c/lemmy_support instead.
  • Please check to see if this issue already exists.
  • It's a single bug. Do not report multiple bugs in one issue.
  • It's a frontend issue, not a backend issue; Otherwise please create an issue on the backend repo instead.

Summary

Sometimes pictrs fails for many reasons, mostly because its not 100% perfect, to give a valid response to the logo call from lemmy-ui then the entire lemmy site no longer loads. This can be resolved by removing the site logo and uploading a new one again, without having to restart anything at all. Then lemmy-ui can get the logo again and the site functions normally once more.

A better solution to the entire site breaking would be to display a broken image icon or something as the logo so that the site continues to operate when this happens.

you can also remove the site logo directly from the postgres DB by using update site set icon = null where id = 1; and this also fixes the site again and then you can upload a new one.

Would make lemmy more reliable if this could be fixed, as pictrs cant be relied upon to be 100% reliable in every case every time until the end of the universe, as its just written by a normal human and so on. Bugs happen.

Steps to Reproduce

  1. Have site logo break.
  2. Lemmy site no longer loads.

Technical Details

Docker build with pictrs, same as 99% of lemmy servers.

Lemmy Instance Version

0.18.5

Lemmy Instance URL

https://lemmy.myserv.one/

@pallebone pallebone added the bug Something isn't working label Nov 4, 2023
@madeofstown
Copy link

madeofstown commented Dec 27, 2023

Having the same issue on a fresh install of lemmy version 0.19.1 with pictrs version 0.4.7. This error happens every time the server is restarted while a site icon is set.

@Illecors
Copy link

I've done a quick write up on how to circumvent it. Now that I think of it I should probably not have tagged it as "solved" as it's not a code change, but it honestly is solved from my perspective as a sysadmin.

https://lemmy.cafe/post/2346168

@kroese kroese mentioned this issue Jun 2, 2024
4 tasks
@db0
Copy link

db0 commented Jun 8, 2024

A simpler workaround I followed is to remove the images/banner for a bit until pict-rs comes back.

First point them to some external image (here's I'm using the Haidra logo)

UPDATE site SET banner = 'https://aihorde.net/assets/img/logo.png' WHERE id = 1;
UPDATE site SET icon = 'https://aihorde.net/assets/img/logo.png' WHERE id = 1;

then restart your UI. Once it comes back, go to your settings and remove banner and icon

@madeofstown
Copy link

madeofstown commented Jul 2, 2024

I can't believe this is still an issue. I thought for sure a huge increase in users would have spured more interest from the developer community. At this point I've moved on to new obsession but it appears maybe others have as well. Hopefully this finally gets fixed whenever 0.19.6 drops.

@SleeplessOne1917
Copy link
Member

Working on this now. When this error occurs, do the lemmy-ui logs show an error like this?:

lemmy-ui-1  | Error: Input buffer contains unsupported image format
lemmy-ui-1  |     at Sharp.toBuffer (/app/node_modules/.pnpm/sharp@0.33.4/node_modules/sharp/lib/output.js:161:17)
lemmy-ui-1  |     at _callee$ (webpack://lemmy-ui/./src/server/utils/create-ssr-html.tsx?:79:20)
lemmy-ui-1  |     at tryCatch (/app/node_modules/.pnpm/@babel+runtime@7.24.8/node_modules/@babel/runtime/helpers/regeneratorRuntime.js:45:16)
lemmy-ui-1  |     at Generator.<anonymous> (/app/node_modules/.pnpm/@babel+runtime@7.24.8/node_modules/@babel/runtime/helpers/regeneratorRuntime.js:133:17)
lemmy-ui-1  |     at Generator.next (/app/node_modules/.pnpm/@babel+runtime@7.24.8/node_modules/@babel/runtime/helpers/regeneratorRuntime.js:74:21)
lemmy-ui-1  |     at asyncGeneratorStep (/app/node_modules/.pnpm/@babel+runtime@7.24.8/node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:17)
lemmy-ui-1  |     at _next (/app/node_modules/.pnpm/@babel+runtime@7.24.8/node_modules/@babel/runtime/helpers/asyncToGenerator.js:17:9)
lemmy-ui-1  |     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

If so, I think I'm on the right track for reproducing the issue.

@dessalines
Copy link
Member

Yep I believe it does. Or any sharp error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants