#Severely messed up import of external library. Can I delete manually with sql?

1 messages · Page 1 of 1 (latest)

obtuse crystal
#

I started to import and external library and something went horribly wrong. It has about 30k images but, somehow, when i checked on it, it had queued up about 6 million to import and had successfully processed 1 million. Been using Immich for over a year, so I'm not a newbie, but I messed up bad.

My main question is, I've connected to postgres with dbeaver, can I just run something like delete from public.assets where "createdAt" > '2024-09-13 13:14:36.689 -0600'; or delete from public.assets where "originalPath" like '%my_external_library_path%. I'm fine deleting those assets, I just want to make sure the delete will cascade properly and not mess anything up. I ran it as a select and it works to grab the desired assets and nothing I don't want.

  • I'm on 1.115.0
  • I removed the path to the external library in the docker-compose and tried remove offline files, but it seemingly did nothing. No resource spike on the server to show that anything was actually processing.
  • I'm accessing directly via local IP, not over proxy. The container has 80gb of ram free and plenty of CPU on a 3900x. The postgres container occasionally uses a fair amount cpu, but has tons of available resources.
  • Repair is not in the sidebar but if I navigate to admin/repair it just shows a spinning immich logo. The console eventually shows an out of memory error.
dusky roostBOT
#

:wave: Hey @obtuse crystal,

Thanks for reaching out to us. Please follow the recommended actions below; this will help us be more effective in our support effort and leave more time for building Immich immich.

References

Checklist

  1. :ballot_box_with_check: I have verified I'm on the latest release(note that mobile app releases may take some time).
  2. :ballot_box_with_check: I have read applicable release notes.
  3. :ballot_box_with_check: I have reviewed the FAQs for known issues.
  4. :ballot_box_with_check: I have reviewed Github for known issues.
  5. :ballot_box_with_check: I have tried accessing Immich via local ip (without a custom reverse proxy).
  6. :ballot_box_with_check: I have uploaded the relevant logs, docker compose, and .env files, making sure to use code formatting.
  7. :ballot_box_with_check: I have tried an incognito window, disabled extensions, cleared mobile app cache, logged out and back in, different browsers, etc. as applicable

(an item can be marked as "complete" by reacting with the appropriate number)

If this ticket can be closed you can use the /close command, and re-open it later if needed.

dusky roostBOT
obtuse crystal
#

I couldn't really pull any logs because it's still constantly generating successfully generated JPEG for preview image 'external asset image guid

ivory meteor
#

well shut it down already 😛

round oxide
#

You can’t do what you describe, there are other references in the DB that will break

ivory meteor
#

You've somehow managed to mount an external library inside the regular one

#

Work on removing that mount first, then perhaps get a list of all created assets from that date with the DB. Then write a script to call the API to remove those

round oxide
#

Do you have a backup or is reinstalling Immich an option?

obtuse crystal
#

So it has a circular reference or something?

services:
  immich-server:
    image: ghcr.io/immich-app/immich-server:release
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /mnt/user/Pictures:/usr/src/app/existing_pictures

here is my import. I set this up before you had external libraries, but it messed up some of the dates on import, so I got the bright idea of just setting it up as an external library. I usually grab a dump of the db first, but for some reason I chose not to this time 🤦‍♂️

#

and yea, reinstalling wouldnt' be that big of a deal, but I was hoping it'd be stupid simple like running that delete 😉

the api script seems like it should be doable too since they were all after a certain date.

ivory meteor
#

It is not immediately apparent to me where the circle is, but I would personally never mount anything in /usr/src/app that is not the default

#

What is the ${UPLOAD_LOCATION} ?

obtuse crystal
#

Well shit. that'd do it.

/mnt/user/Pictures/Immich/

#

Thanks for your help! Can't believe I didn't spot that before I imported.