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] Paths for file uploads are hard coded #3510

Open
graipher opened this issue Nov 14, 2024 · 1 comment
Open

[BUG] Paths for file uploads are hard coded #3510

graipher opened this issue Nov 14, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@graipher
Copy link

graipher commented Nov 14, 2024

Describe the bug
Flowise uses a hard coded folder path for some file uploads. This breaks on read-only file systems and cannot be configured.

To Reproduce
Steps to reproduce the behavior:

  1. Try to run flowise in a read-only file system
  2. See error
Error: EROFS: read-only file system, mkdir
'/usr/local/lib/node_modules/flowise/uploads'
Code: EROFS

Expected behavior
File uploads should respect the storage settings passed in via env variables (ie either BLOB_STORAGE_PATH if using local storage or the S3_* variables).

Setup

  • kubernetes (official docker image), read-only file system, S3 storage, Postgres DB
  • Flowise Version 2.1.3
  • OS: Linux

Additional context
Hardcoded paths are here:

And multer will try to create the destination directory if passed as a string and if it does not exist:

Note: You are responsible for creating the directory when providing destination as a function. When passing a string, multer will make sure that the directory is created for you.
https://www.npmjs.com/package/multer#diskstorage

There seems to already be some functionality for getting the right paths elsewhere:

const getPathForUploads = async (req: Request, res: Response, next: NextFunction) => {

@HenryHengZJ
Copy link
Contributor

Yep, I think we should definitely change the hard coded multer path to either whatever env variables that was set, if not, default to the hard coded path

@HenryHengZJ HenryHengZJ added the enhancement New feature or request label Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants