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

Reimplement Pict-RS #43

Merged
merged 30 commits into from
Dec 26, 2023
Merged

Reimplement Pict-RS #43

merged 30 commits into from
Dec 26, 2023

Conversation

tituspijean
Copy link
Member

@tituspijean tituspijean commented Jun 19, 2023

Closes #31

Reimplements Pict-RS, while avoiding build time by extracting builds from Docker images, as for Lemmy and Lemmy UI themselves.

PR Status

  • Code finished and ready to be reviewed/tested
  • The fix/enhancement were manually tested (if applicable)

Automatic tests

Automatic tests can be triggered on https://ci-apps-dev.yunohost.org/ after creating the PR, by commenting "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!". (N.B. : for this to work you need to be a member of the Yunohost-Apps organization)

@tituspijean
Copy link
Member Author

tituspijean commented Jun 19, 2023

Status: file upload fails with error 500 and the following error:

(stacktrace enabled by adding Environment=RUST_BACKTRACE=full in /etc/systemd/system/lemmy-pict-rs.service)

# cat /var/log/lemmy/lemmy-pict-rs.log
2023-06-19T22:16:50.414812Z  INFO actix_server::builder: starting 4 workers
2023-06-19T22:16:50.414842Z  INFO actix_server::server: Actix runtime found; starting in Actix runtime
2023-06-19T22:16:53.532435Z  INFO HTTP request{http.method=POST http.route=/image http.flavor=1.1 http.scheme=http http.host=127.0.0.1:8081 http.client_ip=172.19.112.1 http.user_agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/114.0 http.target=/image otel.name=HTTP POST /image otel.kind="server" request_id=169fc643-1d45-42ba-b5ac-bdf9850db875}: tracing_actix_web::root_span_builder: new
2023-06-19T22:16:53.630965Z  INFO HTTP request{http.method=POST http.route=/image http.flavor=1.1 http.scheme=http http.host=127.0.0.1:8081 http.client_ip=172.19.112.1 http.user_agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/114.0 http.target=/image otel.name=HTTP POST /image otel.kind="server" request_id=169fc643-1d45-42ba-b5ac-bdf9850db875 trace_id=00000000000000000000000000000000 exception.message=Error interacting with filesystem exception.details=
   0: Error interacting with filesystem
   1: No such file or directory (os error 2)

Location:
   /drone/src/src/error.rs:38

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ SPANTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

   0: pict_rs::magick::details_bytes with hint=None
      at src/magick.rs:135
   1: pict_rs::validate::validate_bytes
      at src/validate.rs:38
   2: pict_rs::ingest::ingest with declared_alias=None should_validate=true
      at src/ingest.rs:44
   3: pict_rs::file-upload with filename="ynh_logo_white_300dpi.png"
      at src/lib.rs:154
   4: tracing_actix_web::root_span_builder::HTTP request with http.method=POST http.route=/image http.flavor=1.1 http.scheme=http http.host=127.0.0.1:8081 http.client_ip=172.19.112.1 http.user_agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/114.0 http.target=/image otel.name=HTTP POST /image otel.kind="server" request_id=169fc643-1d45-42ba-b5ac-bdf9850db875 trace_id=00000000000000000000000000000000
      at /opt/build/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tracing-actix-web-0.7.5/src/root_span_builder.rs:41
   5: tokio::task::runtime.spawn with kind=local task.name= task.id=46 loc.file="/opt/build/.cargo/registry/src/index.crates.io-6f17d22bba15001f/actix-server-2.2.0/src/service.rs" loc.line=74 loc.col=17
      at /opt/build/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/util/trace.rs:16
   6: tokio::task::runtime.spawn with kind=local task.name= task.id=16 loc.file="/opt/build/.cargo/registry/src/index.crates.io-6f17d22bba15001f/actix-server-2.2.0/src/worker.rs" loc.line=457 loc.col=25
      at /opt/build/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/util/trace.rs:16
   7: tokio::task::runtime.spawn with kind=local task.name= task.id=12 loc.file="/opt/build/.cargo/registry/src/index.crates.io-6f17d22bba15001f/actix-server-2.2.0/src/worker.rs" loc.line=431 loc.col=21
      at /opt/build/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/util/trace.rs:16
   8: tokio::task::runtime.spawn with kind=local task.name= task.id=11 loc.file="/opt/build/.cargo/registry/src/index.crates.io-6f17d22bba15001f/actix-rt-2.8.0/src/arbiter.rs" loc.line=316 loc.col=25
      at /opt/build/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/util/trace.rs:16
   9: tokio::task::runtime.spawn with kind=block_on task.name= task.id=10 loc.file="/opt/build/.cargo/registry/src/index.crates.io-6f17d22bba15001f/actix-rt-2.8.0/src/arbiter.rs" loc.line=144 loc.col=24
      at /opt/build/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/util/trace.rs:16

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  <empty backtrace>

Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering. http.status_code=500 otel.status_code="ERROR"}: tracing_actix_web::root_span_builder: close time.busy=3.23ms time.idle=95.3ms

