Skip to content

fix(server): avoid false restore failures on large database imports#27420

Merged
jrasm91 merged 4 commits intoimmich-app:mainfrom
ErasmusAndre:main
Apr 8, 2026
Merged

fix(server): avoid false restore failures on large database imports#27420
jrasm91 merged 4 commits intoimmich-app:mainfrom
ErasmusAndre:main

Conversation

@ErasmusAndre
Copy link
Copy Markdown
Contributor

@ErasmusAndre ErasmusAndre commented Mar 31, 2026

Description

I ran into an issue while migrating an Immich database backup where the database import completed, but the post-restore health check timed out, the restore flow rolled the database back, and the frontend showed null instead of a useful error message.

These changes increase the maintenance restore API health check timeout from 20 seconds to 180 seconds, and reject health check failures as Error objects instead of raw strings.

In practice, 20 seconds is too short for this validation path on larger restores. Increasing the timeout should prevent these unnecessary restore failures, and rejecting with Error objects keeps the failure shape consistent for downstream handling.

How Has This Been Tested?

  • Reviewed the restore health check code path in server/src/maintenance/maintenance-health.repository.ts
  • Confirmed the timeout used during restore validation is now 180 seconds instead of 20 seconds
  • Full local test suite
  • Reproduced and verified end-to-end in a local Immich dev environment

Checklist:

  • I have carefully read CONTRIBUTING.md
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation if applicable
  • I have no unrelated changes in the PR.
  • I have confirmed that any new dependencies are strictly necessary.
  • I have written tests for new code (if applicable)
  • I have followed naming conventions/patterns in the surrounding code
  • All code in src/services/ uses repositories implementations for database calls, filesystem operations, etc.
  • All code in src/repositories/ is pretty basic/simple and does not have any immich specific logic (that belongs in src/services/)

Please describe to which degree, if any, an LLM was used in creating this pull request.

LLM-assisted investigation and draft wording. The final code change was reviewed by AI before submission.

@github-actions
Copy link
Copy Markdown
Contributor

This PR has been automatically closed as the description doesn't follow our template. After you edit it to match the template, the PR will automatically be reopened.

@github-actions github-actions Bot closed this Mar 31, 2026
@github-actions github-actions Bot reopened this Mar 31, 2026
@ErasmusAndre ErasmusAndre changed the title fix(server): increase restore health check timeout fix(server): avoid false restore failures on large database imports Mar 31, 2026
@jrasm91 jrasm91 merged commit 55ab8c6 into immich-app:main Apr 8, 2026
48 checks passed
eleboucher pushed a commit to eleboucher/homelab that referenced this pull request Apr 10, 2026
…3) (#128)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [immich-app/immich](https://github.com/immich-app/immich) | patch | `v2.7.2` → `v2.7.3` |

---

### Release Notes

<details>
<summary>immich-app/immich (immich-app/immich)</summary>

### [`v2.7.3`](https://github.com/immich-app/immich/releases/tag/v2.7.3)

[Compare Source](immich-app/immich@v2.7.2...v2.7.3)

### v2.7.3

#### What's Changed

##### 🐛 Bug fixes

- fix(server): avoid false restore failures on large database imports by [@&#8203;ErasmusAndre](https://github.com/ErasmusAndre) in [#&#8203;27420](immich-app/immich#27420)
- fix(mobile): improve image load cancellation handling by [@&#8203;LeLunZ](https://github.com/LeLunZ) in [#&#8203;27624](immich-app/immich#27624)
- fix(server): people search not showing for 3 or less characters by [@&#8203;zackpollard](https://github.com/zackpollard) in [#&#8203;27629](immich-app/immich#27629)
- fix(web): don't cache empty search results for people search by [@&#8203;zackpollard](https://github.com/zackpollard) in [#&#8203;27632](immich-app/immich#27632)
- fix(mobile): get provider refs before async gaps in backup page by [@&#8203;LeLunZ](https://github.com/LeLunZ) in [#&#8203;27597](immich-app/immich#27597)
- fix: ssr open graph tags by [@&#8203;jrasm91](https://github.com/jrasm91) in [#&#8203;27639](immich-app/immich#27639)

##### 📚 Documentation

- fix(docs): updated docker deprecation link  by [@&#8203;mmomjian](https://github.com/mmomjian) in [#&#8203;27633](immich-app/immich#27633)

#### New Contributors

- [@&#8203;fluffy](https://github.com/fluffy) made their first contribution in [#&#8203;27606](immich-app/immich#27606)
- [@&#8203;ErasmusAndre](https://github.com/ErasmusAndre) made their first contribution in [#&#8203;27420](immich-app/immich#27420)

**Full Changelog**: <immich-app/immich@v2.7.2...v2.7.3>

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xMDEuMSIsInVwZGF0ZWRJblZlciI6IjQzLjEwMS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJyZW5vdmF0ZS9naXRodWItcmVsZWFzZSIsInR5cGUvcGF0Y2giXX0=-->

Reviewed-on: https://git.erwanleboucher.dev/eleboucher/homelab/pulls/128
Co-authored-by: bot-owl <bot@erwanleboucher.dev>
Co-committed-by: bot-owl <bot@erwanleboucher.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants