#IOS app backup sync fail

1 messages ยท Page 1 of 1 (latest)

frozen pewter
#

Hey,
On our IOS device, backup seems not to work. in the backup menu we get an error "Sync failed. Cannot process backup." (as shown in attached pic).
I am attaching the logs from the app.

When we choose photos in the timeline to upload, that does work.

also, when choosing the old timeline, the backup seems to work.
on the android device, there is no issue.

server ver: 2.1.0. build 18540213782 (server is deployed on a linux machine using docker)
app ver: 2.1.0

Thanks

slender walrusBOT
#

:wave: Hey @frozen pewter,

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

References

#

Checklist

I have...

  1. :ballot_box_with_check: verified I'm on the latest release(note that mobile app releases may take some time).
  2. :ballot_box_with_check: read applicable release notes.
  3. :ballot_box_with_check: reviewed the FAQs for known issues.
  4. :ballot_box_with_check: reviewed Github for known issues.
  5. :blue_square: tried accessing Immich via local ip (without a custom reverse proxy).
  6. :ballot_box_with_check: uploaded the relevant information (see below).
  7. :ballot_box_with_check: 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)

Information

In order to be able to effectively help you, we need you to provide clear information to show what the problem is. The exact details needed vary per case, but here is a list of things to consider:

  • Your docker-compose.yml and .env files.
  • Logs from all the containers and their status (see above).
  • All the troubleshooting steps you've tried so far.
  • Any recent changes you've made to Immich or your system.
  • Details about your system (both software/OS and hardware).
  • Details about your storage (filesystems, type of disks, output of commands like fdisk -l and df -h).
  • The version of the Immich server, mobile app, and other relevant pieces.
  • Any other information that you think might be relevant.

Please paste files and logs with proper code formatting, and especially avoid blurry screenshots.
Without the right information we can't work out what the problem is. Help us help you ;)

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

frozen pewter
mild egret
frozen pewter
# mild egret Can you try log out and log back in? I believe it will fix your issue

Hmm, when I chose to use 'new timeline' (after updating the app), I needed to re-sign in, and then saw that the sync is not working.

I looked through the settings and saw an option to delete SQLite database. I saw that is helped other people in some cases, so I tried it.
Then I needed to sign in again. It seemed to sync...

Now I saw your reply and tested to see if I still have the issue, by taking pictures and seeing if it syncs. (Was going to wait a few days and update...)
It still doesn't.

So I tried your suggestions- log out and in again. Still has an issue.

mild egret
#

Looks like there are something going on with the database information about facial recognition that send in already existed data

#

Do you know if you have modified the Postgres database manually or you use any of the community scripts to modify anything?

frozen pewter
#

I dont think i changed anything (other thank the compose file if breaking changes needed the change). did the updates as they came. (i think almost a year now)

mild egret
#

I can take a look in detail of the log in the morning and can send you some queries to help resolve the issue

frozen pewter
frozen pewter
#

ill add, i did try to log out and log in again

lyric pilot
#

This definitely looks like a problematic asset as the issue persists after a sync reset as well. Can you share the results of the following two queries from the server's DB

SELECT * FROM "asset" WHERE "id" = '212cbd6f-9e5b-4f21-996f-64fe8e475752';
SELECT * FROM "person" WHERE "id" = '61bba906-023c-44bd-9727-521bc64cef9c';
frozen pewter
slender walrusBOT
frozen pewter
lyric pilot
frozen pewter
#

assetId | personId | imageWidth | imageHeight | boundingBoxX1 | boundingBoxY1 | boundingBoxX2 | boundingBoxY2 | id | sourceType | deletedAt | updatedAt | updateId
--------------------------------------+--------------------------------------+------------+-------------+---------------+---------------+---------------+---------------+--------------------------------------+------------------+-----------+-------------------------------+--------------------------------------
212cbd6f-9e5b-4f21-996f-64fe8e475752 | 61bba906-023c-44bd-9727-521bc64cef9c | 1600 | 1200 | 108 | 432 | 205 | 553 | e6302c5a-38bc-480d-b0f6-8df7c05ba9d9 | machine-learning | | 2025-07-27 10:06:46.210135+00 | 01984b5a-a338-79bf-ae5b-bab7f8c4d8f5
(1 row)

lyric pilot
#

Can you try the person query again?

SELECT * FROM "person" WHERE "id" = '61bba906-023c-44bd-9727-521bc64cef9c';
frozen pewter
#

0 rows

lyric pilot
#

in the psql cli, make sure you're using the right database using \c immich, then execute \d asset_face and share it's output here

frozen pewter
#

psql cli- is how i ran the other commands?
or do i need to start the cli session (docker exec) with new parms?

lyric pilot
frozen pewter
lyric pilot
#

Can you run the following command?

ALTER TABLE "asset_face" VALIDATE CONSTRAINT "asset_face_personId_fkey";
frozen pewter
#

i got the output of:
ALTER TABLE

frozen pewter
mild egret
frozen pewter
#

i will try

mild egret
#

so same issue with the previous error

#

looks like some operation on the face/editing persion is causing the data synchronization to fail

#

have you done any operation like face merging, editing, deleting?

frozen pewter
frozen pewter
frozen pewter
#

also, dont know if it matters...
some of the faces are on the external libraries photos

mild egret
#

let me do some digging

#

Can you access to the sql database on the server?

#
docker exec -it immich_postgres psql --dbname=immich --username=postgres
frozen pewter
#

the one @lyric pilot wanted me to access earlier in this thread? yes

mild egret
#

let's run some queries if it is ok with you

#

let me know after you executed the command above

frozen pewter
#

ok, im connected

mild egret
#

First, let's check if the asset is still exist

SELECT * FROM asset WHERE id = '7045833b-079d-49c0-84ea-1cf88879f48a';
frozen pewter
#

id | deviceAssetId | ownerId | deviceId | type | originalPath | fileCreatedAt | fileModifiedAt | isFavorite | duration | encodedVideoPath | checksum | livePhotoVideoId | updatedAt | createdAt | originalFileName | sidecarPath | thumbhash | isOffline | libraryId | isExternal | deletedAt | localDateTime | stackId | duplicateId | status | updateId | visibility
--------------------------------------+---------------+--------------------------------------+----------------+-------+----------------------------------------------------+---------------------------+----------------------------+------------+----------+------------------+--------------------------------------------+------------------+-------------------------------+-------------------------------+------------------+-------------+----------------------------------------------+-----------+--------------------------------------+------------+-----------+---------------------------+---------+-------------+--------+--------------------------------------+------------
7045833b-079d-49c0-84ea-1cf88879f48a | 7Q1A9858.JPG | d79d6a39-5ae8-4e3a-8e10-4bde08775b37 | Library Import | IMAGE | /external_libraries/Hephzi bat mitzva/7Q1A9858.JPG | 2025-07-10 17:51:52.21+00 | 2025-08-31 15:14:05.321+00 | f | | | \x5cdbbbf06eff301ea5ecf7de6b00e4cf365e2dd3 | | 2025-09-01 18:02:41.036927+00 | 2025-09-01 18:01:27.114558+00 | 7Q1A9858.JPG | | \x1a081205807f77987a88777889867777690b48d3c0 | f | fe24975f-0284-420d-90d3-a695fcc49a90 | t | | 2025-07-10 18:51:52.21+00 | | | active | 01990672-0a0c-7922-9b0c-712c964aca8b | timeline
(1 row)

mild egret
#

ok, so it exists

#
SELECT id, "deletedAt", "isVisible" FROM asset WHERE id = '7045833b-079d-49c0-84ea-1cf88879f48a';
frozen pewter
#

ERROR: column "isVisible" does not exist
LINE 1: SELECT id, "deletedAt", "isVisible" FROM asset WHERE id = '7...

mild egret
#
SELECT id, "deletedAt", visibility FROM asset WHERE id = '7045833b-079d-49c0-84ea-1cf88879f48a';
frozen pewter
#

id | deletedAt | visibility
--------------------------------------+-----------+------------
7045833b-079d-49c0-84ea-1cf88879f48a | | timeline
(1 row)

mild egret
#
SELECT * FROM asset_face WHERE assetId = '7f848494-2a7b-4911-8b7d-af126856ee46';
frozen pewter
#

ERROR: column "assetid" does not exist
LINE 1: SELECT * FROM asset_face WHERE assetId = '7f848494-2a7b-4911...
^
HINT: Perhaps you meant to reference the column "asset_face.assetId".

mild egret
#
SELECT * FROM asset_face WHERE "assetId" = '7f848494-2a7b-4911-8b7d-af126856ee46';
frozen pewter
#

assetId | personId | imageWidth | imageHeight | boundingBoxX1 | boundingBoxY1 | boundingBoxX2 | boundingBoxY2 | id | sourceType | deletedAt | updatedAt | updateId
---------+----------+------------+-------------+---------------+---------------+---------------+---------------+----+------------+-----------+-----------+----------
(0 rows)

mild egret
#
SELECT * FROM asset_face WHERE "personId" = '7f848494-2a7b-4911-8b7d-af126856ee46';
frozen pewter
#

