cquest / tootbot

python bot to clone tweets to a mastodon account
GNU Affero General Public License v3.0
101 stars 35 forks source link

Mastodon API returned error: 422, Unprocessable Entity, Validation failed: Text translation missing: en.statuses.cannot_send #9

Closed moonlies closed 1 year ago

moonlies commented 5 years ago

Hello @cquest , when i run tootbot it is able to create an account but then crashes with the following output:

tootbot app created on instance botsin.space
Traceback (most recent call last):
  File "tootbot.py", line 124, in <module>
    spoiler_text=None)
  File "</usr/local/lib/python3.5/dist-packages/decorator.py:decorator-gen-42>", line 2, in status_post
  File "/usr/local/lib/python3.5/dist-packages/mastodon/Mastodon.py", line 77, in wrapper
    return function(self, *args, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/mastodon/Mastodon.py", line 1214, in status_post
    return self.__api_request('POST', '/api/v1/statuses', params, headers = headers)
  File "/usr/local/lib/python3.5/dist-packages/mastodon/Mastodon.py", line 2235, in __api_request
    error_msg)
mastodon.Mastodon.MastodonAPIError: ('Mastodon API returned error', 422, 'Unprocessable Entity', 'Validation failed: Text translation missing: en.statuses.cannot_send')

It then creates the .secret files. The app on the server is not visible in the web interface, so i assume it is not created permanently. I created an app manually and copied the secrets into the corresponding files. This did not change the behaviour. I was using https://botsin.space

moonlies commented 5 years ago

I found out that the access was not a problem. Apparently parsing this tweet causes the error: https://twitter.com/jasonhickel/status/1120394044515979264 This is what printing c as well as toot_media in the last if statement showed the following:

c: A climate general strike? This is the sensible next step in building pressure on our governments and politicians to act with the urgency that the ecological crisis requires. Thanks, @GretaThunberg, for advancing this idea. https://www.theguardian.com/environment/2019/apr/22/greta-thunberg-backs-general-strike-climate-change-environment toot_media: []

The program should have never reached the print as if toot_media is not None should prevent it from execution, right? I'm confused.