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

Upload fails when utime is not available #14005

Closed
1 of 3 tasks
denysvitali opened this issue Nov 8, 2024 · 3 comments
Closed
1 of 3 tasks

Upload fails when utime is not available #14005

denysvitali opened this issue Nov 8, 2024 · 3 comments

Comments

@denysvitali
Copy link

denysvitali commented Nov 8, 2024

The bug

It looks like Immich tries to set the utime of the uploaded files, but certain storage implementations such as geesefs do not allow this.

To properly fix the issue, I think it would be convenient to allow users to disable / mock utime when a specific environment variable is specified.

utimes(filepath: string, atime: Date, mtime: Date) {
return fs.utimes(filepath, atime, mtime);
}

Error: EPERM: operation not permitted, utime 'upload/upload/e9209f4c-7ad4-437d-a
f25-1c059623c8e1/24/cd/24cd5cc9-a7db-4d4d-86d5-d7d4675f69df.jpeg'
    at async Object.utimes (node:internal/fs/promises:1128:10)
    at async AssetMediaService.create (/usr/src/app/dist/services/asset-media.se
rvice.js:273:9)
    at async AssetMediaService.uploadAsset (/usr/src/app/dist/services/asset-med
ia.service.js:96:27)
    at async AssetMediaController.uploadAsset (/usr/src/app/dist/controllers/ass
et-media.controller.js:40:29)

The OS that Immich Server is running on

Alpine

Version of Immich Server

v1.120.1

Version of Immich Mobile App

N/A

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

N/A

Your .env content

N/A

Reproduction steps

  1. Use geesefs (or any non-POSIX compliant FS) and mount an S3 bucket to the uploads directory
  2. Try to upload a file

Relevant log output

Error: EPERM: operation not permitted, utime 'upload/upload/e9209f4c-7ad4-437d-a
    at async Object.utimes (node:internal/fs/promises:1128:10)
    at async AssetMediaService.create (/usr/src/app/dist/services/asset-media.se
    at async AssetMediaService.uploadAsset (/usr/src/app/dist/services/asset-med
    at async AssetMediaController.uploadAsset (/usr/src/app/dist/controllers/ass

Additional information

No response

@bo0tzz
Copy link
Member

bo0tzz commented Nov 8, 2024

I'm not sure whether we want to support filesystems that aren't POSIX-compliant, that comes with all sorts of issues.

@denysvitali
Copy link
Author

They can be feature-flagged. I've made a small patch on that method that checks an environment variable - and when that's set, it skips the call.

I'm fine with not having support out-of-the-box, but I think there should be an option somewhere, ideally an environment variable, that allows to skip at least utime

@etnoy
Copy link
Contributor

etnoy commented Nov 12, 2024

We have discussed this internally and decided on not opening up support for non-posix filesystems.

@etnoy etnoy closed this as completed Nov 12, 2024
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 a pull request may close this issue.

3 participants