assetId | personId | imageWidth | imageHeight | boundingBoxX1 | boundingBoxY1 | boundingBoxX2 | boundingBoxY2 | id | sourceType | deletedAt | updatedAt | updateId
---------+----------+------------+-------------+---------------+---------------+---------------+---------------+----+------------+-----------+-----------+----------
(0 rows)

mild egret
#
SELECT * FROM asset_face WHERE id = '7f848494-2a7b-4911-8b7d-af126856ee46';
frozen pewter
#

assetId | personId | imageWidth | imageHeight | boundingBoxX1 | boundingBoxY1 | boundingBoxX2 | boundingBoxY2 | id | sourceType | deletedAt | updatedAt | updateId
--------------------------------------+--------------------------------------+------------+-------------+---------------+---------------+---------------+---------------+--------------------------------------+------------------+-----------+-------------------------------+--------------------------------------
7045833b-079d-49c0-84ea-1cf88879f48a | 8dabd691-6b08-439c-875a-77fef5ac2dfa | 2160 | 1440 | 384 | 599 | 559 | 839 | 7f848494-2a7b-4911-8b7d-af126856ee46 | machine-learning | | 2025-09-01 18:16:53.732514+00 | 0199067f-0ce4-72d9-a02e-fb4bb4028b1a
(1 row)

mild egret
#
SELECT id, "ownerId" FROM asset WHERE id = '7045833b-079d-49c0-84ea-1cf88879f48a';
frozen pewter
#

id | ownerId
--------------------------------------+--------------------------------------
7045833b-079d-49c0-84ea-1cf88879f48a | d79d6a39-5ae8-4e3a-8e10-4bde08775b37

mild egret
#

Do you use partner's sharing feature?

frozen pewter
#

yes

#

i can go and see her timeline

mild egret
#

select * from user;

frozen pewter
#

user

postgres
(1 row)

mild egret
#

select id, email from public.user;

frozen pewter
#

id | email | password | createdAt | profileImagePath | isAdmin | shouldChangePassword | deletedAt | oauthId | updatedAt | storageLabel | name | quotaSizeInBytes | quotaUsageInBytes | status | profileChangedAt | updateId | avatarColor | pinCode
--------------------------------------+--------------------+--------------------------------------------------------------+-------------------------------+------------------+---------+----------------------+-----------+---------+-------------------------------+--------------+----------------+------------------+-------------------+--------+-------------------------------+--------------------------------------+-------------+---------
d79d6a39-5ae8-4e3a-8e10-4bde08775b37 | [email protected] | $2b$10$csPhFIp7tNjYPKMNbxjV1udl052NeKEvlXgyYSHtiHalglz9OCm2m | 2024-08-11 13:30:28.705813+00 | | t | t | | | 2025-11-26 15:38:47.080488+00 | admin | Bezalel Koplon | | 19586678168 | active | 2024-10-15 11:46:30.281822+00 | 019ac0d1-33a8-71d5-93ca-25d0c3361acc | |
f73f3bb4-6399-44c9-9037-c84bbd413284 | [email protected] | $2b$10$h/XhVqZXl2ySheSXCHJELe.pgBExFArUQ4vDJc5WCbFbjRCg2matS | 2024-08-11 13:34:20.345701+00 | | f | f | | | 2025-11-25 22:00:02.305712+00 | | Bati K | | 110294657303 | active | 2024-10-15 11:46:30.281822+00 | 019abd07-e401-71f2-b467-e52b8801be7c | |
(2 rows)

mild egret
#

So which user is logged in on this phone?

frozen pewter
#

i am the first user (android) - the admin

#

i am accessing the server from my PC

#

*using ssh

mild egret
#
SELECT id, "updateId", "createdAt", "updatedAt" FROM asset WHERE id = '7045833b-079d-49c0-84ea-1cf88879f48a';
frozen pewter
#

id | updateId | createdAt | updatedAt
--------------------------------------+--------------------------------------+-------------------------------+-------------------------------
7045833b-079d-49c0-84ea-1cf88879f48a | 01990672-0a0c-7922-9b0c-712c964aca8b | 2025-09-01 18:01:27.114558+00 | 2025-09-01 18:02:41.036927+00
(1 row)

mild egret
#
SELECT * FROM session_sync_checkpoint 
WHERE "sessionId" IN (SELECT id FROM sessions WHERE "userId" = 'd79d6a39-5ae8-4e3a-8e10-4bde08775b37')
ORDER BY type;
frozen pewter
#