@DrMxrcy
Copy link

DrMxrcy commented Jul 10, 2023

Status: file upload fails with error 500 and the following error:

(stacktrace enabled by adding Environment=RUST_BACKTRACE=full in /etc/systemd/system/lemmy-pict-rs.service)

# cat /var/log/lemmy/lemmy-pict-rs.log
2023-06-19T22:16:50.414812Z  INFO actix_server::builder: starting 4 workers
2023-06-19T22:16:50.414842Z  INFO actix_server::server: Actix runtime found; starting in Actix runtime
2023-06-19T22:16:53.532435Z  INFO HTTP request{http.method=POST http.route=/image http.flavor=1.1 http.scheme=http http.host=127.0.0.1:8081 http.client_ip=172.19.112.1 http.user_agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/114.0 http.target=/image otel.name=HTTP POST /image otel.kind="server" request_id=169fc643-1d45-42ba-b5ac-bdf9850db875}: tracing_actix_web::root_span_builder: new
2023-06-19T22:16:53.630965Z  INFO HTTP request{http.method=POST http.route=/image http.flavor=1.1 http.scheme=http http.host=127.0.0.1:8081 http.client_ip=172.19.112.1 http.user_agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/114.0 http.target=/image otel.name=HTTP POST /image otel.kind="server" request_id=169fc643-1d45-42ba-b5ac-bdf9850db875 trace_id=00000000000000000000000000000000 exception.message=Error interacting with filesystem exception.details=
   0: Error interacting with filesystem
   1: No such file or directory (os error 2)

Location:
   /drone/src/src/error.rs:38

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ SPANTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

   0: pict_rs::magick::details_bytes with hint=None
      at src/magick.rs:135
   1: pict_rs::validate::validate_bytes
      at src/validate.rs:38
   2: pict_rs::ingest::ingest with declared_alias=None should_validate=true
      at src/ingest.rs:44
   3: pict_rs::file-upload with filename="ynh_logo_white_300dpi.png"
      at src/lib.rs:154
   4: tracing_actix_web::root_span_builder::HTTP request with http.method=POST http.route=/image http.flavor=1.1 http.scheme=http http.host=127.0.0.1:8081 http.client_ip=172.19.112.1 http.user_agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/114.0 http.target=/image otel.name=HTTP POST /image otel.kind="server" request_id=169fc643-1d45-42ba-b5ac-bdf9850db875 trace_id=00000000000000000000000000000000
      at /opt/build/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tracing-actix-web-0.7.5/src/root_span_builder.rs:41
   5: tokio::task::runtime.spawn with kind=local task.name= task.id=46 loc.file="/opt/build/.cargo/registry/src/index.crates.io-6f17d22bba15001f/actix-server-2.2.0/src/service.rs" loc.line=74 loc.col=17
      at /opt/build/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/util/trace.rs:16
   6: tokio::task::runtime.spawn with kind=local task.name= task.id=16 loc.file="/opt/build/.cargo/registry/src/index.crates.io-6f17d22bba15001f/actix-server-2.2.0/src/worker.rs" loc.line=457 loc.col=25
      at /opt/build/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/util/trace.rs:16
   7: tokio::task::runtime.spawn with kind=local task.name= task.id=12 loc.file="/opt/build/.cargo/registry/src/index.crates.io-6f17d22bba15001f/actix-server-2.2.0/src/worker.rs" loc.line=431 loc.col=21
      at /opt/build/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/util/trace.rs:16
   8: tokio::task::runtime.spawn with kind=local task.name= task.id=11 loc.file="/opt/build/.cargo/registry/src/index.crates.io-6f17d22bba15001f/actix-rt-2.8.0/src/arbiter.rs" loc.line=316 loc.col=25
      at /opt/build/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/util/trace.rs:16
   9: tokio::task::runtime.spawn with kind=block_on task.name= task.id=10 loc.file="/opt/build/.cargo/registry/src/index.crates.io-6f17d22bba15001f/actix-rt-2.8.0/src/arbiter.rs" loc.line=144 loc.col=24
      at /opt/build/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/util/trace.rs:16

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  <empty backtrace>

Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering. http.status_code=500 otel.status_code="ERROR"}: tracing_actix_web::root_span_builder: close time.busy=3.23ms time.idle=95.3ms

