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

can't backup #18

Closed
ippocratis opened this issue Feb 10, 2022 · 13 comments
Closed

can't backup #18

ippocratis opened this issue Feb 10, 2022 · 13 comments

Comments

@ippocratis
Copy link

proxy_nginx      | 192.168.1.7 - - [10/Feb/2022:13:05:52 +0000] "GET /server-info HTTP/1.1" 200 172 "-" "Dart/2.16 (dart:io)" "-"
proxy_nginx      | 192.168.1.7 - - [10/Feb/2022:13:05:54 +0000] "GET /asset/825a5b4cc4e8809d HTTP/1.1" 200 2 "-" "Dart/2.16 (dart:io)" "-"
proxy_nginx      | 2022/02/10 13:05:54 [warn] 23#23: *5 a client request body is buffered to a temporary file /var/cache/nginx/client_temp/0000000001, client: 192.168.1.7, server: , request: "POST /asset/upload HTTP/1.1", host: "192.168.1.24:2283"
immich_server    | Error: EACCES: permission denied, mkdir './upload/d718b7a8-1b85-4604-ac76-a374f8447dd9/original/825a5b4cc4e8809d'
immich_server    |     at mkdirSync (node:fs:1336:3)
immich_server    |     at DiskStorage.destination [as getDestination] (/usr/src/app/src/config/multer-option.config.ts:28:18)
immich_server    |     at DiskStorage._handleFile (/usr/src/app/node_modules/multer/storage/disk.js:31:8)
immich_server    |     at /usr/src/app/node_modules/multer/lib/make-middleware.js:145:17
immich_server    |     at fileFilter (/usr/src/app/src/config/multer-option.config.ts:15:7)
immich_server    |     at wrappedFileFilter (/usr/src/app/node_modules/multer/index.js:44:7)
immich_server    |     at Busboy.<anonymous> (/usr/src/app/node_modules/multer/lib/make-middleware.js:115:7)
immich_server    |     at Busboy.emit (node:events:520:28)
immich_server    |     at Busboy.emit (/usr/src/app/node_modules/busboy/lib/main.js:38:33)
immich_server    |     at PartStream.<anonymous> (/usr/src/app/node_modules/busboy/lib/types/multipart.js:213:13)
proxy_nginx      | 2022/02/10 13:05:55 [error] 23#23: *5 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 192.168.1.7, server: , request: "POST /asset/upload HTTP/1.1", upstream: "http://xxx.xx.x.x:3000/asset/upload", host: "192.168.1.24:2283"
proxy_nginx      | 192.168.1.7 - - [10/Feb/2022:13:05:55 +0000] "POST /asset/upload HTTP/1.1" 502 157 "-" "-" "-"

i chmod -R 755 ~/immich/sever/upload

proxy_nginx      | 2022/02/10 13:14:36 [error] 22#22: *25 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 192.168.1.7, server: , request: "POST /asset/upload HTTP/1.1", upstream: "http://xxx.xx.x.x:3000/asset/upload", host: "192.168.1.24:2283"
proxy_nginx      | 192.168.1.7 - - [10/Feb/2022:13:14:36 +0000] "POST /asset/upload HTTP/1.1" 502 157 "-" "-" "-"
@alextran1502
Copy link
Contributor

This is from a RaspberryPi 400, correct? In the Nginx message, did you masked the server address as xxx.xx.x.x?

@alextran1502
Copy link
Contributor

Can you try

'sudo chown -R yourusername:yourusername ~/immich/server/upload'

@ippocratis
Copy link
Author

This is from a RaspberryPi 400, correct? In the Nginx message, did you masked the server address as xxx.xx.x.x?

from the raspberry pi400 yes
i just replaced the actual adress with xxx for this post

@alextran1502
Copy link
Contributor

alextran1502 commented Feb 10, 2022

@ippocratis Can you try

sudo chown -R yourusername:yourusername ~/immich/server/upload

I remember having this issue once out of nowhere and that is how I fixed it.

Just curious, shouldn't the server in the container has an IP address of http://immich_server:3000

@ippocratis
Copy link
Author

ippocratis commented Feb 10, 2022

@ippocratis Can you try

sudo chown -R yourusername:yourusername ~/immich/server/upload

I remember having this issue once out of nowhere and that is how I fixed it.

Just curious, shouldn't the server in the container has an IP address of http://immich_server:3000

