Skip to main content

Job system

How does it workโ€‹

The job system gives you information about the long-running jobs, including which job is running, in a queue, how far it progressed and when it started and stopped. Here are the available long-running jobs:

Scan Photosโ€‹

Scan photos will look at all media files in your scan directory and will add them to the library.

A normal scan only reads the files that are new or changed (the file or one of its sidecars) since the last successful scan of the whole scan directory started. A scan that was cancelled or failed before it reached every file does not count, and neither does a scan of a few selected files or a Nextcloud scan. A full scan reads every file again. New in 1.4.0 Up to 1.3.0, any finished scan counted, including cancelled ones and Detect stacks runs, and a file edited while the last scan ran could be skipped. The first normal scan after the upgrade therefore checks every file once.

Generate Event Albumsโ€‹

This job will look at all media files that already exist. It tries to find common events by looking at the timestamp and grouping the images. If the media files are in a 1 day and 12 hour interval, they will appear in the same event album.

Regenerate Event Titlesโ€‹

This will create a title for the event album based on the information of the media files in the event album. Since 1.3.0, titles leave out faces in "Not recognised yet" and no longer contain a double space where a part is missing. Run this job once to fix the titles of albums made by an older version. It also stores what each title is made of, so the web app can show it in your language. New in 1.4.0 Up to 1.3.0, titles were always English.

Find more photos of the people you namedโ€‹

Compares every face without a name with the people you named and with the groups of similar faces, and stores how sure it is. The results are the suggestions on the Faces page. Up to 1.7.0 this job was called Train Faces; the Django admin still calls it that.

Delete Missing Photosโ€‹

Finds all missing media files and removes them from the database.

Scan Missing Photosโ€‹

Goes through every photo in the database and flags the ones whose file can no longer be found on disk. It does not delete anything โ€” use Delete missing photos for that. It runs automatically after a full scan and after any scan of your configured scan directory; it is skipped when you scan a different directory or only a specific list of files, and when the scan had to skip a folder it could not read. It checks every photo before it changes anything. New in 1.4.0 It fails without changing anything when the scan directory looks unmounted or more than the Missing photos limit of your photos would be marked missing. See Missing Photos.

Calculate Clip Embeddingsโ€‹

Calculates the OpenCLIP search embedding of every photo that has none, then rebuilds the similarity index. This is used for semantic search and for finding similar images. Find things stores the embeddings as it tags, so with tagging on this job only fills the gaps. After an upgrade from a release with another model, it re-embeds those photos in place and gives them their tags from the same run.

New in 1.5.0 Uploads start it too: a few minutes after your last upload, LibrePhotos embeds the uploaded photos that have no embedding yet and rebuilds the similarity index, then runs Generate face embeddings for faces without one. A burst of uploads gets one run. Up to 1.4.0, uploaded photos only appeared in semantic search after the next scan or restart. The first start after the upgrade does this once for every user with photos.

Turning semantic search back on in your settings (Photos that only look like what you searched for from None to a number) starts it for your photos too, so search has embeddings to answer from. Changing between two numbers of results starts nothing.

Find Thingsโ€‹

Finds the things in your photos (beach, dog, sunset, ...) with OpenCLIP, for the Things albums and for search. It runs automatically after each scan and covers every photo that has no things yet, including the ones an earlier run did not reach because it was cancelled or failed. New in 1.4.0 Up to 1.3.0, a normal scan only covered photos added since the last run, so photos a cancelled run left behind stayed without things until a full scan.

New in 1.5.0 You can also start it from Account menu > Library, under the Things heading: Find covers the photos without things, and Find things again for all photos (the arrow next to it) labels every photo again with the current list of things, replacing the things it found before. Your own tags and keywords are never changed. See Things Albums. Up to 1.4.0 this job was called Generate Tags.

Add Geolocationโ€‹