WHERE "sessionId" IN (SELECT id FROM sessions WHERE "userId" = 'd79d6a39-5ae8-4e3a-8e10-4bde08775b37')
ORDER BY type;
ERROR: relation "sessions" does not exist
LINE 2: WHERE "sessionId" IN (SELECT id FROM sessions WHERE "userId"...

mild egret
#
SELECT * FROM session_sync_checkpoint 
WHERE "sessionId" IN (SELECT id FROM session WHERE "userId" = 'd79d6a39-5ae8-4e3a-8e10-4bde08775b37')
ORDER BY type;
frozen pewter
mild egret
#

You said logout and login still exhibit the sync error message?

frozen pewter
#

correct

#

on both accounts/phones

mild egret
#

Can you help me clear the logs, then log out and log back in, after the sync finished/reach the error state, then you share the whole log again?

frozen pewter
#

logs on phone, correct?

mild egret
#

Yes

frozen pewter
#

so when loging back in, the backup was not enabled.
enabling it, and i have 2 assets to upload (one was added after the log in), the cloud on top has a check (marking that backup has finished)- even though the 2 pictuers are not backed up

mild egret
#

Yes, when you logout and backup button is disabled

#

Now run this query, I think it will fix the sync issue for this specific edge case

DELETE FROM asset_face WHERE id = '7f848494-2a7b-4911-8b7d-af126856ee46';
frozen pewter
#

i got:

DELETE 1

mild egret
#

ok, now put the app the background and reopen it

#

it should resync and should finish the syncing

frozen pewter
#

hmm, got the sync error

mild egret
#

try log out and log in again

frozen pewter
#

ok, trying

mild egret
#

there might be another face that will need to be deleted

frozen pewter
mild egret
#
SELECT COUNT(*) 
FROM asset_face af
JOIN asset a ON af."assetId" = a.id
WHERE a."isExternal" = true AND a."ownerId" = 'd79d6a39-5ae8-4e3a-8e10-4bde08775b37';
frozen pewter
#

count

4730
(1 row)

mild egret
#
SELECT id, "isExternal", "libraryId", "originalPath" 
FROM asset 
WHERE id = '18e7245d-b85b-4b2c-9000-d9f87c23710e';
frozen pewter
#

id | isExternal | libraryId | originalPath
--------------------------------------+------------+--------------------------------------+----------------------------------------------------
18e7245d-b85b-4b2c-9000-d9f87c23710e | t | fe24975f-0284-420d-90d3-a695fcc49a90 | /external_libraries/Hephzi bat mitzva/7Q1A9875.JPG
(1 row)

mild egret
#

Can you help check the trash page on the web, do you have many in the trash and if they are from external library?

frozen pewter
#

i see (the first account) 2 items in trash- and they are not from external

mild egret
#

something is pretty weird going on regarding some facial/person operation

#

We might have to re run facial detection and facial recognition for all

frozen pewter
#

the second account has 1 item (live photo) in trash - also not external

frozen pewter
#

if that what it takes to be able to sync again- lets do it

#

but if this issue happened once, can we know that it wont happen again?

mild egret
#

I'd have to deep dive into this with the team to figure out exactly why it happens in the frist place, for now I think it is important to get things back to functional for you and your users

#

so let's reset the facial detection and recognitions

frozen pewter
#

great

#

hmm, just looked in admin settings on web, it looks like at the moment, Facial Recognition is off๐Ÿง

mild egret
#

oh interesting

frozen pewter
#

if i enable this, to see the effects i need to log out first?

mild egret
#

lemme think about this

#

when did you have facial recognition disabled?

frozen pewter
#

not sure
could be when the issue first happened on the IOS phone and trying to try things to fix (i thought everything that was changed was put back) [before opening a thread here]

mild egret
#

do you want this feature?

#

if yes, then you can enable the feature, then run facial detection and recognition for all again

frozen pewter
#

yes, i think it gives a better experience over all

frozen pewter
#

for both: Active-0 Waiting-0

mild egret
#

reset would be good

frozen pewter
#

for both jobs?

mild egret
#

If you run the detection then it will automaticall queue for recognition

frozen pewter
#

face detection finished, and has "1 failed"

#

and 'facial recognition' didt run

mild egret
frozen pewter
#

its ok,
ran.
and status looks like last pic i sent

mild egret
#

when it is finished, try to open the app and see if the sync finished

frozen pewter
#

wow, backup looks like it was successful on the android ๐Ÿ™‚

#

will check the other phone/account when its available to me

#

will update

#

thank you ๐Ÿ™‚

mild egret
#

No problem, sorry for the hassle

frozen pewter
#

ok, seems like we can backup from android and IOS

#

thank you so much @mild egret and @lyric pilot for all your help getting this to work for us ๐Ÿ™‚