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]: UI Markdown Renderer not using presign URL to get images #6412

Closed
Isan-Rivkin opened this issue Aug 15, 2023 · 2 comments · Fixed by #7745
Closed

[Bug]: UI Markdown Renderer not using presign URL to get images #6412

Isan-Rivkin opened this issue Aug 15, 2023 · 2 comments · Fixed by #7745
Assignees
Labels
bug Something isn't working no stale Using this label will prevent items from being marked as stale presign-minimal-permissions

Comments

@Isan-Rivkin
Copy link
Contributor

What happened?

What

When rendering Markdown files, the UI loads images.
The problem is that when getting those images from lakeFS the UI ignores presign config (i.e sample repository, sample data in a custom repository or just any custom Markdown that fetches files from lakefs://).

Why

Those images are rendered in CustomMarkdownRenderer component which in turns uses imageUriReplacer to fetch the images to load. The request to download the image doesn't use presign hence downloading directly from lakeFS server.

Impact

Besides the unexpected behavior and the extra work lakeFS server does + extra cost it's breaking in case the storage credentials (S3,GCS,AZ) does not allow lakeFS server directly to get objects then the Markdown rendering breaks.

Steps to Reproduce:

  1. Setup lakeFS server with S3 and all the IAM permissions for using pre-sign from lakeFS
  2. Configure the UI to use presign:
blockstore:
  type: s3
  s3:
    disable_pre_signed_ui: false
    disable_pre_signed: false
  1. Create a repository > Select Add sample data, hooks, and configuration
  2. In the browser network tab see many GET requests for resources that does not specify presign: true. (i.e /api/v1/repositories/first1/refs/main/objects?path=images%2Fcreate-lakefs-branch.png)

image

Screen Shot 2023-08-15 at 16 18 20

Expected behavior

  • Markdown renderer in the UI to include presign flag and respect it when downloading images.
  • The Markdown to render correctly even if lakeFS is not allowed to do Get directly.

lakeFS version

v0.105.0

How lakeFS is installed

locally

Affected clients

ui

Relevant log output

level=error msg="failed to get S3 object bucket my-bucket/remote/first1 key data/1234567/11122324123" func="pkg/logging.(*logrusEntryWrapper).Errorf" file="build/pkg/logging/logger.go:285" error="AccessDenied: Access Denied\n\tstatus code: 403, request id: 123, host id: ..." host=lakefs-presign.us-east-1.lakefscloud.ninja method=GET operation=GetObject operation_id=GetObject path="/api/v1/repositories/first1/refs/main/objects?path=images%2Fhooks-07.png" request_id=... service_name=rest_api user=admin

Contact details

No response

Copy link

This issue is now marked as stale after 90 days of inactivity, and will be closed soon. To keep it, mark it with the "no stale" label.

@github-actions github-actions bot added the stale label Nov 22, 2023
Copy link

Closing this issue because it has been stale for 7 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 30, 2023
@Isan-Rivkin Isan-Rivkin added no stale Using this label will prevent items from being marked as stale and removed stale labels Apr 16, 2024
@Isan-Rivkin Isan-Rivkin reopened this Apr 16, 2024
@eladlachmi eladlachmi self-assigned this May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working no stale Using this label will prevent items from being marked as stale presign-minimal-permissions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants