befora/Kuboo

Loading Assets failed!

griefie opened this issue · 19 comments

Hi,
i have Ubooquity 2.1.1 running on a raspberry and behind a reverse proxy(nginx). OPDS is enabled and using the feed works(tested with a browser)
When i open my library with your app(1.0.9) i am not able to open the comics directly. Meaning not downloading them but opening page by page. It says Loading assets, then it wait for approx 30 seconds and then it says "Loading Assets failed!" I thought i will try adding the local address of the feed - 192....:2202/opds-comics, but for some reason, the app says that it cant connect. If i open it in the browser it works.

Downloading and then opening the comics works.

I noticed that opening the comics page by page is a bit slow, when i do it on the web interface. Could be longer than 30 sec.

Do you have any idea, if this is the app or is it my server set up.

my phone is a pixel 2 xl with android 9.0

Can you try to adjust the server format, it is real picky and needs to have the last "/" character at the end and "http://" or "https://" depending on your server setup.

Wrong: 192....:2202/opds-comics
Correct: http://192....:2202/opds-comics/

Also check out this thread, maybe it might help to allow the remote bookmark api through.

Thanks for the reply!

I already have the trailing slash. I guess otherwise the whole connection would not have worked if i didn't.

The funny thing is that on my tablet, there are no issues. Page by page works just fine.

I can imagine that the resolution of the phone might be a problem in this case. If the app requests an image size which takes a longer time for the server to deliver it, the app might just time out. But of course you are the one who knows, what is going on :)

Thanks for the proxy hits, i will try them out!

I think I broke something with the cache. If you delete the bookmark and re-add it, it should work. Sorry about this one, it slipped through the cracks.

If it has to do with what you suggest, the solution to delete and add the bookmark, does not help. As i said, on my tablet, it works correctly.

Ok this issue sounded similar to another user's problem. All my tests pass on both emulator and hardware devices. This is real odd it works for your tablet and not your phone. I would still ask you to try a clean uninstall & reinstall to get rid of old cache signatures.

same story :) i might connect the phone to a proxy to check on what requests it is making, because i really think that the request is just not coming through. but of course it could just be smth with android 9. i am going to post when i have more info. this with the proxy might take some days.

Is it failing to retrieve the bookmark or failing to load the bitmap images? If it is the bookmark failing then the reader activity won't even load, if it is the bitmap images then the reader activity will load but images will show an error.

if it is the local address it is the failing to load the whole bookmark. but i am not that concerned about this, because i won't use the local address at all. it was just a test.

after i have successfully added the bookmark, i cannot open the comics page by page. when i open the comics it says loading assets and then in about 30 seconds it displays a toast "Loading Assets Failed"

i can however download them and then open them.

This issue sounds so similar to this.

Here was the solution:

Weeelllll, I've screamed too early.
Sorry for bothering you with this without trying things myself, haha! 
I did have to know the URL though, 
but apparently giving 192.168.2.20:2202/comics/user-api/ > domain.tld/comics/user-api/ full access works straight away! 
So no need to do anything from your side haha!

Nevermind, if the message is "Failed to load assets!" then that means a preload failed and cancelled the book load. Did you try a clean install? Sorry to ask again, just want to cover everything.

Stale. Please re-open or post a new issue if you are still having issues.

I have the same issue across two devices (Samsung S8 and Amazon Kindle)... I tried the stable version and the latest beta update. The feed shows fine in browser and opens as expected, but on both devices I receive a failed to load assets error. I first tried it on the Kindle (I haven't loaded the app recently, but it worked on an older version without issues) and when it didn't work, I went over to my S8 and did a fresh install. I do have something in common with the other user that had the issue though. I'm currently running Ubooquity on a Pi server in a Docker environment.. Same version and same image. I can see all available comics, but opening them fails.
Edit: I am in the process of updating the Ubooquity server to 2.1.2. I'll report if it fixes the issue.

@ghostyroasty Here is the download task

I think I will disable the "resume" logic because of your issue. It will mean longer load times but at least it will work and be consistent. Ubooquity doesn't split up pdf and epubs for easy streaming which is a shame because you have to download the entire thing. Could you try to clear application cache in system settings. This will force the old download to be cleared and start a new one.

I will work on it tomorrow, thanks for the input.

Great, thanks!! Updating did not fix the issue, so maybe your fix will work. Thanks again.

@ghostyroasty 0b31ddc

It was an easy fix, I uploaded it to 1.1.5_beta2 and will be available within the hour. 🦃

Resume is no longer implemented but caching still is:
Does not exist -> Download as usual
Does exist but incomplete -> Delete incomplete and download new
Does exist and complete -> Consume it

@griefie
Hi, in your first post you said you are using a nginx reverse proxy.
I'm trying to set one up, it works for the web app, but not for kuboo.
Could you please share your configuration ?

Issue has returned for me using 1.1.5.

@tomtom602
it has been a while, since you asked... i am sorry for that. however here is my config:

location / {
    add_header         Strict-Transport-Security "max-age=xxxxxxxxxx; includeSubDomains" always;
    add_header         Vary "Accept-Encoding";
    add_header         Access-Control-Allow-Origin *;
    proxy_http_version 1.1;
    proxy_set_header   X-Real-IP $remote_addr;
    proxy_set_header   Host $host;
    proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
    proxy_pass         http://x.x.x.x:xxxx/
  }
  location /api/websocket {
    proxy_pass https://x.x.x.x:xxxx/api/websocket;
    proxy_set_header Host $http_host;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
  }

please, be aware that i have replaces some numbers with "x"

@ghostyroasty I am unable to recreate your problem.

I noticed that opening the comics page by page is a bit slow, when i do it on the web interface. Could be longer than 30 sec.

Maybe the raspberry can't handle multiple streams due to prefetching, etc. I am going attribute this issue to your server setup. Sorry but there is nothing I can do. Hope you work it out.