bluesky-social / atproto

Social networking technology created by Bluesky
Other
6.88k stars 486 forks source link

Cannot get other's repo #3059

Closed azulika closed 7 hours ago

azulika commented 1 day ago

Describe the bug

Trying to get a repo of other accounts than myself via com.atproto.sync.getRepo

To Reproduce

Steps to reproduce the behavior:

  1. either directly try to access https://bsky.network/xrpc/com.atproto.sync.getRepo?did=xxx or run a code something like this

    bluesky_client = Client()
    bluesky_client.login(BLUESKY_ID, BLUESKY_PASSWORD)
    data = bluesky_client.com.atproto.sync.get_repo(
        {"did": get_did(user_id)}
    )
  2. The code results in:

atproto_client.exceptions.BadRequestError: Response(success=False, status_code=400, content=XrpcError(error='RepoNotFound', message='Could not find repo for DID: did:plc:xxx'), headers
={'x-powered-by': 'Express', 'access-control-allow-origin': '*', 'cache-control': 'private', 'vary': 'Authorization, Accept-Encoding', 'ratelimit-limit': '3000', 'ratelimit-remaining': '2996', 'ratelimit-r
eset': '1732156515', 'ratelimit-policy': '3000;w=300', 'content-type': 'application/json; charset=utf-8', 'content-length': '98', 'etag': 'W/"62-T0bDExQmJTbqUaqoBhMRPsNRXB8"', 'date': 'Thu, 21 Nov 2024 02:30:29 GMT', 'keep-alive': 'timeout=90', 'strict-transport-security': 'max-age=63072000'})

As for https://bsky.network/xrpc/com.atproto.sync.getRepo?did=xxx, it results in:

403 Forbidden
Request forbidden by administrative rules.

Expected behavior

Other's repos can be downloaded.

Details

Additional context It works fine when I try to get my own account's repo through the same method(bluesky_client.com.atproto.sync.get_repo with authentication). Getting other's repo also worked when I tried it about a month ago, but now the exact same code suddenly stopped working. What happened? Is bluesky now restricting users from getting other people's repos?

yamarten commented 1 day ago

It seems to be confusing two different problems.

Client usually use your PDS (*.host.bsky.network) API. This can only be obtained from the repo in that PDS.

On the other hand, bsky.network refers to the relay. I was able to get all the repo until recently, but now it seems impossible.

Currently, the relay is in a mess with the upgrade process, so it may be a related (and possibly permanent) impact. (ref. #3036)

In general, if you want to get a repo, it is recommended to getRepo for the PDS address obtained by ID resolution.

azulika commented 7 hours ago

I see, didn't know about the upgrade. Thanks!