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
requests.exceptions.HTTPError: 422 Client Error: Unprocessable Entity for url: #68
Comments
Hi @vserbu ! |
I'm still on the 1.0.1 version. How do I update on newer version? |
If you installed it using pip, you can upgrade to the latest version using this command:
|
I did it, but the error is the same. It starts to post tweets and then blocks on one (in that example it was on second one) and that is it. Is there any cache to clear or something? I tried to limit the size of the tweet because I taught maybe it could be some big video or image, but it is not. |
Would you mind sharing the output of your second try? And maybe also your current config file (with the tokens or any sensitive info removed). |
Yes, I'm seeing it is somewhat different: ... |
It looks like the Mastodon instance is probably reporting the wrong type for this attachment:
Hence, failing the validation. The instance wrongly expects an ISO (.iso) file (or something else than an .mp4) to be uploaded based on running the
This shouldn't block you from using the bot normally, for these cases we skip the upload of the problematic media and try to publish the tweet's text anyway. |
I've published a release candidate version which won't fail due to the empty status (it will skip posting it), so at least it's not a fatal error and you could continue using the bot for publishing the rest of the tweets if you so choose.
However, the |
I'll give it a try, tnx :) |
It's working, but I have a new problem. Visibility is suddenly not public even dough I stated visibility: "public" already. Now the new tweets are not in LOCAL timeline, only in my HOME timeline. |
Nice catch!
|
Still the same problem :( |
Really? That's odd, I thought I had found the issue. |
|
It looks like it's working now! |
Great! Maybe I should've clarified that it only would apply to new posts published after upgrading to 1.0.3rc3 (the ones published already would've kept the wrong visibility). I'll include these fixes on the next stable release as well. |
And thank you for finding these issues and reporting them as well! |
Thank you for quick response :) |
I think we have another Issue regarding this.
And that is it....stuck. When I removed that account (#) everything else went ok. |
I may have an idea of what's happening there.
|
It is not stucked any more but we are back with the similar error as on the beggining.
|
Hmm... I'm wondering if you're hitting Mastodon's character limit (500 per toot) with a quoted tweet. Would you mind testing out my theory by running this version?:
|
It's working, you were absolutely - right! tnx! |
Nice! |
When truncating a toot, it might be worth truncating before the signature, to avoid breaking links: see https://respublicae.eu/@Europarl_DE/108068732034451913 for an example. I see that's actually what you were trying to do, not sure what went wrong: |
@nemobis
|
Il 03/04/22 20:23, robertoszek ha scritto:
it should be fixed on 1.0.3rc8, feel free to give it a spin and see if the changes solved it:
Yes, thank you! All good on 1.0.3rc9.
|
I'm still seeing some HTTP 422. Consistently for this one account:
I think it might be one of these tweets (cw: controversial political content): |
@nemobis Maybe the culprit is some other tweet. |
Il 10/04/22 23:40, robertoszek ha scritto:
Maybe the culprit is some other tweet.
Yeah I don't know, I'll add some logging locally to find out.
|
I keep getting HTTP 422 for https://respublicae.eu/@EP_Defence possibly due to https://nitter.eu/EP_Defence/status/1513526853532897283#m . Could it be because there are 4+2 images there considering the quoted tweet? |
@nemobis Right! Nice catch, Mastodon only allows 4 images per post, possibly that's the cause. (Misskey and Pleroma allow 16). I've added the upper limit for Mastodon to
|
Some quote-tweets with 5+ photos are still getting an HTTP 422 on the most recent release, though I'm not quite sure why (I even hacked the Mastodon code to raise the limit to 8). Culprit seems to be https://nitter.eu/andreykovatchev/status/1534110522722996224#m
|
On the other hand a bunch of posts which previously failed are now succeeding, like https://respublicae.eu/@Cedefop/108732982556276877 from https://nitter.eu/Cedefop/status/1542082206641840129 . 🤷 |
I'm getting an HTTP 422 while trying to post (I think) this https://nitter.it/NatalieAmiri/status/1586320608538902528#m , a tweet with a video quoting another tweet with a video. It would be easier to debug if the exception printed the original tweet ID too. |
A RT https://nitter.it/EmmanuelMacron/status/1591869166046380035#m failed too, maybe any quote tweet with video fails? |
Ah, for the first tweet you mentioned it's probably because I don't think Mastodon supports multiple videos on the same post: Hmm I need to think what's the best way to handle that. I assume it's better to drop the video on the quoted/retweeted tweet instead of the one attached to the user you're mirroring. You'll lose some context either way, which is a shame. Ah, I see it's the same problem for the other tweet too (multiple videos): I'll open a new issue to keep track of it, as the "422 Unprocessable Entity" error is too generic and could be multiple things causing it. |
Il 18/11/22 18:06, robertoszek ha scritto:
I'll open a new issue to keep track of it, as the "422 Unprocessable Entity" error is too generic and could be multiple things causing it.
Thanks!
|
For some reason, some of the twitter account result in error, and previously those accounts worked. Last one is @Ultrekillblast and before that it was official @startrek account. I got this:
...
ℹ 2022-02-22 18:23:31,681 - pleroma_bot - INFO - tweets gathered: 27
ℹ 2022-02-22 18:23:34,148 - pleroma_bot - INFO - tweets to post: 27
ℹ 2022-02-22 18:23:34,150 - pleroma_bot - INFO - (1/27)
✖ 2022-02-22 18:23:34,402 - pleroma_bot - ERROR - Exception occurred (cli.py:502)
Traceback (most recent call last):
File "/home/mastodon/.local/lib/python3.8/site-packages/pleroma_bot/_pleroma.py", line 103, in post_pleroma
response.raise_for_status()
File "/home/mastodon/.local/lib/python3.8/site-packages/requests/models.py", line 960, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 422 Client Error: Unprocessable Entity for url: https://salocha.online/api/v1/media
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/mastodon/.local/lib/python3.8/site-packages/pleroma_bot/cli.py", line 482, in main
post_id = user.post_pleroma(
File "/home/mastodon/.local/lib/python3.8/site-packages/pleroma_bot/_pleroma.py", line 117, in post_pleroma
response.raise_for_status()
File "/home/mastodon/.local/lib/python3.8/site-packages/requests/models.py", line 960, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 422 Client Error: Unprocessable Entity for url: https://salocha.online/api/v1/media
...
The text was updated successfully, but these errors were encountered: