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

[bug] unable to interact (including delete) post after delete-and-redraft parent + 500 ISE #2011

Closed
mirabilos opened this issue Jul 21, 2023 · 6 comments · Fixed by #3088
Closed
Labels
bug Something isn't working

Comments

@mirabilos
Copy link
Contributor

Describe the bug with a clear and concise description of what the bug is.

I’ve written a post (in a direct message), then replied to that, then later delete-and-redraft-ed the first one.

This now leads to severe misbehaviour:

One, it’s still in my Semaphore timeline, but I cannot delete it (“404”, but the log does not show the ID of the post itself but probably the one of its now-gone parent).

Two, if I zoom on it in Semaphore, I get “internet access failed, showing offline content”.

Three, if I start a new Semaphore in a new tab, then search for the toot URL copied from the other tab, I get a 500:

timestamp="21/07/2023 00:22:39.122" func=middleware.Logger.func1.1 level=ERROR latency=28.552173ms userAgent="Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0" method=GET statusCode=500 path=/api/v2/search error="Error #01: packageStatuses: error checking visibility of status 01H5TPKZC51NA28WE3822PS62F for account 01GS55SW7VWYN3BFRYCX5NW526: isStatusVisible: error populating status 01H5TPKZC51NA28WE3822PS62F: \"error populating status parent: no entries\",\"error populating status parent: no entries\"\n" requestID=yq0d6xc90400048tbnhg msg="Internal Server Error: wrote 54B"

What's your GoToSocial Version?

0.10.0-rc3 git-f431974

GoToSocial Arch

amd64 binary

What happened?

No response

What you expected to happen?

I’m fully expecting to be able to do any and all interaction with any status I posted myself, independent of what happened to any other toot, related or not.

This includes parent being gone (deleted (redrafted or not)), parent not being visible to me any more because the parent’s author blocked or fediblocked me or I blocked or fediblocked them, or because the instance of the parent is gone or no longer reachable or suddenly serves http on the https port (don’t laugh, it happened to one (hubzilla.eu) which I saw watching the log today).

How to reproduce it?

I assume posting, replying, then deleting the first post will do.

Anything else we need to know?

No response

@mirabilos mirabilos added the bug Something isn't working label Jul 21, 2023
@hikari-no-yume
Copy link
Contributor

I think I've just gotten this on my instance in similar circumstances. Actually, I think I've hit it a few times before, but I'm not sure.

I had a post with some replies, but once I delete the first post in the thread, navigating to the replies in Pinafore or even in the GTS web UI gives an error. Looking in my server's log:

timestamp="…" func=server.glob..func1.Logger.func13.1 level=ERROR latency="…" userAgent="…" method=GET statusCode=500 path=/@hikari/statuses/… clientIP=… error="Error #01: PopulateStatus: error populating status parent: sql: no rows in result set\nPopulateStatus: error populating status parent: sql: no rows in result set\n" requestID=… msg="Internal Server Error: wrote 705B"

(Some parts redacted for privacy.)

This is very annoying.

I want to say that in some previous version, restarting GoToSocial would fix this, but maybe that was a different 500 error, because it didn't work this time.

@mirabilos
Copy link
Contributor Author

As seen in #2363, #2058 would help with part of the problem (parent toot deleted), but maybe not other cases (parent poster blocked).

For those cases I don’t think we necessarily need thread context, just the ability to interact (reply, delete, …).

@mirabilos
Copy link
Contributor Author

Probably more of the same:

  1. I posted something (post A)
  2. I replied to it (post B)
  3. I delete-and-edit’ed post B in my client
  4. someone replied to post B (creating post C)
  5. I finished the editing, creating post B′

This results in the relationships B′←A and C←B and B no longer existing. So far, so good.

Now here the bugs:

  1. post C @-mentioned me, but it did not show up in my notifications (it did show up in the home timeline)
  2. I was unable to reply to post C (FediText returned a JSON Error; I can retry and pick out the corresponding server log if needed), very likely because GtS tried to load post B as context of post C and failed

I think these are all instances of the problem I mentioned in the OP, that GtS refuses to do things to when parts of the thread were deleted. Not quite as bad as refusing me to delete my own replies to deleted posts, but…

@snowkat
Copy link
Contributor

snowkat commented Apr 21, 2024

I've been working on a patch for this issue on my instance. To avoid making affected replies completely inaccessible, PopulateStatus and GetStatusParents in internal/db/bundb/status.go can just be made to log the error and act as though there's no parent. I'd be happy to submit a PR with my changes if desired.

@suoko
Copy link

suoko commented Jul 8, 2024

I've been working on a patch for this issue on my instance. To avoid making affected replies completely inaccessible, PopulateStatus and GetStatusParents in internal/db/bundb/status.go can just be made to log the error and act as though there's no parent. I'd be happy to submit a PR with my changes if desired.

You never submitted it, right?

@snowkat
Copy link
Contributor

snowkat commented Jul 9, 2024

You never submitted it, right?

Correct. I've finally submitted it at #3088

NyaaaWhatsUpDoc pushed a commit that referenced this issue Jul 10, 2024
…3088)

* [bugfix] Don't throw error when parent statuses are missing (#2011)

* Split missing parent status case from error check
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants