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

Community is gone from instance after changing name by a remote moderator #3075

Closed
ludrol opened this issue Jun 13, 2023 · 10 comments
Closed
Labels
area: federation support federation via activitypub bug Something isn't working

Comments

@ludrol
Copy link
Contributor

ludrol commented Jun 13, 2023

  • [Yes ] Did you check to see if this issue already exists?
  • [ Yes] Is this only a single bug? Do not put multiple bugs in one issue.
  • [ No] Is this a question or discussion? Don't use this, use https://lemmy.ml/c/lemmy_support .
  • [ No] Is this a UI / front end issue? Use the lemmy-ui repo.

Issue Summary

A summary of the bug.

Steps to Reproduce

  1. Became mod from another instance in my community
  2. Changed name of community from another instance
  3. Community no longer exists in original instance

Technical details

My account ludrol@szmer.info changed name of !aoblightnovel@bookwormstory.social
and now link https://bookwormstory.social/c/aoblightnovel is 404
and https://bookwormstory.social/c/aoblightnovel@bookwormstory.social has our community

@ludrol ludrol added the bug Something isn't working label Jun 13, 2023
@ludrol
Copy link
Contributor Author

ludrol commented Jun 13, 2023

https://github.com/Neshura87 @Neshura87 has log of the instance

@Neshura87
Copy link
Contributor

Neshura87 commented Jun 13, 2023

Not exactly log but I know what happened pretty much exactly, just a few unknowns.

ludrol edited a community title with his remote instance account which I had made mod.

Not sure if lemmy-ui or lemmy messed up but the put request for the community switched the 'remote' column in public.community from true to false. Setting the bool to true again fixed the problem immediately. I assume there are some missing sanity checks in the backend or erroneous data sent in the frontend.

I'll see if i can find the lemmy log of the incident

edit: nevermind, log is lost as I recreated the docker container once in an attempt to debug the problem

@Nutomic Nutomic added the area: federation support federation via activitypub label Jun 13, 2023
@Nutomic
Copy link
Member

Nutomic commented Jun 13, 2023

Seems like remote moderators arent well tested yet. To fix it, this line needs to be changed to local: None so the value doesnt get overwritten. Same in the function below.

Nutomic pushed a commit that referenced this issue Jun 14, 2023
…#3088)

* Set insert and update form "local" to None

* Extra space to retrigger woodpecker

* Resolve code review request

#3088 (comment)

* Remove extra space after None,
@Nutomic
Copy link
Member

Nutomic commented Jun 14, 2023

#3088

@obosob
Copy link

obosob commented Jun 20, 2023

Just an FYI, I know the fix is in. But this doesn't only break the URL but it also breaks federation. The community stops syncing between instances. And the only way to fix it is for a sysadmin of the home instance to apply a fix to the DB.

@Neshura87
Copy link
Contributor

Probably a good idea to add a DB check for the next update that changes all communities to local where the url domain is the same as the local instance

@awdsns
Copy link

awdsns commented Jun 20, 2023

Any chance an automatic DB check to revert this could still make v0.18?

If not, could somebody please post an "SQL for Dummies" instruction how to fix it manually?

makotech222 pushed a commit to hexbear-collective/lemmy that referenced this issue Jun 20, 2023
…e(false) (LemmyNet#3088)

* Set insert and update form "local" to None

* Extra space to retrigger woodpecker

* Resolve code review request

LemmyNet#3088 (comment)

* Remove extra space after None,
@kartikynwa
Copy link
Contributor

kartikynwa commented Jun 21, 2023

Would be nice if someone could crosscheck.

For finding out if there are any local communities affected by this bug. Replace domain.tld with your instance's domain. For https://lemmy.ml it is lemmy.ml. You can cross check in the instance table as well. If there are affected local communities this query will return a number greater than zero:

SELECT COUNT(*)
FROM community c
JOIN instance i ON c.instance_id=i.id
WHERE i.domain='domain.tld' AND not c.local;

For updating these rows:

UPDATE community c
SET local=TRUE
FROM instance i
WHERE i.id=c.instance_id AND i.domain='domain.tld';

@jgeorgeson
Copy link

Based on the SQl snippets, shall I assume that v0.18 won't include the auto DB check to fix communities? This doesn't seem to be fixed for affected community on enterprise.lemmy.ml (running v0.18-rc5 as I type)

https://enterprise.lemmy.ml/c/usmlr

@awdsns
Copy link

awdsns commented Jun 22, 2023

I created a new issue #3256 to discuss the application of an automatic fix, since a discussion in a closed issue has bad visibility and probably isn't the right place anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: federation support federation via activitypub bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants