I
Immich•2y ago
miknzau

I am seeing these errors on load of the photos page.

http://192.168.1.103:2283/api/asset/time-bucket?size=MONTH&isArchived=false&timeBucket=%2B060379-10-01T00%3A00%3A00.000Z 500 (Internal Server Error) Ans some other related ones. All servers are running fine in docker. Any ideas?
No description
189 Replies
bo0tzz
bo0tzz•2y ago
What do the server container logs say?
Daniel
Daniel•2y ago
And also, could you post your docker compose file?
miknzau
miknzauOP•2y ago
No description
miknzau
miknzauOP•2y ago
No description
Daniel
Daniel•2y ago
Those are old logs. Could you show the most recent - right after you tried to open the page Those are both just errors that occur from trying to access the server while it isn't started yet
miknzau
miknzauOP•2y ago
this was grabbed right after reloading the page hmm but the time stamps are wrong - the dockler log seems very shitty there is nothing in the log for today??? 2023-10-12 14:35:17. is the last entry confused
miknzau
miknzauOP•2y ago
when I open the immich_server log screen in docker, the very bottom line is this...
"2023-10-12 15:08:53 Error [ERR_STREAM_PREMATURE_CLOSE]: Premature close error from daemon in stream: Error grabbing logs: invalid character '\x00' looking for beginning of value" so it seems to be erroring while trying to grab logs - great
Daniel
Daniel•2y ago
Are you using portainer only for maintaining/watching the stack? Or did you deploy Immich using portainer in the first place?
miknzau
miknzauOP•2y ago
its dockeer desktop on a mac - not sure what portainer is
Daniel
Daniel•2y ago
Oh I see, sorry. I was just seing docker UI and were therefore assuming it must be portainer
miknzau
miknzauOP•2y ago
my install has been running fine for about a week
Daniel
Daniel•2y ago
Could you try running docker logs immich_server? See if that returns more logs and doesn't error out with "Error grabbing logs" Could you get the logs of immich_microservices as well?
miknzau
miknzauOP•2y ago
sure
Daniel
Daniel•2y ago
Why are all those logs so old? Could you just try bringing the stack down and up again? And also: I don't need 250k lines of logs normally :P Just the last 50-100 lines should be enough
miknzau
miknzauOP•2y ago
which method is best to bring stack down and back up again? yeah its weird the logs are all old its liek logging is broken
Daniel
Daniel•2y ago
In the folder where you've placed the docker-compose.yml: docker compose down and then docker compose up -d should be enough Was your docker instance running the whole time and just stopped working? If you're running it on a mac, is that running 24/7?
miknzau
miknzauOP•2y ago
its running 24/7 yes but i have restarted the mac in the last 24 hrs
Daniel
Daniel•2y ago
Hm. The docker implementation on macos is pretty bad tbh, so it may just be that it had a hiccup and restarting it as described above fixes it
miknzau
miknzauOP•2y ago
ok it went down and up cleanly
miknzau
miknzauOP•2y ago
this is the bottom of server log
No description
Daniel
Daniel•2y ago
This is all just fine while it's still starting
miknzau
miknzauOP•2y ago
ok let me see if the errors are still present in the front end
Daniel
Daniel•2y ago
The frontend probably won't be there just yet Just give it a minute to let it start up
miknzau
miknzauOP•2y ago
oh - it was and those errors are same
miknzau
miknzauOP•2y ago
ok so server log...
No description
miknzau
miknzauOP•2y ago
so its this time displacement thing again
Daniel
Daniel•2y ago
Could you try re-running metadata extraction for all assets?
miknzau
miknzauOP•2y ago
Alex posted about that yesyerday but i cant find the thread becuase i am a noob at discord Extract Metadata or "sidecar metadat"
Daniel
Daniel•2y ago
extract metadata And then click on "all" This may take a while though How many assets do you have?
miknzau
miknzauOP•2y ago
lol yes.
No description
Daniel
Daniel•2y ago
Oh wow.
miknzau
miknzauOP•2y ago
large library
Daniel
Daniel•2y ago
So yeah, this will take a while
miknzau
miknzauOP•2y ago
yes that is the one... @Daniel does that thread help with any insight?
Daniel
Daniel•2y ago
Unfortunately, we don't maintain the immich-go export cli Did you try the fix that is described in the thread?
miknzau
miknzauOP•2y ago
I didnt use immich go i used nodejs and the immich documented CLI process
Daniel
Daniel•2y ago
Did you export those images from google photos?
miknzau
miknzauOP•2y ago
I didnt see any fix - that thread was a little above my pay grade no - these images were imported over many many days from external hdds plugged directly into the mac that is hosting immich
Daniel
Daniel•2y ago
Ah I see, then the thread is completely unrelated unfortunately :/
miknzau
miknzauOP•2y ago
thus using the immich upload command ok
Daniel
Daniel•2y ago
Yep, that's perfectly fine!
miknzau
miknzauOP•2y ago
so do i run this massive extract metdata job?
Daniel
Daniel•2y ago
It appears at least one of your assets has really broken metadata I'd like to try something else first
miknzau
miknzauOP•2y ago
yes sure i am gussing the borken asset is in teh viewport at the time i see the error bcuase i can scroll through the rest and i ddont see it and the "Rest" are not loaded until scrolling down to them
Daniel
Daniel•2y ago
Exactly. It will be fetched and while trying to do so, the database breaks because that asset was apparently taken in the year 60379 xD
miknzau
miknzauOP•2y ago
ok so how can i find it in the dom
Daniel
Daniel•2y ago
I'm assuming you haven't changed the storage template, correct?
miknzau
miknzauOP•2y ago
nope
Daniel
Daniel•2y ago
Then your library should be sorted into folders by year So, if the asset got imported successfully, it should be there
miknzau
miknzauOP•2y ago
No description
miknzau
miknzauOP•2y ago
bingo
Daniel
Daniel•2y ago
Perfect!
miknzau
miknzauOP•2y ago
60379
Daniel
Daniel•2y ago
Yes! Don't delete it just yet
miknzau
miknzauOP•2y ago
ok so there is only one pic in that folder!
Daniel
Daniel•2y ago
K, so that seems to be broken
miknzau
miknzauOP•2y ago
yeah but i am seeing two x the error msg anyway lets clean this one out first how should I do it
Daniel
Daniel•2y ago
Yes, just give me a second
miknzau
miknzauOP•2y ago
find it in the UI and remove frm there maybe?
Daniel
Daniel•2y ago
I mean that would be easy but you won't find it in the UI since it can't be fetched
miknzau
miknzauOP•2y ago
ahh true
Simulot
Simulot•2y ago
if you have a mobile application linked to your immich server, you are able to delete the offending image
Daniel
Daniel•2y ago
Ok, so could first run docker exec -it immich_postgres psql immich postgres. This should give you a database shell. Inside that, run SELECT * FROM "assets" WHERE "originalPath" LIKE '%60379%';
miknzau
miknzauOP•2y ago
Yes!!! I see the offending immch at the top of my mobile app
Daniel
Daniel•2y ago
Oh, that's even easier haha
miknzau
miknzauOP•2y ago
so should i use the app to delete it?
Daniel
Daniel•2y ago
Try it, sure Wait Before doing so, you should somehow remember which asset that is So that you can fix it and re-upload
miknzau
miknzauOP•2y ago
No description
miknzau
miknzauOP•2y ago
there it is in the app october 60379
Simulot
Simulot•2y ago
the file is the 60379 folder
Daniel
Daniel•2y ago
So you could just copy the image from the library folder to save it. Then delete it
miknzau
miknzauOP•2y ago
i dont care about the image it seems to be a thumbnail its like 100px by 300px
Simulot
Simulot•2y ago
not a video?
Daniel
Daniel•2y ago
Why would it need to be?
miknzau
miknzauOP•2y ago
No description
Daniel
Daniel•2y ago
Yeah ok, screw that haha!
miknzau
miknzauOP•2y ago
yeah def a thumb
Daniel
Daniel•2y ago
Then just delete it from the app
miknzau
miknzauOP•2y ago
ok i hav innitated the dekete on the app and i am seeing a spinning wheel - lol its not liking it
Daniel
Daniel•2y ago
Hm So maybe we have to go the database way then
miknzau
miknzauOP•2y ago
No description
Daniel
Daniel•2y ago
Does the server throw errors again?
miknzau
miknzauOP•2y ago
nope - its 07 psa the hour now
No description
miknzau
miknzauOP•2y ago
and last entry is at 17:00 thats immich_server
Daniel
Daniel•2y ago
Yeah ok Then just close the app And try this ^^
miknzau
miknzauOP•2y ago
ok app recovered - image is still there will try db edit in terms of what like an ID number?
Daniel
Daniel•2y ago
Hm?
miknzau
miknzauOP•2y ago
I am not sure how assets are identified are they given unqiue IDs?
Daniel
Daniel•2y ago
This should return you a table with many information Can't you just run the query I gave you? And yes, they are You aren't supposed to delete it just yet
miknzau
miknzauOP•2y ago
oh i was resposnding to "wait before that remember what the asst is" will do db stuff now i was scrolled up and didnt realise - ignore me
Daniel
Daniel•2y ago
Oh I see. Yeah that was only to not have you search through all your files again to find that picture and edit it. Since it isn't relevant, it doesn't matter Haha I see Btw you can reply to messages by hovering over them and clicking on the the arrow (for messages you haven't written yourself)
miknzau
miknzauOP•2y ago
~ % docker exec -it immich_postgres psql immich postgres
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: role "postgres" does not exist
Daniel
Daniel•2y ago
Did you change anything in your .env?
miknzau
miknzauOP•2y ago
nop
Daniel
Daniel•2y ago
Could you paste it then? (with confidential stuff erased)
miknzau
miknzauOP•2y ago
sure
Simulot
Simulot•2y ago
you can get the list of docker containers with the following command
docker ps --format {{.Names}}
docker ps --format {{.Names}}
miknzau
miknzauOP•2y ago
eww - how do i put text in code mode
Daniel
Daniel•2y ago
The container is running, otherwise the message would have been different Three backticks
miknzau
miknzauOP•2y ago
No description
Daniel
Daniel•2y ago
Also fine :P So the username is postgres, wtf
miknzau
miknzauOP•2y ago
i didnt set that why is that suprising?
Daniel
Daniel•2y ago
I was assuming the userame would be postgres, hence the command But it failed, stating that it doesn't exist Which doesn't make sense, since it apparently should exist Could you try adding a -U before "postgres"? So docker exec -it immich_postgres psql immich -U postgres
miknzau
miknzauOP•2y ago
///~ % docker exec -it immich_postgres psql immich -U postgres~
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: role "postgres~" does not exist
Daniel
Daniel•2y ago
Why is there a ~ at the end?
miknzau
miknzauOP•2y ago
docker exec -it immich_postgres psql immich -U postgres psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: role "postgres" does not exist
Daniel
Daniel•2y ago
Oh wait Do you also have a .env file?
miknzau
miknzauOP•2y ago
yes i posted it earlier
Daniel
Daniel•2y ago
No, that file is called example.env The file must explicitly be called .env
miknzau
miknzauOP•2y ago
oh lol sorry
Daniel
Daniel•2y ago
Which you won't see by default in the finder btw Easiest would probably be to to ls -la Don't rename the example.env now though
miknzau
miknzauOP•2y ago
when i do a ls - la. i cant see .env
Daniel
Daniel•2y ago
You're in the right folder?
miknzau
miknzauOP•2y ago
ls ok got it was in the wrong folder
Daniel
Daniel•2y ago
😉
miknzau
miknzauOP•2y ago
whats the comand line to print it
Daniel
Daniel•2y ago
cat .env
miknzau
miknzauOP•2y ago
DB_HOSTNAME=immich_postgres DB_USERNAME=postgrescar DB_DATABASE_NAME=immich
Daniel
Daniel•2y ago
There we go! The user is postgrescar and not postgres Idk why but whatever lol Then try docker exec -it immich_postgres psql immich postgrescar
miknzau
miknzauOP•2y ago
% docker exec -it immich_postgres psql immich postgrescar psql (14.8) Type "help" for help.
Daniel
Daniel•2y ago
So you've got a new shell now, correct? You could try executing \d
miknzau
miknzauOP•2y ago
No description
Daniel
Daniel•2y ago
Now we're getting somewhere! SELECT "originalPath", "resizePath", "webpPath" FROM "assets" WHERE "originalPath" LIKE '%60379%'; Try this!
miknzau
miknzauOP•2y ago
🙂 immich-# SELECT "originalPath", "resizePath", "webpPath" FROM "assets" WHERE "originalPath" LIKE '%60379%'; ERROR: syntax error at or near "docker" LINE 1: docker exec -it immich_postgres psql immich -U postgrescar
Daniel
Daniel•2y ago
Just try again, maybe you have entered something before and missed a ';'
miknzau
miknzauOP•2y ago
No description
Daniel
Daniel•2y ago
K nice The seconds line is irrelevant, I was just too lazy and gave you a non-perfect query :D
miknzau
miknzauOP•2y ago
immich=# SELECT "originalPath", "resizePath", "webpPath" FROM "assets" WHERE "originalPath" LIKE '%60379%'; originalPath | resizePath | webpPath
-------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------- upload/library/admin/60379/60379-10-07/t19240512.jpg | upload/thumbs/27e86adf-a7a0-4a87-88b1-b341f23d504e/57/94/57946aba-da5a-4e57-aad6-5118f0f61603.jpeg | upload/thumbs/27e86adf-a7a0-4a87-88b1-b341f23d504e/57/94/57946aba-da5a-4e57-aad6-5118f0f61603.webp upload/library/admin/2017/2017-03-08/01ce67fd6460fe6f3895e6037951db0fd7a9516f3e.jpg | upload/thumbs/27e86adf-a7a0-4a87-88b1-b341f23d504e/37/73/3773392c-9d51-47fd-9c38-8db9276fe733.jpeg | upload/thumbs/27e86adf-a7a0-4a87-88b1-b341f23d504e/37/73/3773392c-9d51-47fd-9c38-8db9276fe733.webp (2 rows)
Daniel
Daniel•2y ago
SELECT "originalPath", "resizePath", "webpPath" FROM "assets" WHERE "originalPath" LIKE '%60379/%'; This should fix it and only return one row
miknzau
miknzauOP•2y ago
originalPath | resizePath | webpPath
------------------------------------------------------+----------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------- upload/library/admin/60379/60379-10-07/t19240512.jpg | upload/thumbs/27e86adf-a7a0-4a87-88b1-b341f23d504e/57/94/57946aba-da5a-4e57-aad6-5118f0f61603.jpeg | upload/thumbs/27e86adf-a7a0-4a87-88b1-b341f23d504e/57/94/57946aba-da5a-4e57-aad6-5118f0f61603.webp (1 row)
Daniel
Daniel•2y ago
So those are all files that belong to the asset we're about to delete You can remove all those three files from the file system to avoid orphans You can also remove the parent directories if they are empty So e.g. upload/library/admin/60379/ is gonna be empty after you delete the jpg. within, so you can delete the folder as well
miknzau
miknzauOP•2y ago
2 secs - phone call ok back.. so we know the file paths and i need to remove the assets so they are not orphaned.. I got that.. But dont we also need to remvoe relevant records from the db? @Daniel are you still there? do i run a command to simply delete that row?
Daniel
Daniel•2y ago
Sorry, I'm back now Yes, I just wanted to do it in small steps :)
miknzau
miknzauOP•2y ago
ok so should i remove the assets first? have not done that yet
Daniel
Daniel•2y ago
I would recommend that, yes. Because after we've deleted the rows, we have no (easy) way to find the orphaned files anymore
miknzau
miknzauOP•2y ago
ok those three assets have been removed from teh file system
Daniel
Daniel•2y ago
You can also remove directories that have become empty. Did you do that as well?
miknzau
miknzauOP•2y ago
yes
Daniel
Daniel•2y ago
Alright, then let's run SELECT "originalPath", "resizePath", "webpPath" FROM "assets" WHERE "originalPath" LIKE '%60379/%'; one more time to ensure that it really only selects that one asset
miknzau
miknzauOP•2y ago
side note - MacOS is very annoying how people use it I will never know
Daniel
Daniel•2y ago
Haha, what's wrong? I mean I use macos myself and I'm annoyed by it sometimes too, but it isn't too bad either
miknzau
miknzauOP•2y ago
just file management is dumb compared to windows... cant easily see and copy paths for example cant alt-tab between file explorer windows becuase finder is just one application
Daniel
Daniel•2y ago
Oh wait, you prefer windows over macos? Windows is awful tbh
miknzau
miknzauOP•2y ago
windows has come a long way in the past few years
Daniel
Daniel•2y ago
Yeah ok, there are apps for that. Or just use a shell lol
miknzau
miknzauOP•2y ago
anyway lets remove that entry from teh db
Daniel
Daniel•2y ago
However, I do agree that Windows has upsides compared to other OS, I just hate that it doesn't have a proper shell and stuff
miknzau
miknzauOP•2y ago
immich=# SELECT "originalPath", "resizePath", "webpPath" FROM "assets" WHERE "originalPath" LIKE '%60379/%'; originalPath | resizePath | webpPath
------------------------------------------------------+----------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------- upload/library/admin/60379/60379-10-07/t19240512.jpg | upload/thumbs/27e86adf-a7a0-4a87-88b1-b341f23d504e/57/94/57946aba-da5a-4e57-aad6-5118f0f61603.jpeg | upload/thumbs/27e86adf-a7a0-4a87-88b1-b341f23d504e/57/94/57946aba-da5a-4e57-aad6-5118f0f61603.webp (1 row) immich=#
Daniel
Daniel•2y ago
You can do this: DELETE FROM "assets" WHERE "originalPath" LIKE '%60379/%';
miknzau
miknzauOP•2y ago
yeah but putty is for that oh you mean for its self - yeah well its got powershell?
Daniel
Daniel•2y ago
I know it got powershell... And I feel like it isn't that bad. It just isn't as good as a bash or zsh imo Disclaimer: I've never really used current powershell version though
miknzau
miknzauOP•2y ago
immich=# DELETE FROM "assets" WHERE "originalPath" LIKE '%60379/%'; DELETE 1 immich=# seemd to work 🙂
Daniel
Daniel•2y ago
Nice one!
miknzau
miknzauOP•2y ago
so now - i guess lets see if the front end is reporting errors still
Daniel
Daniel•2y ago
Yep Maybe you need do restart the containers again, let's just see... Can't really tell how broken it has gotten lol
miknzau
miknzauOP•2y ago
winning. no errors!!
Daniel
Daniel•2y ago
Oh! Nice!! Well done! :) Looks really good! Containers are also happy now?
miknzau
miknzauOP•2y ago
"no issues" in console let me see how do i exit the postrges session ctlr c not working
bo0tzz
bo0tzz•2y ago
Ctrl d
miknzau
miknzauOP•2y ago
only error i see now in server log is [Nest] 7 - 10/15/2023, 11:25:53 AM ERROR [ExpressAdapter] Premature close i'll do a doan and up
Daniel
Daniel•2y ago
Yeah those are ok
miknzau
miknzauOP•2y ago
down and up command
Daniel
Daniel•2y ago
Sure, go ahead However I really think we've done it!
miknzau
miknzauOP•2y ago
hey @Daniel thank you so much for your help and you too @bo0tzz
Daniel
Daniel•2y ago
No problem :)
miknzau
miknzauOP•2y ago
this is why open source is so great teamwork and accessabiltiy to information to fix shit thanks @Alex for this project
Daniel
Daniel•2y ago
We should think about support contracts in a oracle fashion :P
miknzau
miknzauOP•2y ago
haha that would ahve been $5k thanks check is in the mail
Daniel
Daniel•2y ago
🚀 To be serious though, always glad to help people getting started with and using Immich! Feel free to reach out if you should run into any other issues in the future!
miknzau
miknzauOP•2y ago
cool - can I ask you - do you know if resizable thumbs is in the road map
Daniel
Daniel•2y ago
What do you mean by that?
miknzau
miknzauOP•2y ago
like a thumb size selector - small medium large
Daniel
Daniel•2y ago
Oh, there already is
bo0tzz
bo0tzz•2y ago
You can do that in the admin settings
miknzau
miknzauOP•2y ago
i run a 42" OLED display and the thumbs are just huge
bo0tzz
bo0tzz•2y ago
Oh, you mean the grid size in the ui?
miknzau
miknzauOP•2y ago
i want them about 50% of the size they are yea
bo0tzz
bo0tzz•2y ago
Not sure if that can be changed
miknzau
miknzauOP•2y ago
grid size in ui
bo0tzz
bo0tzz•2y ago
That's a question for @Alex I think
miknzau
miknzauOP•2y ago
here it is in another app - see the slider in the top right
No description
miknzau
miknzauOP•2y ago
No description
miknzau
miknzauOP•2y ago
showing small to large variance ok @Alex will see this question here I guess 🙂
Daniel
Daniel•2y ago
Three pings now... poor Alex :D
miknzau
miknzauOP•2y ago
ok i shall now resume uplaoding the remaining 40,000 assets to my library haha thanks again guys
Daniel
Daniel•2y ago
Sounds great. Enjoy Immich!

Did you find this page helpful?