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

Failing to find users in the "Follow" command #254

Closed
RiderOfGiraffes opened this issue Dec 8, 2022 · 11 comments
Closed

Failing to find users in the "Follow" command #254

RiderOfGiraffes opened this issue Dec 8, 2022 · 11 comments

Comments

@RiderOfGiraffes
Copy link

RiderOfGiraffes commented Dec 8, 2022

Until recently I was able to use:

$ toot follow ${user}

and it would reliably find and follow said user. Now I'm constantly getting:

Account not found

This even when the user has been on the same instance for a time, has posted, has a profile, and has had replies.

This seems to have started when the instance was upgraded to 4.0, but that might be a coincidence.

(Added in edit) I haven't tested extensively, but quite often the follow fails, sending them a DM succeeds, and then another attempt at a follow still fails.

@weex
Copy link

weex commented Dec 8, 2022

Confirmed this and here are my logs:

$ toot follow --debug @user@example.com
DEBUG:toot:>>> GET https://example.com/api/v2/search
DEBUG:toot:>>> HEADERS: {('Authorization', '***CENSORED***'), ('User-Agent', 'toot/0.31.0')}
DEBUG:toot:>>> PARAMS:  {'q': '@user@example.com', 'resolve': True, 'type': 'accounts'}
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): example.com:443
DEBUG:urllib3.connectionpool:https://example.com:443 "GET /api/v2/search?q=%40user%40example.com&resolve=True&type=accounts HTTP/1.1" 200 None
DEBUG:toot:<<< <Response [200]>
DEBUG:toot:<<< {"accounts":[{"id":"109477759178010374","username":"user","acct":"user","display_name":"User","locked":false,"bot":false,"discoverable":null,"group":false,"created_at":"2022-12-08T00:00:00.000Z","note":"","url":"https://example.com/@user","avatar":"https://example.com/avatars/original/missing.png","avatar_static":"https://example.com/avatars/original/missing.png","header":"https://example.com/headers/original/missing.png","header_static":"https://example.com/headers/original/missing.png","followers_count":6,"following_count":10,"statuses_count":0,"last_status_at":null,"noindex":false,"emojis":[],"fields":[]}],"statuses":[],"hashtags":[]}
Account not found

All the more strange that the account IS found but that the code doesn't recognize it. The server in this case is running Mastodon v4.0.2 with modifications that should be unrelated to account/auth stuff.

@bmreiniger
Copy link

The relevant(?) code:

def _find_account(app, user, account_name):

Is the server name's existence/absence at fault? In @weex 's example the value of acct doesn't include it (being the same as the requester's?) but normalized_name would?

@weex
Copy link

weex commented Dec 8, 2022

normalized_name is just our argument minus the left @ symbol.

acct in this case is just the user part of the name, not the domain so it won't match. When I try to use just @user as the argument, unfortunately the server then comes back with a user whose display name inclues that name. That user has a username which doesn't include user so that one doesn't match either.

The reporter shared elsewhere that this works sometimes and I think the variable is whether that display name search comes back with a compatible username. So it's more likely to work on small servers.

What I don't know is whether we could trim the things being compared down to just the username or if that will cause some other false positives.

@RiderOfGiraffes
Copy link
Author

The "toot follow" command is failing (almost always) whether or not the instance name is included. The account that is using "toot" is on the same instance as the account being followed. So from an account on the instance mathstodon.xyx the following all fail:

$ toot follow gavan
$ toot follow @Gavan
$ toot follow gavan@mathstodon.xyz
$ toot follow @gavan@mathstodon.xyz

You are welcome to create a few test accounts on mathstodon.xyz to test this.

@RiderOfGiraffes
Copy link
Author

RiderOfGiraffes commented Dec 11, 2022

Just to let people know ... I'm really keen to see a way to get this sorted. If someone could find a work-around that lets it work for me, that would be enough for now ... it doesn't need to be fixed in general.

I'm unlikely to be able to help with the code, but I'm happy to help try things and provide logs.

And just to reiterate, sometimes it works. Here are the results of some recent attempts to follow people:

(remove the apostrophes for the actual usernames)

@'sathyanarayanan8998 Account not found
@'idm Account not found
@'JannaEismeer Account not found
@'Oldwordcel Account not found
@'deane Account not found
@'dvjc Account not found
@'longfangsong ✓ You are now following @'longfangsong
@'yairmau Account not found
@'TSPARKS ✓ You are now following @'TSPARKS
@'TingtingWu ✓ You are now following @'TingtingWu

They all exist on mathstodon.xyz

Thank you for any help you can give, and thank you again for a fabulous tool.

(Updated to avoid tagging people ... sorry for the inconvenience and confusion)

@RiderOfGiraffes
Copy link
Author

I've approved your account. I'm going off-line for 8 hours ... sorry I can't be available.

@idm
Copy link

idm commented Dec 11, 2022

Hello: I think I've been included on this issue because github found me in the comment above as @idm in github, but I'm not @idm on any Mastodon instance - I'm going to unsubscribe straight after I post this

@ihabunek
Copy link
Owner

@RiderOfGiraffes Please be careful, you're tagging a lot of people on github.

Regarding these "Account not found" errors, searching mastodon.xyz for these account name does not yield any results. You can try this in the web interface. For example, searching for "idm" finds only idmyn@social.coop and idmi@mas.to. Not sure why this happens, and I can't do anything about it.

Searching for a qualified name (e.g. idm@mathstodon.xyz) returns the expected account, but due to a bug in toot does not follow the account. I'll fix this.

@ihabunek
Copy link
Owner

BTW you can also use toot whois to check if this works, since it uses the same logic as toot follow, and it doesn't notify the user that you followed them.

@RiderOfGiraffes
Copy link
Author

Apologies about tagging people ... it was late, and I forgot. My fault.

Thanks for the clue about "toot whois". For my usage I really was intending to follow people, but it's useful to remember the alternative.

Thanks for the (impending) fix for the fully qualified follow ... that will solve my problem.

@ihabunek
Copy link
Owner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants