Jump to content

Immich docker self-hosted google photos setup


Recommended Posts

Hello, I'm using Immich and PostgreSQL_Immich, but I have this error into the postgresql docker when I open immich apps or website 

ERROR:  could not resize shared memory segment "/PostgreSQL.4195037598" to 907743232 bytes: No space left on device

 

I don't know why all my disk are not full

Edited by thomas.mantot
Link to comment
On 3/9/2024 at 1:37 PM, Mattaton said:

Anyone been successful getting Fail2Ban setup with Immich?

had you been able to figure this out ?    I found a thread that outlines a way to configure fail 2 ban but  not sure how to get the logs  https://github.com/immich-app/immich/discussions/3243

Link to comment

Does someone successfully configure Crowdsec with SWAG and Immich ? 

Crowdsec ban me when I access Immich

Solved : 

 

I have added whitelist : 

name: crowdsecurity/immich-whitelists
description: "Whitelist des faux positifs d'Immich-api"
filter: "evt.Meta.service == 'http' && evt.Meta.log_type in ['http_access-log', 'http_error-log']"
whitelist:
  reason: "Faux positifs d'Immich-api"
  expression:
    - evt.Meta.http_verb == 'POST' && evt.Meta.http_status == '403' && evt.Parsed.request contains '/asset/upload'
    - evt.Meta.http_verb == 'GET' && evt.Meta.http_status == '429' && evt.Parsed.request contains '/api/asset/thumbnail/'
    - evt.Meta.http_verb == 'GET' && evt.Meta.http_status == '200' && evt.Parsed.request contains '/api/asset/thumbnail/'
    - evt.Meta.http_verb == 'GET' && evt.Meta.http_status == '304' && evt.Parsed.request contains '/api/asset/thumbnail/'

 

Edited by thomas.mantot
Link to comment
On 4/13/2024 at 12:27 AM, Aceriz said:

had you been able to figure this out ?    I found a thread that outlines a way to configure fail 2 ban but  not sure how to get the logs  https://github.com/immich-app/immich/discussions/3243

No. I let it go. Probably overkill anyway. But thanks!

Edited by Mattaton
Link to comment
3 hours ago, thomas.mantot said:

Does someone successfully configure Crowdsec with SWAG and Immich ? 

Crowdsec ban me when I access Immich

Solved : 

 

I have added whitelist : 

name: crowdsecurity/immich-whitelists
description: "Whitelist des faux positifs d'Immich-api"
filter: "evt.Meta.service == 'http' && evt.Meta.log_type in ['http_access-log', 'http_error-log']"
whitelist:
  reason: "Faux positifs d'Immich-api"
  expression:
    - evt.Meta.http_verb == 'POST' && evt.Meta.http_status == '403' && evt.Parsed.request contains '/asset/upload'
    - evt.Meta.http_verb == 'GET' && evt.Meta.http_status == '429' && evt.Parsed.request contains '/api/asset/thumbnail/'
    - evt.Meta.http_verb == 'GET' && evt.Meta.http_status == '200' && evt.Parsed.request contains '/api/asset/thumbnail/'
    - evt.Meta.http_verb == 'GET' && evt.Meta.http_status == '304' && evt.Parsed.request contains '/api/asset/thumbnail/'

 

I recently disabled Crowdsec for completely unrelated reasons, but up until then I had SWAG, Crowdsec, and Immich working together just fine. Never got banned.
I see you have it solved though. Sweet! 🙂 

Link to comment
1 hour ago, thomas.mantot said:

Hi again,

I cannot delete picture using immich web page, when I delete I have a message information : Trashed 0 assets.

and using android app : impossible to delete, read only file.

 

 

What I need to do ?

You’re probably using an external library which are only read-only (you can’t trash or delete assets)

Link to comment
23 hours ago, martabal said:

You’re probably using an external library which are only read-only (you can’t trash or delete assets)

yes right, I only use immish as a "big library browser", all my image are stored on my unraid and uploaded using owncloud.

So it is not possible to delete image using external library ?

Link to comment
  • 2 weeks later...
On 4/16/2024 at 10:40 AM, martabal said:

You’re probably using an external library which are only read-only (you can’t trash or delete assets)

I have the same problem, but I'd like to do that so if I'm using an external library, how to use an internal one?


I've got a pretty big library, over 150K pictures and around 10k videos, 1.5TB in size overall. As you can see on the container configuration, i've got
/photos -> /mnt/cache/immich-previews  (internal library, I guess, but this is 195GB in size and is full of thumbnails)
/import -> /mnt/user/fotos (external library with my folder organization untouched, I do create forlders as albums there from my own sanity as I sync/uploads pictures and videos to manage them).

Is this somekind of permissions problem? A 'ls -la' shows as follows on these directories:

drwxr-xr-x 7206 javipas  users 7208 May  2 08:30 fotos/
drwxrwxrwx    6 nobody users    6 Feb 10 09:08 immich-previews/

Thanks!

Captura de pantalla 2024-05-07 a las 12.42.27.jpg

Link to comment

Hello People

 

I have a problem with immich..

My docker container called PostgreSQL_Immich, will not start, i think it could be because of an update. But im not sure:(

Anyone with an idea for what it could be??,, Is it possible to downgrade both containers??

 

This is my error:

find: ‘/var/lib/postgresql/data/global’: Structure needs cleaning
find: ‘/var/lib/postgresql/data/global’: Structure needs cleaning
find: ‘/var/lib/postgresql/data/global’: Structure needs cleaning
find: ‘/var/lib/postgresql/data/global’: Structure needs cleaning
find: ‘/var/lib/postgresql/data/global’: Structure needs cleaning
find: ‘/var/lib/postgresql/data/global’: Structure needs cleaning
find: ‘/var/lib/postgresql/data/global’: Structure needs cleaning
find: ‘/var/lib/postgresql/data/global’: Structure needs cleaning
find: ‘/var/lib/postgresql/data/global’: Structure needs cleaning
find: ‘/var/lib/postgresql/data/global’: Structure needs cleaning

 

Thank you very much..

regards..

Link to comment
Posted (edited)
13 hours ago, rutherford said:

@srepper looks like permissions problems. Have you googled around for Immich permission problems? Have you restarted the docker?

Edit:
Found the issue: I used my USB drive. I can create and do stuff with it but not my docker.

Thanks !


Thanks for response. I google arround immich permission problems, but didn't find any solutions.

I restart it oftern, but same issue..

 

grafik.thumb.png.fbbaa42abf95706fd3a425f45a7afdb8.png

 

grafik.thumb.png.4eec1dacd2a888fdd18a5a0ee1e3f25f.png

 

 

grafik.thumb.png.cc41cfc21f6b4f3a83e67f00a72009c9.png

 

 

maybe because my usb drive is my storage?

Edited by srepper
Link to comment
Posted (edited)

Here's a thread about docker permission issues:

 

Under your Immich Settings, hit Advanced, make sure those permissions down there are correct, like these in mine below.

 

 

 

 

image.thumb.png.6a3075eb4ec8902aae8ccc5530da4a2b.png

 

I also saw a crossed out thing about your storage being somewhere else instead of a normal data disk in unRaid?

 

Also check Common Settings under Settings for Unassigned Devices

image.thumb.png.c8bff57e4fb5292e6b23bd3d40722cbe.png

 

 

I seem to remember changing something in here a while back... Maybe that Destructive Mode thing? I don't exactly recall.

 

Also the Main > unassigned devices > Settings gear on the drive you're mounting

image.thumb.png.0aee2cba2559df62f6222a3daac3646e.png

 

 

Hopefully this will get you somewhere!

 

Looking over some other messages you have: looks like you probably linked the USB (?) folder via the Docker Settings for Immich. Make sure you got that right too. Let see if I have that somewhere...

 

I also have a Syncthing going, and it IS writing to an external USB drive. Here are the settings for adding that drive into the docker settings for Syncthing, your addition to Immich, to ahve access to that USB drive would be the same:

image.png.cf67afa5f4bac6c361cccf172eae80a3.png

 

 

Another thing you can try out:

Dashboard > Immich (icon) > "Console >_".

That will drop you into the environment the Immich docker lives. You can CLI (command line interface) your way around in there. Try heading over to:

/photos, and creating a file there:

root@0a4265eaedab:/# cd photos/
root@0a4265eaedab:/photos# ls
encoded-video  library  profile  thumbs  upload
root@0a4265eaedab:/photos# touch test.txt
root@0a4265eaedab:/photos# ls -la
total 0
drwxrwxrwx 1 abc  users 110 May 13 18:21 .
drwxr-xr-x 1 root root  322 Apr 30 21:20 ..
drwxr-xr-x 1 abc  users  58 Oct 23  2023 encoded-video
drwxr-xr-x 1 abc  users  58 Oct 23  2023 library
drwxr-xr-x 1 abc  users  58 Oct  7  2023 profile
-rw-r--r-- 1 root root    0 May 13 18:21 test.txt
drwxr-xr-x 1 abc  users  58 Oct 23  2023 thumbs
drwxr-xr-x 1 abc  users  58 Oct 25  2023 upload
root@0a4265eaedab:/photos# 

 

That should work, and if it doesn't, then you're getting closer to the problem.

 

Edited by rutherford
Link to comment

I suffered a disk error on an Unraid install which had Immich on it and now that container won't run. Fortunately I was able to copy all of the files off though, so now I'm trying to import them elsewhere. It looked like it was working until it got to the "uploading assets" step and failed - any idea what I'm missing? Here's a screenshot of the error:

 

image.thumb.png.ab0be3109aa2aeaf562e50273dc5bd4a.png

Link to comment

@mbc0 so 2.7TB, does that seem right to you? Do you have anything that’s 2.7TB? I suspect your file paths are incorrect in the docker, then the Immich settings. 
 

revisit the setup instructions, pay close attending to Docker Settings > paths

 

then also, once you get that Immich docker going, where those paths are pointing. 

Link to comment

Hi, I have just walked through the installation video made by spaceinvader one and the only thing different I did was use a sub-folder instead of a dedicated share which has done the trick, thank you 🙂

 

  • Upvote 1
Link to comment

I'm trying to connect Immich to Crowdsec however I'm missing the immich_server.log from /mnt/user/appdata/immich/. It does appear to be in /mnt/user/system/docker/docker/containers/containerid/ though with the name containerid-json.log.

 

I assume something is not right there? Any ideas how can I get it show in appdata/immich?

 

 

Link to comment

Okay, so I've re-read the Crowdsec docs a bit more carefully and Crowdsec can actually parse the logs directly from docker so a log file isn't necessary. I haven't actually go this to work yet but it seems it should. I will raise it as a question to the Crowdsec folks.

 

Edit:

In case anyone else needs this for Immich or any other docker logs a quick write up follows.
Pr-requisites:
  - the dockersocket app from CA to proxy the docker socket
  - a custom docker network that dockersocket and Crowdsec are on. Possibly Immich too as that is where I have it.
  - Immich collection installed on Crowdsec

 

To enable Crowdsec to read from dockersocket you need to add the variable `INFO: 1` to the dockersocket container. Source.

 

In your Crowdsec aquis.yaml add:

 

source: docker
container_name:
  - immich
labels:
  type: immich
docker_host: tcp://dockersocket:2375

Source.

 

You will also need to whitelist some of the api calls. Create a new yaml file in /crowdsec/parsers/s02-enrich/

name: crowdsecurity/immich-whitelists
description: "Whitelist false positive from Immich-api"
filter: "evt.Meta.service == 'http' && evt.Meta.log_type in ['http_access-log', 'http_error-log']"
whitelist:
  reason: "Whitelist false positive from Immich-api"
  expression:
   - evt.Parsed.traefik_router_name == 'immich@docker' && evt.Meta.http_verb == 'POST' && evt.Meta.http_status == '403' && evt.Parsed.request contains '/asset/upload'
   - evt.Parsed.traefik_router_name == 'immich@docker' && evt.Meta.http_verb == 'GET' && evt.Meta.http_status == '429' && evt.Parsed.request contains '/api/asset/thumbnail/'
   - evt.Parsed.traefik_router_name == 'immich@docker' && evt.Meta.http_verb == 'GET' && evt.Meta.http_status == '200' && evt.Parsed.request contains '/api/asset/thumbnail/'
   - evt.Parsed.traefik_router_name == 'immich@docker' && evt.Meta.http_verb == 'GET' && evt.Meta.http_status == '304' && evt.Parsed.request contains '/api/asset/thumbnail/'

Source.

 

Restart Crowdsec and Immich logs should be being parsed with no bans from using the mobile app.

Edited by tictoc
Updated information.
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...