kensanata / mastodon-archive

Archive your statuses, favorites and media using the Mastodon API (i.e. login required)
https://alexschroeder.ch/software/Mastodon_Archive
GNU General Public License v3.0
371 stars 33 forks source link

500 Internal Server Error #112

Open ka-m-be opened 1 month ago

ka-m-be commented 1 month ago

I use mastodon-archiver to fetch from a friendica server, so this might not be happening with Mastodon. It worked very well for months, but now I get

Traceback (most recent call last):
  File "/Users/xxx/Library/Python/3.11/bin/mastodon-archive", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/Users/xxx/Library/Python/3.11/lib/python/site-packages/mastodon_archive/__init__.py", line 347, in main
    args.command(args)
  File "/Users/xxx/Library/Python/3.11/lib/python/site-packages/mastodon_archive/archive.py", line 129, in archive
    statuses = mastodon.fetch_remaining(
               ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxx/Library/Python/3.11/lib/python/site-packages/mastodon/utility.py", line 255, in fetch_remaining
    current_page = self.fetch_next(current_page)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxx/Library/Python/3.11/lib/python/site-packages/mastodon/utility.py", line 214, in fetch_next
    return self.__api_request(method, endpoint, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxx/Library/Python/3.11/lib/python/site-packages/mastodon/internals.py", line 297, in __api_request
    raise ex_type('Mastodon API returned error', response_object.status_code, response_object.reason, error_msg)
mastodon.errors.MastodonInternalServerError: ('Mastodon API returned error', 500, 'Internal Server Error', None)

This happens when updating an existing archive and also when starting fresh. I know it's a server problem, but would be grateful for hints. Could it be because of pagination size? Total number of posts? A faulty post or data in the API request?

The version is fresh from the repo.

kensanata commented 4 weeks ago

I have no idea. If the server gives back a 500 Internal Server Error, I think I'd search the server for logs. Perhaps there's more to be found, there? If you get into a discussion with the Friendica developers, make sure to tell them that the tool you're using uses Mastodon.py. Perhaps somebody can write a tiny Python application that logs in and fetches some statuses from a Friendica, just to see whether whether it is reproducible? If so, that small application could be appended to the issue for Friendica devs to use.