i have no idea whats goin on
looks like there is some progess after chmod and chown
the Error: EACCES: permission denied not poping up
when i hit backup in the app the asset that where being backup says a percentage e.g. 2% but stuck there
in the terminal i see no new logs
and in the immich/server/upload folder there are no new files

for the ```http://immich_server:3000`` part i left the 3000 port unchanged in the docker-compose.yml if i understand correctly what you mean

if i try to reach the adress in a browser it says site cant be reached
and the 192.168.1.24:2283 brings the nginx start page
docker ps gives

CONTAINER ID   IMAGE                                        COMMAND                  CREATED       STATUS          PORTS                                                                            NAMES
a32ea9658ca8   postgres:14                                  "docker-entrypoint.s…"   4 hours ago   Up 10 seconds   0.0.0.0:5432->5432/tcp, :::5432->5432/tcp                                        immich_postgres
f1d186fe1b3e   nginx:latest                                 "/docker-entrypoint.…"   5 hours ago   Up 6 seconds    0.0.0.0:2283->80/tcp, :::2283->80/tcp, 0.0.0.0:2284->443/tcp, :::2284->443/tcp   proxy_nginx
f7f1cf7297f4   immich-server-dev:1.0.0                      "docker-entrypoint.s…"   5 hours ago   Up 8 seconds    0.0.0.0:3000->3000/tcp, :::3000->3000/tcp                                        immich_server
eeba63503bec   redis:6.2                                    "docker-entrypoint.s…"   7 hours ago   Up 10 seconds   6379/tcp                                                                         immich_redis

@alextran1502
Copy link
Contributor

alextran1502 commented Feb 10, 2022

The file won't be copied to your local immich/server/upload. You can see it in the container shell or in the /var/lib/docker/volumes/ where it is mounted.

Did you build the mobile app directly or use the APK? If you use the APK, please try a different APK here.
https://github.com/alextran1502/immich/suites/5244393557/artifacts/161419112

From the root of the directory immich can you run make dev-update?

@ippocratis
Copy link
Author

ippocratis commented Feb 10, 2022

updated with make dev-update
and installed the new apk (was also used the apk from releases)
the Error: EACCES: permission denied, mkdir './upload/d718b7a8-1b85-4604-ac76-a374f8447dd9/original/ab6cce39a6ba6f19' persists
tried to chown the server volume in /var/lib/docker/volumes/
grabed the volumes with sudo docker volume ls
and
docker ps -a --filter volume=4312735d2c0df8692a1e359af4d7dcdb01db59a09b3b3077ecbc0840b3d4619b
then
sudo chown -R ippo:ippo /var/lib/docker/volumes/4312735d2c0df8692a1e359af4d7dcdb01db59a09b3b3077ecbc0840b3d4619b

the progress i thought earlier was probably a misunderstanding from my side , my bad

most likely i messed something up
gona try everything from scratch later

thanks...

@alextran1502
Copy link
Contributor

No worry, I think you are very close. Unfortunately, I don't have the pi400 to try this on, otherwise, I can help you with better information.

Let me know how it goes!

@ippocratis
Copy link
Author

ippocratis commented Feb 11, 2022

i tried to build with
COPY --chown=node:node in the copy commands
acording to this
also tried with
RUN npm install --unsafe-perm=true
acording to this
still Error: EACCES: permission denied

@alextran1502
Copy link
Contributor

Can you clone the repo to the new location, in server folder you create the upload directory first. Then you run the docker compose up command?

@alextran1502
Copy link
Contributor

@ippocratis I want to let you know that I can replicate your problem and is working on the fix.

@alextran1502
Copy link
Contributor

alextran1502 commented Feb 12, 2022

@ippocratis I updated the docker-compose file. I was always running my development environment as root so I didn't encounter the problem when using volume mount (docker managed directory), once I switch to a non-root user, then I have that issue. The solution I came up with is to use bind mount (mount directly to a directory on your file system) and let the user specify where they want to store all of the access on their local machine in the UPLOAD_LOCATION key in .env file.

Let's say you create a directory ~/my-immich-asset then you would put home/your-user-name/my-immich-asset to UPLOAD_LOCATION. This will help with the access permission. Let me know if you can get it working!

@ippocratis
Copy link
Author

yep working fine now
you are a hero
thanks

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

No branches or pull requests

2 participants