Looks up place names for each photo's GPS coordinates (reverse geocoding) so they appear in the places view and location search. It runs automatically after each scan; a normal scan processes photos added since the last successful run started, plus every photo whose position has no place name looked up for it yet (its GPS changed in the file, or an earlier lookup failed; a position where the provider found no place, such as open sea, is not asked again until it changes), while a full scan goes over every photo. A photo whose place was already looked up for its position is skipped either way, so switching the Map provider renames nothing; Look up place names does. It looks up the position LibrePhotos has stored, which the scan keeps in line with the file unless you set the location yourself. A run that was cancelled or failed before it reached every photo does not count as successful.

Scan Facesโ€‹

Looks for faces in your photos and saves them. It runs automatically after each scan and looks at every photo whose faces have not been looked for yet: new photos, photos whose file was replaced, and photos the face recognition service failed on last time, for example because it was restarting or ran out of memory. Each such failure is listed in the job's errors, and the photo is tried again on the next run. A picture the service cannot read at all is listed once and not tried again. When the service cannot be reached for 20 photos in a row, the job stops with the error "Face service unreachable" and the remaining photos wait for the next run. Rescan faces looks at every photo again.

Not released yet (comes after 1.7.0) You can go on using your library while it runs. A photo whose file is replaced, or that you rotate or edit, while its faces are looked for is read again, so faces of the old picture never end up on the new one. If it changes again meanwhile, the next Scan faces takes it. A photo LibrePhotos cannot make a new thumbnail of any more (a damaged file, for example) is read as its last thumbnail shows it.

New in 1.4.0 Up to 1.3.0, a face recognition error counted as "no faces in this photo", the job reported no error, and only Rescan faces found those faces later. If the face recognition service had trouble while your library was scanned, run Rescan faces once after updating.

Generate Face Embeddingsโ€‹

Computes the numeric encoding for faces that have been detected but not yet encoded, so they can be grouped and matched. It runs automatically as part of Scan faces. If no faces are waiting to be encoded it finishes immediately, so you may not always see a row for it.

New in 1.5.1 A face region the face model finds no face in (often one imported from your files) is not a failure: the job counts it as unmatched, keeps it as a person tag without an encoding, and leaves it alone on later runs until the Face recognition model site setting changes or you press Try again on the processing status. Up to 1.5.0 each run asked again and counted every such region as a failed item, so a library with many of them showed the job as failed, and the job list did not say why.

Find Similar Facesโ€‹

Clusters the faces into known and unknown groups.

New in 1.5.0 Uploads start it too, once enough new faces came in: at least 20, and at least 2% of all your faces. So that it does not renumber the unnamed groups while you work through them, it waits until 30 minutes after your last upload and 15 minutes after you last labelled, deleted or restored a face, runs at most once an hour, and waits while a scan, a face scan, Find more photos of these people or an upload of yours is still running. Any run, also one a scan or the Find button started, counts as the last one. Up to 1.4.0, faces of uploaded photos stayed among the unknown faces until you trained by hand.

Download Modelsโ€‹

This downloads the needed machine learning models to data/protected_media/data_models/.

Not released yet (comes after 1.7.0) A model you pick in the site settings while this job runs is always downloaded too, by the same job or by one that starts right after it. Up to 1.7.0, picking another model while the job was already on its last downloads could leave it out until the next scan. When models are missing, a scan starts this job beside it: your photos show up at once, and the tags, faces, text and search jobs of the scan wait for the models. Up to 1.7.0 the scan itself waited. If the download fails, the tags and search jobs end as failed right away instead of trying every photo without their model; the next scan, or Try again on the search page, downloads it again. As soon as the search model is there, however it was downloaded, the tags, search and face jobs that ended without it are queued again by themselves. Jobs that need models wait for the download that is already in the list instead of adding another one. A download that other jobs wait for now shows in the list from the start, and one that a restart cut short starts over. Up to 1.7.0 it stayed in the list as running for a day, and a model picked meanwhile was not downloaded.

Download Selected Photosโ€‹

Packs a download into a ZIP file in the background. It starts when you select photos and choose Download, and the app saves the ZIP file once the job finishes. Not released yet (comes after 1.7.0) One photo with one file needs no job: the app saves the file itself.

