Plume-org / Plume

Federated blogging application, thanks to ActivityPub (now on https://git.joinplu.me/ — this is just a mirror)
https://joinplu.me
GNU Affero General Public License v3.0
2.11k stars 133 forks source link

Liking and boosting posts does not work #367

Closed makew0rld closed 5 years ago

makew0rld commented 5 years ago

When I like or boost a post (on the same instance), it just takes me to a domain.com/posturl/{like,boost} url, which is just a blank page. When I reload the blog's page, the like or boost count still remains at 0, and it seems I haven't affected anything.

trinity-1686a commented 5 years ago

On what instance is that, and what browser are you using? I tried on fediverse.blog with Firefox and it worked just fine.

marek-lach commented 5 years ago

I have now tested boosting, and liking and following a user from the fediverse.blog instance, and I found that I can boost and like their post, but cannot follow them at the moment.

Their account is hosted on the cafe.sunbeam.city instance, therefore I think that the cafe.sunbeam.city server is just misconfigured somehow, or their installation of Plume was not done correctly.

I cannot like, or boost posts when logged into the cafe.sunbeam.city instance. I am not sure if they use the latest master branch, or not. But updating fediverse.blog from the latest repo may give some idea if the bug is in the master branch, or if it's just a specific server misconfiguration.

screenshot 2018-12-21 at 14 02 56 screenshot 2018-12-21 at 14 04 31

Simply put: The inability to boost/like/follow users IS NOT present in the branch that is currently in use at the fediverse.blog instance, whichever branch is currently in use there.

f0x52 commented 5 years ago

@marek-lach cafe.sunbeam.city is running the latest master The console regularly gives errors, which might be related:

Dec 21 14:39:49 ns3059072 plume[21861]: thread '<unnamed>' panicked at 'instance::shared_inbox: user error', src/libcore/option.rs:1008:5
Dec 21 14:40:06 ns3059072 plume[21861]: POST /inbox/ application/activity+json:
Dec 21 14:40:06 ns3059072 plume[21861]:     => Matched: POST /inbox (shared_inbox)
Dec 21 14:40:06 ns3059072 plume[21861]: thread '<unnamed>' panicked at 'instance::shared_inbox: user error', src/libcore/option.rs:1008:5
Dec 21 14:41:25 ns3059072 plume[21861]: POST /inbox/ application/activity+json:
Dec 21 14:41:25 ns3059072 plume[21861]:     => Matched: POST /inbox (shared_inbox)
Dec 21 14:41:26 ns3059072 plume[21861]: thread '<unnamed>' panicked at 'instance::shared_inbox: user error', src/libcore/option.rs:1008:5
Dec 21 14:41:46 ns3059072 plume[21861]: POST /inbox/ application/activity+json:
Dec 21 14:41:46 ns3059072 plume[21861]:     => Matched: POST /inbox (shared_inbox)
Dec 21 14:41:46 ns3059072 plume[21861]: thread '<unnamed>' panicked at 'instance::shared_inbox: user error', src/libcore/option.rs:1008:5
marek-lach commented 5 years ago

@fdb-hiroshima So, upon further investigation I found that:

1.) It is possible to boost and like a post from fediverse.blog and other instances like plume.mastodon.host, which is not possible on cafe.sunbeam.city, which, as @f0x52 says is running the latest master.

2.) While it is possible to boost and like a post from instances like fediverse.blog, or plume.mastodon.host, it isn't possible to follow people even from these instances, because upon trying to follow a user on fediverse.blog, or plume.mastodon.host, the following error appears:

screenshot 2018-12-21 at 14 02 56 screenshot 2018-12-21 at 17 01 38 screenshot 2018-12-21 at 16 57 52

The latest master branch, running on cafe.sunbeam.city displays this instead when trying to follow someone:

screenshot 2018-12-21 at 17 20 53

which means that the follow was successful.

I hope this helps with diagnosing the problem better.

trinity-1686a commented 5 years ago

This is odd, when trying to follow the very same account as your first screenshot (RadioAngel) from my own account on fediverse.blog, I'm not getting an error. How are testing? Are you using the follow link or entering the url manually?

marek-lach commented 5 years ago

@fdb-hiroshima This is indeed very odd. But I tested in a different browser now (Opera, previously Firefox) and got the same result as before. Even trying to follow an entirely different user (a user also hosted on fediverse.blog as myself) returned the same 'page could not be found' error page:

screenshot 2018-12-22 at 00 33 31

I am thinking it may have something to do with access rights? Like, there must be a difference between various administrative rights that an administrator has, versus a typical user has? Something like that... I have no idea what else it could be...

makew0rld commented 5 years ago

