C9Glax / tranga-website

Web-Frontend for Tranga-API
GNU General Public License v3.0
17 stars 10 forks source link

Adding Kavita login details has no effect #19

Closed Jacksaur closed 10 months ago

Jacksaur commented 10 months ago

Managed to add the API-URI of Tranga, and Gotify, but I can't seem to add my login details for Kavita at all. I enter the same URL as I use to access Kavita, followed by my main account's username and password. Hit enter, all fields clear, configured icon still shows as no.
I've tried both just hitting enter and using the update button. Checked several times, copied the URL directly from when I was accessing Kavita and triple checked my login details, everything's correct.

I'd provide logs, but I can't seem to find any?

db-2001 commented 10 months ago

I also noticed this behavior, I'll be helping out with some of the website stuff so I'll look into it, but I think the source of the error is something on the tranga-api side which @C9Glax will have to take care of for now

C9Glax commented 10 months ago

Hey there, to get logs run docker logs tranga-api. Without that I can't even speculate sadly...

Jacksaur commented 10 months ago

No change in logs whenever I hit enter. I retried my Gotify details, and that gives an expected "Creating notification connector Gotify", followed by adding Gotify, followed by "Exporting notification connectors".

I entered false info into the Komga fields, and when I pressed enter that still at least gave a "Creating library connector Komga" before going silent. It seems my Kavita details aren't being submitted at all, perhaps?

C9Glax commented 10 months ago

Okay pressing enter doesn't even send a request to the api...

Jacksaur commented 10 months ago

Admittedly I didn't try clicking the update button with the logs open, since I'm at work on mobile and the UI is cut off. I'll give it a go when I get home.

C9Glax commented 10 months ago

No what I meant is that for me no request was going out. However I noticed that there was a parameter missing in the url... And that if object/connector creation failed, it wouldn't even output anything to log.

Could you try now?

Jacksaur commented 10 months ago

That got it saved: Took me a while to ensure the update fully applied, still learning the intracicies of Docker, apologies. Adding the server details and hitting enter populated the log and now shows a success sign under the Kavita listing, with the IP remaining in place. Also persists after a full container restart.

By testing a Manga though, it failed to update Kavita. Watching the logs, it seems Port number is not saved on entry? [10/30/2023 18:03:07.0 ] NetClient | GET http://192.168.0.8/api/Library -> 404: Not Found

My address for Kavita is 192.168.0.8:5000. No Gotify notifications are going through either, and that's on port 8070. Going off the assumption that the greyed out text is an exact representation of what's saved: It seems only the Tranga API URI actually has its port number saved currently.

C9Glax commented 10 months ago

I run everything through a reverse proxy on subdomains, so I guess those get cut-off... Shouldn't be too hard to fix

C9Glax commented 10 months ago

Okay quick question: Does it show the port when first creating the connector, and only after restart it disappears?

Jacksaur commented 10 months ago

Disappears from the field the instant I hit enter, in the logs it shows as being added without Port number as well.

C9Glax commented 10 months ago

When build is done it should work, had a wrong Regex setup on the api, that would filter out ports

Jacksaur commented 10 months ago

Argh, so close now! Ports save, Gotify alerted just fine, that side is all dealt with. I tried to replace Kavita's IP with one that included the port number and encountered the same issue of it not saving yet again. Presuming it was related to overwriting the value, I stopped the container, manually deleted the libraryConnectors.json file, and then tried to add through the Web UI again once the container was back up. No dice, we're back to the first issue where the Kavita fields have zero effect. All other fields trigger output in the logs as expected.

Thank you for the swift support with all this, by the way.

C9Glax commented 10 months ago

Yea somewhere along the way it reverted https://github.com/C9Glax/tranga-website/commit/0b09df67b9c3252ef087bffba4cde050ac736ca8 could you clear your cache and try again?

I had to re-add in https://github.com/C9Glax/tranga-website/commit/eb13e6e37d9da690aff8c562150f53392e0f58ba

And I had to re-push just now to cuttingedge, as I had only made that change on master... what a mess (19:50 UTC+1)

Jacksaur commented 10 months ago

Still the same. Did a docker system prune -a and restarted my stack before testing, that does make sure it's on the absolute latest version right?

db-2001 commented 10 months ago

Prune gets rid of images you're not using (i.e. old ones) and restarting is just restarting. If you're using portainer to manage containers (I would recommend it). You can from the interface, recreate:

image

And make sure you toggle the switch to pull the latest image:

image

If you're using docker compose, then a simple docker compose down and then docker compose up -d in the command line will automatically pull the latest image

Jacksaur commented 10 months ago

Recreated through Portainer, and did a docker compose pull for good measure, still the same issue I'm afraid.

C9Glax commented 10 months ago

Okay for me it's working, however the settings say that is isn't configured until 1/2 seconds later and a refresh. That is because the api is still busy getting the token from kavita, and thus not fully created yet, when the website already is trying to fetch the new settings.

Jacksaur commented 10 months ago

Finally, it's working! I remade my compose file in a separate folder from scratch, tested there, and the fields save and everything now. Copied it over my original stack and it's still working then. Must have been my fault breaking something somewhere earlier on, terribly sorry about that. The final barrier, it seems like only the first Library refresh request goes through after a comic is downloaded. My Comics library with ID 1 gets refreshed, but my Manga (2) doesn't (Nor does my third). The logs imply that all requests to the API went through properly, so this may actually be an issue on Kavita's end, not yours. Maybe it's hitting a rate limit?

https://i.imgur.com/gzi6xom.png

C9Glax commented 10 months ago

The 200 indicates that Kavita has accepted the request, maybe it's a staggered scan, and the repeated trigger interrupts the previous one? idk, seems to be a Kavita issue

Jacksaur commented 10 months ago

Fair enough, I'll take it up with the Kavita author.

Thanks for all the effort you've put in here: This software is going to make my roommate very happy.