Not released yet (comes after 1.7.0) When some files could not be found, the job ends as partly failed. It lists up to 100 of the missing files and counts all of them. When none could be found, the job fails and there is no ZIP file. A drive that is not connected is the usual reason: connect it and download again. Up to 1.7.0, such a job was reported as completed.

Repair File Variantsโ€‹

Runs after each scan to fix RAW files that were scanned as their own photos. For each photo whose main file is a RAW file, it either merges it into the matching image photo (such as a JPEG or HEIC) in the same folder and removes the leftover RAW-only entry, or โ€” if an image file is already attached โ€” promotes that image to be the main file. It does not re-pair Live Photo videos that were scanned separately; those are only paired during a scan. See Stacks & File Variants for more details.

Not released yet (comes after 1.7.0) A RAW-only entry that you put into an album, tagged, rated, edited, shared or commented on, whose category you corrected, that is the cover of an album, an event or a person, or that is in the trash, hidden, archived or public while the image photo is not, stays a photo of its own. Up to 1.7.0 it was merged all the same, and what you had given it was lost.

Import Uploadsโ€‹

New in 1.5.0 Shows the photos and videos you uploaded, from the web app, the mobile app or another client, while LibrePhotos processes them: thumbnails, dates, tags, places and faces. Uploads made close together count in one job, so its progress reads "12 of 40" for all of them. It ends a few minutes after your last upload, once every upload is processed, and then starts the search and face steps described under Calculate CLIP embeddings. A photo whose processing failed is listed in the job with the file name and the step that failed. It runs next to other jobs and never keeps you from starting a scan, and it cannot be cancelled or removed while it runs. Up to 1.4.0, uploads showed no job at all.

Probe Videosโ€‹

Checks the videos that were added to your library before LibrePhotos recorded each video's colour, codec and pixel format during the scan. It runs by itself after a scan, only while such videos are left, so most scans never show it. It rebuilds the thumbnails of every HDR video, which an older version made washed out (see HDR Videos). It does the same for every video not stored as ordinary 8-bit 4:2:0, such as 10-bit clips or the 4:2:2 Motion JPEG files older cameras record, whose animated thumbnails an older version made in a form no browser plays. For each of these videos it also drops any converted copy kept from before, so the next playback converts it again. If a rebuild fails, the old thumbnail is kept. A video whose file cannot be read at the time โ€” for example on a drive that is not mounted โ€” is simply tried again after the next scan. Since 1.3.0.

New in 1.4.0 After an update, an admin can also start it for every user's older videos with Start on the Finish the upgrade card.

Extract Text (OCR)โ€‹

Reads the text on your photos so that search can find it, and uses it to detect documents. It runs only while an administrator has selected a text recognition model: when you click Extract (or Extract text again for all photos) on the Library page, and New in 1.5.0 by itself after a scan or an upload, for the photos still without text. Up to 1.4.0 it never ran by itself. See Text Recognition.

Generate Captionsโ€‹

New in 1.4.0 Started with Generate (or Generate captions again for all photos) under Captions on the Library page. Writes a generated caption for each of your photos that has none, or for every photo again; a caption you wrote yourself is never changed. It never runs by itself after a scan. See Captioning the whole library.

Detect Stacksโ€‹

Groups burst sequences into stacks, using your burst detection rules. It starts when you click Detect stacks on the Organizing โ†’ Stacks page. See Stacks & File Variants. New in 1.4.0 Up to 1.3.0, it was listed as Scan photos.

Detect Duplicate Photosโ€‹

Finds duplicate photos in your library using perceptual hashing. It detects both exact copies (via hash comparison) and visual duplicates (via a two-pass algorithm). Results are shown in the Organizing page, where you can review and manage them; the button that starts this job there is called Detect duplicates. See Duplicate detection for more details.

Remove Photo Details from Thumbnailsโ€‹

Removes the photo's EXIF and XMP (GPS position, camera serial number, keywords) and a video's location from the thumbnails LibrePhotos 1.2.1 and older wrote, across every user's library. An admin starts it with Remove photo details from old thumbnails under Admin area > Admin tools; see After upgrading from 1.2.1 or older. It only rewrites thumbnails that still carry metadata, so running it again is quick and safe. New in 1.4.0 Up to 1.3.0, this was only the strip_thumbnail_metadata command.

Read Shutter Speeds Againโ€‹

New in 1.4.0 Reads the exposure time again for the photos whose shutter speed 1.3.0 or older stored wrongly, across every user's library. It runs by itself once after updating from such a release, and shows on the Finish the upgrade card. Only that one value is read from each photo; nothing is written to your files. See After upgrading from 1.3.0 or older.

Empty Trashโ€‹

New in 1.4.0 Started with the Empty trash button on the Trash page. Permanently deletes every photo in your trash, including the original files on disk. It only touches your own photos, and a photo it cannot delete is skipped and makes the job end as failed. See Emptying the trash.

Apply Date Rulesโ€‹

New in 1.4.0 Started with Apply under Dates on the Library page, or with Apply to existing photos on the date rules card after you saved changed rules. Reads the date of every photo of yours again with your current date rules and moves the photos whose date changed to their new day; a date you set by hand stays, and nothing is written to your files. A photo whose date cannot be read keeps its date and is listed in the job. See Applying the rules.

Write Metadata to Filesโ€‹

New in 1.4.0 Started with Write now under Write edits to files in Settings โ†’ Photos โ†’ Advanced. Writes the edits that are only in LibrePhotos (ratings, dates and locations you set, rotations, captions, tags and face tags) to your sidecars or media files, as that setting says; a photo with nothing to write is left alone. It ends with how many photos it wrote, and lists the photos it could not write. See Writing the edits of a whole library.

Look Up Place Namesโ€‹

New in 1.4.0 Asks the Map provider set in Site settings again for the place of every photo with a location, across every user's library, for example after switching to ExifTool. An admin starts it with Look up place names again under Admin area > Admin tools, after a confirmation. Photos move to the Places albums of their new names, and the day albums name their places again; a photo whose lookup fails keeps its old place. See Switching the provider.

Move Photosโ€‹

New in 1.4.0 Started with Move to folderโ€ฆ for a selection of more than 100 photos. Moves your photos, with all their files, to another folder of your library, one photo after the other; a photo whose name is taken there is renamed or skipped as you chose. A cancel stops after the photo it is on, and the photos moved until then stay moved. It ends with how many photos moved and how many stayed where they were. See Moving photos to another folder.

New in 1.5.0 With Sort into folders by date each photo goes into the folder of its capture date, and photos without a date are counted as staying.

Remove duplicate facesโ€‹

New in 1.5.0 Deletes the faces that were saved twice on the same photo, across every user's library: where two faces of a photo overlap, the one with a name stays (the older one, when both or neither have a name). An admin starts it with Remove duplicate faces under Admin area > Admin tools, after a confirmation; the deleted duplicates do not go to the Deleted tab and cannot be restored. It ends with how many photos it checked and how many faces it deleted. The same work runs from the command line, for every user or one:

docker compose exec backend python manage.py deduplicate_faces
docker compose exec backend python manage.py deduplicate_faces --user anna --chunk-size 200

--chunk-size (default 500) is how many photos are compared at a time. Up to 1.4.0, only the Deduplicate faces action on selected photos in the Django admin did this.

Make Video Postersโ€‹

New in 1.5.0 Gives the videos added before 1.5.0 the still picture the photo grid shows until you point at a video, across every user's library. It runs by itself once after the update and shows on the Finish the upgrade card. Each picture is made from the video's big thumbnail, so it is quick and no video is decoded or changed. A video without a big thumbnail is skipped, and one whose picture cannot be made is listed in the job; both keep playing their clip in the grid as before. See Video previews in the grid.

Check File Contentsโ€‹