@marek-lach This seems to be a different issue that the original one I proposed. Do you or @fdb-hiroshima have any ideas, based on cafe.sunbeam.city's version and error log that @f0x52 provided? Would a reinstall work? How was fediverse.blog installed?

marek-lach commented 5 years ago

@makeworld-the-better-one I don't know myself, as I cannot code myself, as @fdb-hiroshima can, but I think these two problems are closely related, so solving one may well solve the other?

trinity-1686a commented 5 years ago

@marek-lach I don't have an admin account, and I'd be surprised it was something like that anyway, we check for privileges only on very few routes. Under Firefox, if you go in the developers tools (press F12 on while on the page), and switch to the Network tab before loading the following page, when opening the follow link, what Method the query to the follow file did your browser use? @makeworld-the-better-one you're right, we should open an other issue to continue the discussion further. The logs @f0x52 shared are symptomatic of a federation problem, which is not the error you observed. What you saw was an error 500 while liking/resharing. The error, in logs, should look something like that:

POST /~/someBlog/some-title/like application/x-www-form-urlencoded:
    => Matched: POST /~/<blog>/<slug>/like (create)
thread '<unnamed>' panicked at '[some error message]', src/libcore/option.rs:1008:5
trinity-1686a commented 5 years ago

@makeworld-the-better-one both errors are most likely unrelated, one is an internal server error, an error we did not handle, your's look more like a dead-link, maybe a browser extension rewriting the query or idk what

makew0rld commented 5 years ago

@fdb-hiroshima So what do you think of reinstalling? Could that fix the issue, since fediverse.blog doesn't have it?

marek-lach commented 5 years ago

@fdb-hiroshima From what I can tell, there's a 404, missing document error when I try to follow a user on fediverse.blog.

Before following:

screenshot 2018-12-22 at 01 06 13

After following:

screenshot 2018-12-22 at 01 06 31

This is the error report from Firefox when trying to like a post on cafe.sunbeam.city:

screenshot 2018-12-22 at 01 11 40

I see the 500 internal server error code, with the 'POST' method as the main cause of 'like', or 'boost' not working on cafe.sunbean.city?

Since ''the 500 Internal Server Error is a server-side error, meaning the problem probably isn't with your computer or internet connection but instead with the website's server'', I suspect that reinstalling, or somehow reconfiguring the installation on the servers of cafe.sunbean.city might help?

Hope this is somehow of use to you @fdb-hiroshima . Thank you for all your kind efforts so far!

trinity-1686a commented 5 years ago

@makeworld-the-better-one I think Plume does not have much state else than the db content, reinstalling while keeping the database would probably change nothing, and flushing the db is not an option. I really need the part of the log that correspond to your problem to help in anything.

@marek-lach Are you using something like a browser extension that might rewrite the query or page content? Your browser is emitting a GET request to a resource existing only with the POST verb, and after verification, there is no link going to that resource via GET.

marek-lach commented 5 years ago

@fdb-hiroshima Disabled all plugins, cleared all history, still have the same problem both in Firefox, and in freshly installed Chrome.

Here is what Chrome's console gives when trying to like a post on cafe.sunbeam.city, allegedly running the latest 'master' branch:

screenshot 2018-12-22 at 16 09 13

And this is what Chrome's console gives when liking a post on fediverse.blog, whichever branch that's running:

screenshot 2018-12-22 at 16 11 33

So where cafe.sunbean.city gives a just a 500 server error on like, there doesn't seem to be any document/redirect/resource mentioned that a like should redirect to even in the console.

fediverse.blog succesfully likes a post, with a 303 code on like.

https://en.wikipedia.org/wiki/HTTP_303

elegaanz commented 5 years ago

I guess this is an issue with the ap_url of the Like we try to create (https://github.com/Plume-org/Plume/blob/master/src/routes/likes.rs#L24), because of the constraints that were recently introduced (Fediverse.blog is not yet using this version of the code). This field is probably duplicated for some reason. But I can't be sure this is the issue until we have more precise logs.

f0x52 commented 5 years ago

@fdb-hiroshima this is the error when I try to favorite a post:

Dec 23 01:25:54 ns3059072 plume[21861]: POST /~/SunbeamCity/test/like application/x-www-form-urlencoded:
Dec 23 01:25:54 ns3059072 plume[21861]:     => Matched: POST /~/<blog>/<slug>/like (create)
Dec 23 01:25:54 ns3059072 plume[21861]: thread '<unnamed>' panicked at 'macro::insert: Error saving new $table: DatabaseError(UniqueViolation, "duplicate key value violates unique constraint \"likes_unique_ap_url\"")', src/libcore/result.rs:1009:5
trinity-1686a commented 5 years ago

ok, this is what @BaptisteGelez guessed, which is definitely a bug