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

Remote account follow attempt can 404 #8

Open
simon-frankau opened this issue Nov 9, 2022 · 1 comment
Open

Remote account follow attempt can 404 #8

simon-frankau opened this issue Nov 9, 2022 · 1 comment

Comments

@simon-frankau
Copy link

Hi.

TL;DR: Remote account follow 404s on mastodon.xyz. Could be WAI, could be user error. I have a workaround, just thought you might like to know.

I've been using madonctl, but I'm assuming the underlying issue is in this repo.

My account is on mastodon.xyz. When I run the following command, I get the following error message:

$ ./madonctl account follow '@bcantrill@mastodon.social'
Error: API query (v1/follows) failed: bad server status code (404): Not Found

My understanding of the Mastodon API (and Go debugging!) is very limited, but I believe this should call FollowRemoteAccount, and hit the v1/follows endpoint, which... mastodon.xyz doesn't know about? Looking at https://docs.joinmastodon.org/api/, I don't see this as part of the official API, so I'm wondering if this is either unofficial, or not supported by all versions (e.g. whatever mastodon.xyz runs).

As I said, I don't know much about the API, so this is all guesswork. :) OTOH, perhaps it's still useful to make the library more universally applicable (unless I'm just using madonctl incorrectly).

I do have a workaround, so this is no longer an issue for me. I used the search functionality to get an account id:

./madonctl accounts follow $(./madonctl search --resolve $ACCT | grep -o 'Account ID: [^ ]*' | sed 's/Account ID: //')

Very ugly but got the job done.

I realise this report is not very detailed, I'm not sure what's useful to you, but I'm more than happy to help if you need more information.

Thanks,
Simon Frankau.

@McKael
Copy link
Owner

McKael commented Nov 11, 2022

Hi.

Hi Simon,

TL;DR: Remote account follow 404s on mastodon.xyz. Could be WAI, could be user error. I have a workaround, just thought you might like to know.

I've been using madonctl, but I'm assuming the underlying issue is in this repo.

Indeed.

My understanding of the Mastodon API (and Go debugging!) is very limited, but I believe this should call FollowRemoteAccount, and hit the v1/follows endpoint, which... mastodon.xyz doesn't know about? Looking at https://docs.joinmastodon.org/api/, I don't see this as part of the official API, so I'm wondering if this is either unofficial, or not supported by all versions (e.g. whatever mastodon.xyz runs).

As I said, I don't know much about the API, so this is all guesswork. :) OTOH, perhaps it's still useful to make the library more universally applicable (unless I'm just using madonctl incorrectly).

I think you're absolutely right, the API has been removed a while ago (2018??) and I didn't notice.

The API documentation is not really clear, but I guess madon should do exactly what you've done with madonctl: a search API call followed by a follow call.

./madonctl accounts follow $(./madonctl search --resolve $ACCT | grep -o 'Account ID: [^ ]*' | sed 's/Account ID: //')

Very ugly but got the job done.

FWIW, I guess the subshell could be simplified with:

./madonctl account search -o template --template '{{ .id }}' "$ACCT"

I realise this report is not very detailed, I'm not sure what's useful to you, but I'm more than happy to help if you need more information.

This was actually really helpful, thank you for the detailed report!

I'll try to find some time to fix it in the madon library.

Mikael

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

2 participants