New in 1.5.0 Reads every file of every user's library again and compares it with what LibrePhotos has, to find files that were replaced while keeping their old modification date (cp -p, rsync --times, some sync apps), which a scan does not notice. An admin starts it with Check file contents under Admin area > Admin tools, for all users or one user and, optionally, one folder of that user's library; the rehash_files command does the same. A changed file is imported again as a scan would (see Files replaced in place), and the photos holding it are then read again by a scan of their owner's. The job's page shows how many files were read, what became of the changed ones, per user, and the files that could not be read. It reads every byte, so it takes hours on a large library, and other jobs wait until it finishes.

Not released yet (comes after 1.7.0) If a restart cuts this job short, the next scan reads the files it had already found changed. Up to 1.7.0 their photos kept the date, the place and the size of the old picture.

Rename Photosโ€‹

New in 1.5.0 Started with Rename filesโ€ฆ for a selection of more than 100 photos. Gives your photos, with all their files, the name made from their capture date, one photo after the other; a taken name gets (1), (2). A cancel stops after the photo it is on, and the photos renamed until then keep their new names. It ends with how many photos were renamed, how many kept their names, and how many could not be renamed (their files keep their old names). See Renaming photos by their date.

Repair Turned Facesโ€‹

New in 1.5.1 Some apps turn a photo's pixels when they export it but keep the face tags they wrote for the picture before the turn. Up to 1.5.0, LibrePhotos put such a face a quarter turn away from the face: it never got an encoding, and Scan faces found the face again as a second face without a name. This job moves those faces onto the face, across every user's library. An admin starts it from the Finish the upgrade card.

A face is moved only when exactly one of the two quarter turns lands on a face LibrePhotos found on the photo, and that face has no name or the same name. The face then takes that face's place and encoding, and the copy is deleted; it does not go to the Deleted tab. Anything else stays as it is, for example a face found there that you named as someone else. Your files are not changed, and the photo's faces are not looked for again. It ends with how many faces it repaired and how many it left. The same work runs from the command line; --dry-run only counts the faces:

docker compose exec backend python manage.py repair_turned_faces --dry-run
docker compose exec backend python manage.py repair_turned_faces

Where to get information about previous run jobsโ€‹

When you are logged in as an admin, click on the profile picture in the top right corner and then navigate to Admin area. You should see the jobs at the bottom of the page in a table called Worker logs.

Click a row in the Worker logs table to open that job's detail page. It shows the job's ID and status, when it was queued, started and finished, how long it ran, who started it, and the current progress step. If the job failed, an Error details section shows the captured error message and the full result data. The page has the same Cancel (while the job is unfinished) as its row, and a Remove button, which the row offers as Remove entry in its โ‹ฎ menu, with the same confirmation; after Remove it goes back to the list. New in 1.4.0 Up to 1.3.0, the detail page had neither button.

What to do when a job gets stuckโ€‹

LibrePhotos checks every hour for jobs that have made no progress for a day and marks them failed, with the error "Job made no progress for 24 hours"; the job keeps the errors it had recorded. A job that runs for days but keeps making progress, such as the first scan of a large library, is left alone. The threshold is the STUCK_JOB_HOURS variable (see Environment variables). New in 1.4.0 Up to 1.3.0, every job was marked failed 24 hours after it started, even while it was still working.

New in 1.5.0 A job that a running worker is still busy with is left alone too, however long it goes without progress: Find similar faces reports none while it groups the faces of a large library. Up to 1.4.0, such a job could be marked failed while it worked, and still showed as failed after it succeeded.

New in 1.7.0 So is a job whose work still waits in the queue, for example behind another user's scan of a large library: it starts in its turn. Up to 1.6.0, such a job was marked failed after a day of waiting and then did nothing when its turn came.

New in 1.7.0 A job now always runs exactly the photos it counted when it started, and reaches 100 % with the last of them. Photos that need the work only after it started wait for the next run. Up to 1.6.0, a job could stop short of 100 % when another job did some of its photos meanwhile (it then counted as running for a day and held up the next start), or reach 100 % and start its follow-up jobs before all of its photos were done. Work that runs again after a restart is no longer counted twice either.