Getting the Same Error, Using local and S3 Paths.

@ericgaspar
Copy link
Member

!testme

@yunohost-bot
Copy link
Contributor

🚀
Test Badge

@csolisr
Copy link

csolisr commented Jul 17, 2023

Looks to me like this is missing some configuration files to be properly set - namely, the location of the folder for the uploads. As per the default settings, this defaults to /mnt/files.

@ericgaspar
Copy link
Member

!testme

@yunohost-bot
Copy link
Contributor

May the CI gods be with you!
Test Badge

@csolisr
Copy link

csolisr commented Jul 20, 2023

So! Is it working now with this fix?

Copy link
Member

@yalh76 yalh76 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice work

@DrMxrcy
Copy link

DrMxrcy commented Jul 28, 2023

So! Is it working now with this fix?

Looks like it was approved!

@csolisr
Copy link

csolisr commented Jul 28, 2023

And just in time for the 0.18.3 update I guess! Can somebody merge it please?

@ericgaspar
Copy link
Member

before merging, did someone tested this?

@tituspijean

This comment was marked as outdated.

@tituspijean

This comment was marked as outdated.

@tituspijean
Copy link
Member Author

!testme

@yunohost-bot
Copy link
Contributor

Alrighty!
Test Badge

@tituspijean tituspijean marked this pull request as ready for review July 30, 2023 11:34
@yalh76

This comment was marked as outdated.

@tituspijean
Copy link
Member Author

If it could help ImageMagick was implemented and build in lemmy_ynh and removed at #30

Fixed by unpacking the AppImage :)

Ready to merge!

@yalh76
Copy link
Member

yalh76 commented Aug 9, 2023

!testme
!bookwormtestme

@yunohost-bot
Copy link
Contributor

📚 🪱
Test Badge

@yunohost-bot
Copy link
Contributor

🚀
Test Badge

@tituspijean
Copy link
Member Author

CI test on YunoHost 11 is experiencing the issue mentioned there: #69 (comment)

@D4llo

This comment was marked as duplicate.

@ericgaspar
Copy link
Member

!testme

@yunohost-bot
Copy link
Contributor

Meow 🐈
Test Badge

@Gildas-GH Gildas-GH mentioned this pull request Dec 23, 2023
2 tasks
@ericgaspar ericgaspar merged commit 509b46e into testing Dec 26, 2023
@Salamandar Salamandar deleted the pictrs branch July 14, 2024 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants