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]: Embed pictrs doesn't work #3359

Closed
4 tasks done
arne-fuchs opened this issue Jun 26, 2023 · 7 comments
Closed
4 tasks done

[Bug]: Embed pictrs doesn't work #3359

arne-fuchs opened this issue Jun 26, 2023 · 7 comments
Labels
bug Something isn't working

Comments

@arne-fuchs
Copy link

Requirements

  • Is this a bug report? For questions or discussions use https://lemmy.ml/c/lemmy_support
  • Did you check to see if this issue already exists?
  • Is this only a single bug? Do not put multiple bugs in one issue.
  • Is this a backend issue? Use the lemmy-ui repo for UI / frontend issues.

Summary

I followed these steps to install the lemmy server from scratch by using the steps below.

But after trying to upload a picture it says that it cant parse json on line 1.
If I start up a pictrs server and then try to upload a picture, lemmy server starts to talk to the pictrs instance running locally.

So the --features embed-pictrs flag has no effect.

Building without the flag has the same results.

2023-06-26_15-51

Steps to Reproduce

  1. git clone https://github.com/LemmyNet/lemmy.git lemmy
  2. cd lemmy
  3. git checkout 0.18.0
  4. git submodule init
  5. git submodule update --recursive --remote
  6. cargo build --release --features embed-pictrs
  7. Try to upload picture

Technical Details

Debian GNU/Linux trixie/sid x86_64
rustup 1.26.0 (5af9b9484 2023-04-05)

Version

0.18.0

Lemmy Instance URL

lemmy.paesserver.de

@arne-fuchs arne-fuchs added the bug Something isn't working label Jun 26, 2023
@arne-fuchs
Copy link
Author

These logs are being printed when upload a image:

Jun 26 14:04:07 ns3030678 lemmy_server[3448092]: 2023-06-26T14:04:07.236615Z  WARN Error encountered while processing the incoming HTTP request: lemmy_server::root_span_builder: Request error: error sending request for url (http://localhost:8080/image): error trying to connect: tcp connect error: Connection refused (os error 111)
Jun 26 14:04:07 ns3030678 lemmy_server[3448092]: Reqwest(reqwest::Error { kind: Request, url: Url { scheme: "http", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("localhost")), port: Some(8080), path: "/image", query: None, fragment: None }, source: hyper::Error(Connect, ConnectError("tcp connect error", Os { code: 111, kind: ConnectionRefused, message: "Connection refused" })) })
Jun 26 14:04:07 ns3030678 lemmy_server[3448092]: 2023-06-26T14:04:07.236662Z  INFO actix_web::middleware::logger: 194.126.177.86 'POST /pictrs/image HTTP/1.1' 400 153 'https://lemmy.paesserver.de/admin' 'Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/114.0' 0.000532

@dawtmaytrikx
Copy link

See here: https://lemmy.ml/post/1509599

The reference to http://localhost:8080/image in the logs looks to me like the pictrs url isn't set up properly in the lemmy.hjson.

@arne-fuchs
Copy link
Author

arne-fuchs commented Jun 26, 2023

@dawtmaytrikx Thanks for your response. I have a different setup than the guy in the post. He is using docker and I've build form scratch. At his scenario he is using an own pictrs instance while I have build from scratch, where I add prictrs as compile feature.
If I look in my netstat, there is no pictrs instance listening for request either. But I do not know how it is implemented.

@arne-fuchs
Copy link
Author

I get following error from lemmy when starting it:

Jun 26 20:36:57 ns3030678 lemmy_server[2259490]: thread 'main' panicked at 'run pictrs: IO error: Not a directory (os error 20)

@arne-fuchs
Copy link
Author

Fixed it by setting

WorkingDirectory=/path/to/your/liking

in my service file and creating a pictrs folder and change the ownership to lemmy.
Should be included in the documentary.

@snowe2010
Copy link

I also got this error the other day when trying to upload an image that was too large. Just for others that might find this issue thread.

@Nutomic
Copy link
Member

Nutomic commented Jun 29, 2023

@arne-fuchs You can make a pull request in lemmy-docs repo.

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

No branches or pull requests

4 participants