New in 1.7.0 Some jobs cover the whole server rather than one user's library: Look up place names, Check file contents, Download models and the upgrade tasks (such as Remove photo details from thumbnails). Only one of each runs at a time, whichever admin starts it; a second start answers that the job is already running. A scan does not start while a move or rename of your photos is running, just as a move waits for a scan; a move or rename of a few photos done at once shows in the job list as a short Move photos or Rename photos job for that reason. A job waiting its turn in the queue counts as running however long it waits, so the same job is not started twice meanwhile. Up to 1.6.0, two admins could run the same server-wide job side by side, and a scan could start in the middle of a move.

New in 1.5.0 When LibrePhotos restarts while jobs run (an update, a changed compose file, a reboot, a worker killed for using too much memory), the work the old backend had already taken from the queue runs again about 10 minutes after the restart. A scan interrupted that way still reaches 100 % and starts its follow-up jobs. Up to 1.4.0, that work stayed in the queue for months: the scan stopped just short of 100 %, was marked failed a day later and never started its follow-ups.

If a job is still running and you want to stop it, use the Cancel button in its Worker logs row or on its detail page, or the one under the progress bar in the account menu. A dialog asks first; Keep running leaves the job alone. Cancelling marks the job as cancelled and finished and removes any of its steps that are still waiting in the queue. Jobs check for cancellation as they go and stop at their next checkpoint, so it can take a few seconds before a running job actually stops; photos a scan already took off the queue are skipped. A model download or a download of selected photos still runs to the end. Find similar faces is the one exception while it rebuilds the face clusters: it finishes the rebuild, so you are not left without clusters, but it does not start Find more photos of these people afterwards. Cancelling frees the queue for a new job at once, so you do not need to remove the entry afterwards. New in 1.4.0 Up to 1.3.0, a cancelled scan kept importing the photos it had queued, and duplicate and stack detection, face training, search embeddings, file variant repair and event albums ran to the end. The next scan picks up what a cancelled or failed scan, tagging, geolocation or face scan left behind.

The Remove button (or Remove entry in a row's โ‹ฎ menu) only deletes the log entry from the database โ€” it does not stop a running job. Use it for a job that has genuinely crashed (nothing is progressing and the logs show an ungraceful failure) so that the queue will accept new jobs again.

Removing a finished job deletes its record and result; nothing in your library changes. Two runs are different, because a later run starts from them:

  • The newest scan of the whole scan directory that reached every file is the reference for the next normal scan, which only rereads the files changed since then (see Scan photos). Without it, the next normal scan reads every file of your library again, as a full scan does. So its Remove and Remove entry are greyed out, and pointing at it says "This scan is the reference for the next incremental scan"; LibrePhotos refuses to remove it in any other way too, also for an admin. It can be removed once a newer scan of the whole library has finished. A cancelled scan, a scan of a few selected files or a Nextcloud scan does not replace it. This scan is kept by the automatic cleanup of old jobs as well.
  • The newest complete Add geolocation run: the next one looks up the photos added since it started. Remove it and the next run looks up the places of every photo added since the run before it, or of all your photos if none is left. The confirmation dialog warns about it.

New in 1.6.0 To clear a long list at once, open Account menu > My jobs and click Remove finished jobs. A dialog says how many jobs go. It removes the records of your finished jobs, whether they completed, failed or were cancelled. It keeps a job that is still running or queued, the scan the next normal scan is measured against, and every Add geolocation run that went through all its photos, so nothing in your library changes and the next scans work as before. The button is greyed out, with the reason, when there is nothing to remove. It is not on the Worker logs table of the Admin area, which lists every user's jobs; remove those one at a time. Up to 1.5.1, My jobs could only remove one job per click.

New in 1.4.0 Up to 1.3.0, the reference scan could be removed, and the next scan then read the whole library again. The confirmation dialog could not tell which scan was the reference, and it also warned about Scan faces, which picks the photos whose faces have not been looked for whatever ran before.

New in 1.4.0 Up to 1.3.0, Cancel and Remove acted on the first click, without asking.