Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

could not get media by media_id and user_id from database: record not found in home page #729

Closed
JordanDIG opened this issue Aug 11, 2022 · 24 comments · Fixed by #892
Closed
Labels
bug Something isn't working

Comments

@JordanDIG
Copy link

Describe the bug
I just installed Photoview, when I go to the WEB interface I have no photo loaded and this error appears in a loop.

To Reproduce
Steps to reproduce the behavior:

  1. install PhotoView

Expected behavior
No photo of the reception desk loads

Screenshots
https://share.jordand.fr/yUPI7/JoneQiMI00.png

Your environment:
Feel free to remove and add what you think might be useful.

  • Are you using Docker? [yes ]
  • Database [mariadb 10.5]
  • Browser [chrome]
  • Version [2.3.13]
@JordanDIG JordanDIG added the bug Something isn't working label Aug 11, 2022
@Shmik2003
Copy link

You can try to open Photoview, disable connection to the Internet (or disable Photoview server) and open info about this picture. You will see name of image, it's directory and other information. As I think, this error means that this image aren't scanned yet or don't have preview. I believe, you can keep Photoview active for scanning media and this trouble will resolve itself. A small flaw

@JordanDIG
Copy link
Author

You can try to open Photoview, disable connection to the Internet (or disable Photoview server) and open info about this picture. You will see name of image, it's directory and other information. As I think, this error means that this image aren't scanned yet or don't have preview. I believe, you can keep Photoview active for scanning media and this trouble will resolve itself. A small flaw

I have already tried to wait 24 hours but the problem is still there...

@bigjimmy546
Copy link

bigjimmy546 commented Aug 29, 2022

I have the same issue, problem persists after done scanning.

Are you using Docker? [yes ]
Database [mariadb 10.5]
Release Version
2.3.13 ([446ef9a]

@JordanDIG
Copy link
Author

I have the same issue, problem persists after done scanning.

Are you using Docker? [yes ] Database [mariadb 10.5] Release Version 2.3.13 ([446ef9a]

I have migrate to Photoprism but yes I was on this version

@hugoghx
Copy link

hugoghx commented Sep 3, 2022

+1 on this issue. Currently running the edge docker image, and also tried completely deleting the database and redoing the entire library from scratch, did not help.

Edit: I reverted to 2.3.12, dropped the database and rescanned everything and that seems to have fixed the issue. Something in 2.3.13 seems to have broken some of the scanner functionality.

Probably something about this #727 - it's still not fully fixed in edge from what I can tell though

@bigjimmy546
Copy link

bigjimmy546 commented Sep 4, 2022 via email

@lockheed
Copy link

lockheed commented Oct 1, 2022

I just installed latest Photoview and the issue continues. Is this intended to be fixed?

@kan84
Copy link

kan84 commented Oct 24, 2022

I installed 2.3.12 and removed old db which solved the problem for time being.

@lazycatze
Copy link

lazycatze commented Nov 1, 2022

The same issue.
Hope it will be fixed with forthcoming updates

@fmnamado
Copy link

fmnamado commented Nov 4, 2022

Has anyone identified why this occurs?
Is some rogue image, is it random, ... ?
I have redone all my library and scanning was going OK but now this bug appeared.

How can I know the version I am using?
Mine says:

Release Version
edge (d4f3079)
Build date
2022-03-28T16:52:24Z

I tried pulling other version than this, in portainer, changing the tag and selecting recreate and pull image but I can't seem to fix it, can someone point me how can I be sure which version I am running?

Thank you.

@sloniupl
Copy link

sloniupl commented Nov 6, 2022

Had exactly the same issue on 2.3.13 using docker compose " image: viktorstrate/photoview:2 "
After reverting back to 2.3.12 and scanning again everything is working correctly :)

@fmnamado
Copy link

fmnamado commented Nov 6, 2022

Which tag version should i use to revert to .12 version?
And in the settings tab, which version will this .12 version display?
Will it repair after just scan again or full scan scratch from zero?

Ty

@sloniupl
Copy link

sloniupl commented Nov 7, 2022

In your docker compose just use "image: viktorstrate/photoview:2.3.12"" after that clean cookies for your website and just do a normal scan.

@fmnamado
Copy link

fmnamado commented Nov 7, 2022

Hello and ty for your help.

Before doing what you said, I went to see the version, it was as I posted.
Symptoms:
In timeline I could only see blurhashes, if I pressed the I of the photo, it would open the tab on the right, but without seing the photo.
If I went to albums, it appeared NOTHING.

If i create and login with another user, in timeline the photos appear and in albums aswell. But if I press in the i from info, it says on the tab itself
"Error: could not get media by media_id and user_id from database: record not found"
And in the main window, notification like, says:

"Server error
You are being logged out in an attempt to recover. Cannot query field "description" on type "MediaEXIF".
Something went wrong
Server error: Cannot query field "description" on type "MediaEXIF". at (undefined)
Something went wrong
Server error: could not get media by media_id and user_id from database: record not found at (media)
Something went wrong
Server error: could not get media by media_id and user_id from database: record not found at (media)"

Then I went to try what you told.
I changed the tag in my stack and recreated.
I even went to portainer to press in recereate and for IMAGE PULL.

Now it says
"Photoview Version
Release Version

2.3.12 (0b9d04e)
Build date

2022-02-11T12:07:25Z"

So I assume it is OK.

I did a scan, let it finish and nothing changed.
Same non-appearing images, etc, as I mentioned above.

Any more ideas?

@sloniupl
Copy link

sloniupl commented Nov 7, 2022 via email

@fmnamado
Copy link

fmnamado commented Nov 7, 2022

Every time I mentioned "scan" i meant "scan all users", that's the button I always press.

Did you got white images or blurhashes?
Because in timeline I have blurhashes and not white images.

EDIT/continuation: I tried scanning all users and it stayed the same.

@sloniupl
Copy link

sloniupl commented Nov 7, 2022 via email

@kiesekae
Copy link

For anyone else running into this issue where you get some sporadic white thumbnails in your timeline and albums and the error: Something went wrong Server error: could not get media by media_id and user_id from database: record not found at (media), this happens for some reason when you scan your library from the "Users Level" opposed to clicking the "Scan all users" button.

Once you run the Scan All Users button, it should fix the issue.

Hope this helps someone.
Cheers!

@eerison
Copy link

eerison commented Oct 3, 2023

For anyone else running into this issue where you get some sporadic white thumbnails in your timeline and albums and the error: Something went wrong Server error: could not get media by media_id and user_id from database: record not found at (media), this happens for some reason when you scan your library from the "Users Level" opposed to clicking the "Scan all users" button.

Once you run the Scan All Users button, it should fix the issue.

Hope this helps someone. Cheers!

I did it, but it does not solve the issue :/

@DaCHack
Copy link

DaCHack commented Jan 5, 2024

Problem still persists in docker:master

White images on the homepage and this error coming up on the right hand side when clicking the "i".
When go into albums view, I can see the images and also open in fullscreen, but clicking the "i" gives again this error.

Rescanning all users (without nuking the DB) now and see what happens...

@jave
Copy link

jave commented Jan 9, 2024

I also have this.

@DaCHack
Copy link

DaCHack commented Jan 9, 2024

For me a full rescan helped. Seems like the scan was interrupted somewhere before which led to incomplete caching and DB entries...

@ruudfeen
Copy link

ruudfeen commented Mar 5, 2024

I did some research in the code for this problem, the cause of this problem is missing records in the media_urls table which results in 0 records when retrieving the media, I didn't find the cause for the missing records.

@ruudfeen
Copy link

ruudfeen commented Mar 14, 2024

After some more investigation it seems (at least in my case) that it had problems with corrupted images. It looks like it stops scanning after it fails to process a corrupted image. When I found out which images it struggled with, I deleted them and the directory was scanned correctly after that. It looks like the software doesn't recover from faulty images. I also couldn't find an easy way to find which image is corrupt.

[edit] It seems there is a PR available for this problem #892

@viktorstrate viktorstrate linked a pull request Mar 25, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.