Error Bad Request Media not Found (400) #24

Closed
opened 2024-04-25 06:01:41 +00:00 by ghose · 8 comments
ghose commented 2024-04-25 06:01:41 +00:00 (Migrated from codeberg.org)

Hi, thank you for Feed2Fedi

Installed: version Feed2Fedi 3.0.0 in Debian 11 python 3.9.2

I get this error with one feed (actually two diferent feeds in the same domain) when posting with Feed2Fedi

this is the error in the log.file

!!! Encountered error: (400, 'Bad Request', 'Bad Request: media  not found')

Log article to avoid repeat of error

I have tried to limit posting options (about media) without success, some other configs/sources work fine.

"bot_post_media": false,

I presume source is not perfectly formed, but tested with rss readers (two) and both article and media are available in the feed.

Any suggestion about this issue? Or is this originated from my fediverse instance? (the account I'm trying to use to post from)

thank you

And this is when I try to run it directly from command line:


user@server:~/.config/feed2fedi$ ~/.local/bin/feed2fedi -c /home/user/.config/feed2fedi/ttrss-publicados.json  >> test.log 
  File "/home/user/.local/share/pipx/venvs/feed2fedi/lib/python3.9/site-packages/feed2fedi/publish.py", line 111, in publish
    for attempt in retry_context(on=NetworkError, attempts=3):
  File "/home/user/.local/share/pipx/venvs/feed2fedi/lib/python3.9/site-packages/stamina/_core.py", line 439, in __iter__
    for r in _t.Retrying(
  File "/home/user/.local/share/pipx/venvs/feed2fedi/lib/python3.9/site-packages/tenacity/__init__.py", line 347, in __iter__
    do = self.iter(retry_state=retry_state)
  File "/home/user/.local/share/pipx/venvs/feed2fedi/lib/python3.9/site-packages/tenacity/__init__.py", line 314, in iter
    return fut.result()
  File "/usr/lib/python3.9/concurrent/futures/_base.py", line 433, in result
    return self.__get_result()
  File "/usr/lib/python3.9/concurrent/futures/_base.py", line 389, in __get_result
    raise self._exception
  File "/home/user/.local/share/pipx/venvs/feed2fedi/lib/python3.9/site-packages/feed2fedi/publish.py", line 113, in publish
    posted_status = await fediverse.post_status(
  File "/home/user/.local/share/pipx/venvs/feed2fedi/lib/python3.9/site-packages/minimal_activitypub/client_2_server.py", line 788, in post_status
    await ActivityPub.__check_exception(response=response)
  File "/home/user/.local/share/pipx/venvs/feed2fedi/lib/python3.9/site-packages/minimal_activitypub/client_2_server.py", line 979, in __check_exception
    raise ClientError(response.status_code, response.reason_phrase, error_message)

if I inmediatly run it again then it brings no error (nor published anything) as it reads source and finds "no new articles" so it does not try to publish.

any help pointed to a possible cause or solution would be appreciated. thanks

Edit

full .json BTW

{
    "feeds": [
        {
            "url": "https://source.rss",
            "prefix": "from TT-RSS :rssblobcattoma:\n",
            "max_attachments": "1"
        }
    ],
    "fedi_instance": "https://domain.tld",
    "fedi_access_token": "token-from-instance",
    "cache_max_age": 30,
    "cache_db_path": "./cache.sqlite",
    "bot_post_media": false,
    "bot_post_visibility": "public",
    "bot_post_template": "{title}\n\n{link}"
}
Hi, thank you for **Feed2Fedi** _Installed_: version Feed2Fedi 3.0.0 in Debian 11 python 3.9.2 I get this error with one feed (actually two diferent feeds in the same domain) when posting with Feed2Fedi this is the error in the log.file ``` !!! Encountered error: (400, 'Bad Request', 'Bad Request: media not found') Log article to avoid repeat of error ``` I have tried to limit posting options (about media) without success, some other configs/sources work fine. `"bot_post_media": false,` I presume source is not perfectly formed, but tested with rss readers (two) and both article and media are available in the feed. Any suggestion about this issue? Or is this originated from my fediverse instance? (the account I'm trying to use to post from) thank you And this is when I try to run it directly from command line: ``` user@server:~/.config/feed2fedi$ ~/.local/bin/feed2fedi -c /home/user/.config/feed2fedi/ttrss-publicados.json >> test.log File "/home/user/.local/share/pipx/venvs/feed2fedi/lib/python3.9/site-packages/feed2fedi/publish.py", line 111, in publish for attempt in retry_context(on=NetworkError, attempts=3): File "/home/user/.local/share/pipx/venvs/feed2fedi/lib/python3.9/site-packages/stamina/_core.py", line 439, in __iter__ for r in _t.Retrying( File "/home/user/.local/share/pipx/venvs/feed2fedi/lib/python3.9/site-packages/tenacity/__init__.py", line 347, in __iter__ do = self.iter(retry_state=retry_state) File "/home/user/.local/share/pipx/venvs/feed2fedi/lib/python3.9/site-packages/tenacity/__init__.py", line 314, in iter return fut.result() File "/usr/lib/python3.9/concurrent/futures/_base.py", line 433, in result return self.__get_result() File "/usr/lib/python3.9/concurrent/futures/_base.py", line 389, in __get_result raise self._exception File "/home/user/.local/share/pipx/venvs/feed2fedi/lib/python3.9/site-packages/feed2fedi/publish.py", line 113, in publish posted_status = await fediverse.post_status( File "/home/user/.local/share/pipx/venvs/feed2fedi/lib/python3.9/site-packages/minimal_activitypub/client_2_server.py", line 788, in post_status await ActivityPub.__check_exception(response=response) File "/home/user/.local/share/pipx/venvs/feed2fedi/lib/python3.9/site-packages/minimal_activitypub/client_2_server.py", line 979, in __check_exception raise ClientError(response.status_code, response.reason_phrase, error_message) ``` if I inmediatly run it again then it brings no error (nor published anything) as it reads source and finds "no new articles" so it does not try to publish. any help pointed to a possible cause or solution would be appreciated. thanks ## Edit full .json BTW ``` { "feeds": [ { "url": "https://source.rss", "prefix": "from TT-RSS :rssblobcattoma:\n", "max_attachments": "1" } ], "fedi_instance": "https://domain.tld", "fedi_access_token": "token-from-instance", "cache_max_age": 30, "cache_db_path": "./cache.sqlite", "bot_post_media": false, "bot_post_visibility": "public", "bot_post_template": "{title}\n\n{link}" } ```
marvin8 commented 2024-04-26 03:52:47 +00:00 (Migrated from codeberg.org)

Thanks for raising this issue.

Having had a look at it, I think it might be an issue where the media attachment wasn't successfully uploaded but no error was raised.

I will make some refinements in that are and release a new version in the next week or two.

PS:

I was trying to have a look at your source rss feed, but the I am unable to connect to the feed url in the .json you shared. Is that the correct feed url?

Thanks for raising this issue. Having had a look at it, I think it might be an issue where the media attachment wasn't successfully uploaded but no error was raised. I will make some refinements in that are and release a new version in the next week or two. PS: I was trying to have a look at your source rss feed, but the I am unable to connect to the feed url in the .json you shared. Is that the correct feed url?
ghose commented 2024-04-26 13:12:22 +00:00 (Migrated from codeberg.org)

no! it's redacted as instance/token

this is a real one I've tried to use

tested in two readers (and w3c validator)

thank you for your time and work

no! it's redacted as instance/token [this is a real one I've tried to use](https://ynh.kalabradas.club/ttrss/public.php?op=rss&id=-2&is_cat=0&q=&key=thwmjf662602d3d8b51) tested in two readers (and w3c validator) thank you for your time and work
marvin8 commented 2024-05-04 05:33:17 +00:00 (Migrated from codeberg.org)

Hoping this is addressed in release 3.1.0

Hoping this is addressed in release 3.1.0
ghose commented 2024-05-05 04:28:44 +00:00 (Migrated from codeberg.org)

I will update and report here.

I will update and report here.
marvin8 commented 2024-08-29 03:07:53 +00:00 (Migrated from codeberg.org)

Closing issue as I assume it has been addressed in release 3.1.0

Closing issue as I assume it has been addressed in release 3.1.0
MrClon commented 2024-10-22 18:55:44 +00:00 (Migrated from codeberg.org)

Got this error with gotosocial and posts without medias. For such posts minimal-activitypub sent to server media_ids[] = '', and gotosocial (since some moment) can't handle this. Probably it's trying find media with ID = ''
Fix problem just by removing this line:
codeberg.org/marvinsmastodontools/minimal-activitypub@6ba8dfee8c/src/minimal_activitypub/client_2_server.py (L775)

Got this error with gotosocial and posts without medias. For such posts `minimal-activitypub` sent to server `media_ids[] = ''`, and gotosocial (since some moment) can't handle this. Probably it's trying find media with ID = '' Fix problem just by removing this line: https://codeberg.org/marvinsmastodontools/minimal-activitypub/src/commit/6ba8dfee8c1388cbeb257b088eeb51d797719ea5/src/minimal_activitypub/client_2_server.py#L775
marvin8 commented 2024-10-23 04:25:29 +00:00 (Migrated from codeberg.org)

Thanks @MrClon for creating PR 14 in minimal_activitypub

I'll merge your PR and will then release a new version of Feed2Fedi in the next few days.

Thanks @MrClon for creating [PR 14 in minimal_activitypub](https://codeberg.org/marvinsmastodontools/minimal-activitypub/pulls/14) I'll merge your PR and will then release a new version of Feed2Fedi in the next few days.
marvin8 commented 2024-10-28 07:33:25 +00:00 (Migrated from codeberg.org)

This should be fixed now in Release 3.1.1

This should be fixed now in Release 3.1.1
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
marvin8/feed2fedi#24
No description provided.