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

index.php/apps/photos/api/v1/preview/5099927?x=512&y=512" resulted in a network error response: the promise was rejected. #1411

Closed
gmeks opened this issue Oct 20, 2022 · 12 comments · Fixed by #1457
Assignees
Labels
0. Needs triage Pending approval or rejection. This issue is pending approval. bug Something isn't working needs info Not enough information provided

Comments

@gmeks
Copy link

gmeks commented Oct 20, 2022

Describe the bug
Opening Photos people kills the browser, it will use 100% CPU.

To Reproduce
Steps to reproduce the behavior:

  1. Have lots of photos, and reconigesed people( We 200gb++)
  2. Photos
  3. People

If it mathers, i have recognize 3.10

Expected behavior
The brower should not attemt to download all preview at once, this is kills the browser and likely server side to.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • Browser firefox and edge

Open your console, reload your page and/or do the action leading to this issue and copy/paste the log in this thread.
The FetchEvent for "https://cloud.thexsoft.com/index.php/apps/photos/api/v1/preview/5123010?x=512&y=512" resulted in a network error response: the promise was rejected.
The FetchEvent for "https://cloud.thexsoft.com/index.php/apps/photos/api/v1/preview/5099623?x=512&y=512" resulted in a network error response: the promise was rejected.
The FetchEvent for "https://cloud.thexsoft.com/index.php/apps/photos/api/v1/preview/5099675?x=512&y=512" resulted in a network error response: the promise was rejected.

Please note the page that you use to modal that you use to merge faces have simular performance issues.

@gmeks gmeks added 0. Needs triage Pending approval or rejection. This issue is pending approval. bug Something isn't working labels Oct 20, 2022
@skjnldsv
Copy link
Member

skjnldsv commented Oct 21, 2022

I will need a screenshot of your network requests.
Before you do anything, still on the development tools, there is a tab called network. Click on it. Do your action and screenshot the network log like this:
capture d ecran_2018-09-27_21-49-46

@skjnldsv skjnldsv added the needs info Not enough information provided label Oct 21, 2022
@gmeks

This comment was marked as off-topic.

@skjnldsv
Copy link
Member

Hi, please open a different ticket for this :)
I'll wait for your image preview failure network log screenshots 👍

@gmeks gmeks closed this as not planned Won't fix, can't repro, duplicate, stale Oct 21, 2022
@skjnldsv skjnldsv reopened this Oct 21, 2022
@skjnldsv
Copy link
Member

Why closing?

Open your console, reload your page and/or do the action leading to this issue and copy/paste the log in this thread.
The FetchEvent for "https://cloud.thexsoft.com/index.php/apps/photos/api/v1/preview/5123010?x=512&y=512" resulted in a network error response: the promise was rejected.

Is this fixed?

@gmeks
Copy link
Author

gmeks commented Oct 21, 2022

No its not fixed, but i seem to lack the written skill to persuade you that opening 6500 requests in 1 go is a bad idea. Getting attached to where it fails is likely not going to be productive.

Most of the time browser will become some slugish the user will close it.
Sometimes the browser fails to find enough RAM for the tab.
Some of the time the reverse proxy will timeout requets.
Sometimes the server will give up.

The photo app, when you click people.
bilde

bilde

6500 in this case is the number of faces that my instance has found untill now, i have a relativlity small instance of a 1tb. Thats far from done with scanning over the images.

@artonge
Copy link
Collaborator

artonge commented Oct 21, 2022

@marcelklehr any idea of what could be the issue here ?

@marcelklehr
Copy link
Member

marcelklehr commented Oct 21, 2022

Off. The problem is likely that it's fetching so many faces. I never tested with so many faces :/ A fix would involve counting the number of face detections per person and passing that number to photos via DAV so the app can do some lazy loading. I'll have a look at this on monday.

@artonge
Copy link
Collaborator

artonge commented Oct 21, 2022

If I understand correctly, the peoples view loads the content of all the faces ? You can take a look how it is done for albums, we indeed pass the number of items in the DAV response:

$propFind->handle(self::NBITEMS_PROPERTYNAME, fn () => count($node->getChildren()));

@skjnldsv
Copy link
Member

skjnldsv commented Oct 22, 2022

No its not fixed, but i seem to lack the written skill to persuade you that opening 6500 requests in 1 go is a bad idea. Getting attached to where it fails is likely not going to be productive.

Sorry, that was not my point at all.
Your initial post mentions an issue with web worker and previews:

The FetchEvent for "cloud.thexsoft.com/index.php/apps/photos/api/v1/preview/5123010?x=512&y=512" resulted in a network error response: the promise was rejected.
The FetchEvent for "cloud.thexsoft.com/index.php/apps/photos/api/v1/preview/5099623?x=512&y=512" resulted in a network error response: the promise was rejected.
The FetchEvent for "cloud.thexsoft.com/index.php/apps/photos/api/v1/preview/5099675?x=512&y=512" resulted in a network error response: the promise was rejected.

This has nothing to do with People, and I wanted to investigate this.
If possible then, could you open another ticket for those errors? If they happen often too :)

Let's keep that issue about People then, I misunderstood that was the original point 👍

@skjnldsv
Copy link
Member

Off. The problem is likely that it's fetching so many faces. I never tested with so many faces :/ A fix would involve counting the number of face detections per person and passing that number to photos via DAV so the app can do some lazy loading. I'll have a look at this on monday.

Virtual scrolling! 👍
Or you can also try to not load the image before the face gets added into the view (with debounce or scrolling to the bottom will load them all)

@gmeks
Copy link
Author

gmeks commented Oct 24, 2022

This has nothing to do with People, and I wanted to investigate this.

My understanding when this happend ( Be aware that my javascript skills, are very limited.). Its basicly a memory restriction that happen in firefox ( This was based on searching). Basicly there is a unkown limit of how many promises you can make, before the browser kills them.

So virtual scrolling type solution should fix this issue also. But i will offcourse retest when a new app version is out

@gmeks
Copy link
Author

gmeks commented Nov 17, 2022

At the risk of being rude, but if a RC/Beta build could be published via the store i clould do some testing.

marcelklehr added a commit that referenced this issue Dec 3, 2022
… viewport

fixes #1411

Signed-off-by: Marcel Klehr <mklehr@gmx.net>
(cherry picked from commit 8dd6061)
marcelklehr added a commit that referenced this issue Dec 3, 2022
… viewport

fixes #1411

Signed-off-by: Marcel Klehr <mklehr@gmx.net>
(cherry picked from commit 8dd6061)
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending approval or rejection. This issue is pending approval. bug Something isn't working needs info Not enough information provided
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants