Athou / commafeed

Google Reader inspired self-hosted personal RSS reader.
https://www.commafeed.com
Apache License 2.0
2.82k stars 377 forks source link

Intermittent 500 ERROR on endpoint /rest/category/entries (public instance) #1125

Closed Crul closed 1 year ago

Crul commented 1 year ago

Describe the bug Intermittent 500 ERROR on endpoint https://www.commafeed.com/rest/category/entries (of the public instance). Full JSON response on bottom

The only pattern I've found is that the requests that fail are all very close to 1 min while the requests that succeed are all under 1 minute. So I would bet on a timeout.

To Reproduce Unfortunately, the error is inconsistent and does not always fail. Requesting categories with a lot of feeds makes it more likely to fail, but not guaranteed. This is one URL that fails a lot for me:

https://www.commafeed.com/rest/category/entries?id=31741044&order=desc&readType=unread&offset=0&limit=50&keywords=

Environment

Additional context Full JSON response:

{
    "status":"500",
    "url":"/rest/category/entries",
    "message":"javax.servlet.ServletException: org.hibernate.TransactionException: Unable to rollback against JDBC Connection",
    "cause0":"javax.servlet.ServletException: org.hibernate.TransactionException: Unable to rollback against JDBC Connection",
    "cause1":"org.hibernate.TransactionException: Unable to rollback against JDBC Connection",
    "cause2":"java.sql.SQLException: Connection has already been closed.",
    "servlet":"jersey"
}

Thanks!

Athou commented 1 year ago

You're right, there is a 1 minute timeout on queries. The server is getting old and the disks are slow :( As to what can be done about it, please see this comment I made earlier this week.

Crul commented 1 year ago

I fully agree with CPUGPU's words, only difference being that I have only donated once.

Again, thanks for all the work.

Athou commented 1 year ago

I managed to find a server with SSD drives at the same cost as the current server. I migrated users and feeds but I could not migrate entries because the old drives were so slow that it would have taken weeks.

Can you give it a try https://new.commafeed.com/ ? It should be way faster than the current server :)

I'll monitor things for a while, if everything is smooth I'll consider switching commafeed.com to this instance.

Crul commented 1 year ago

It should be way faster than the current server :)

It is, I get consistent <8 segs on the request that time outs half the time in the other server.

I could not migrate entries because the old drives were so slow that it would have taken weeks.

No complains at all from my side.

Thank you very much!

CPUGPU commented 1 year ago

WOW! More than 800 unread entries and the All category showed all in just 2-3 seconds after clicking "log in". Night and day difference. Thank you!

Unfortunate we lose old entries, but that would happen if I switch to self-hosting anyway, so not a big problem. I converted all my starred entries to a folder of bookmarks so no loss there either.

Should we just start using the new server as production? Or do you want to do a formal announcement and transition to get it onto https://commafeed.com?

Athou commented 1 year ago

I'll monitor the new server for a few days to make sure everything is ok, then I'll make an announcement of some sort before redirecting commafeed.com to the new server and removing new.commafeed.com I'll probably also reset the database of the new server to the state of the old server to make sure the new server is up to date with the changes made by users between today and then.

Athou commented 1 year ago

Server migration is done, so I'm going to close this. If it happens again please open a new issue! :)