Skip to content
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

When creating a new ATProto account, handle existing DNS record #1072

Closed
snarfed opened this issue May 21, 2024 · 4 comments
Closed

When creating a new ATProto account, handle existing DNS record #1072

snarfed opened this issue May 21, 2024 · 4 comments
Labels

Comments

@snarfed
Copy link
Owner

snarfed commented May 21, 2024

Right now, when we create a new ATProto repo and DID, if our _atproto DNS record for handle resolution already exists, we crash. We should handle that and recover instead. Example log below; exception is google.api_core.exceptions.Conflict. Docs don't help much. Haven't found a way to tell it to overwrite/replace existing records, so I may need to either catch the exception or look up the record first. cc @gabboman

adding GCP DNS TXT record for _atproto.gabboman.app.wafrn.net.ap.brid.gy. "did=did:plc:qh4q7p2njfcpbwjxswox7bcy"
<class 'google.api_core.exceptions.Conflict'>: 409 POST https://dns.googleapis.com/dns/v1/projects/brid-gy/managedZones/brid-gy/changes?prettyPrint=false: The resource 'entity.change.additions[_atproto.gabboman.app.wafrn.net.ap.brid.gy.][TXT]' named '_atproto.gabboman.app.wafrn.net.ap.brid.gy. (TXT)' already exists
Traceback (most recent call last):
...
  File "workspace/protocol.py", line 1501, in receive_task
    return PROTOCOLS[obj.source_protocol].receive(obj=obj, authed_as=authed_as,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "workspace/protocol.py", line 930, in receive
    from_user.enable_protocol(proto)
...
  File "workspace/models.py", line 467, in enable_protocol
    enable()
  File "workspace/atproto.py", line 352, in create_for
    changes.create()
  File "google/cloud/dns/changes.py", line 233, in create
    api_response = client._connection.api_request(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "google/cloud/_http/__init__.py", line 494, in api_request
    raise exceptions.from_http_response(response)
google.api_core.exceptions.Conflict: 409 POST https://dns.googleapis.com/dns/v1/projects/brid-gy/managedZones/brid-gy/changes?prettyPrint=false: The resource 'entity.change.additions[_atproto.gabboman.app.wafrn.net.ap.brid.gy.][TXT]' named '_atproto.gabboman.app.wafrn.net.ap.brid.gy. (TXT)' already exists
@snarfed
Copy link
Owner Author

snarfed commented Jun 30, 2024

We still see a steady trickle of these, roughly one a day on average: https://console.cloud.google.com/errors/detail/COibqNv9r7ynFg?project=bridgy-federated

@snarfed snarfed added the now label Jun 30, 2024
@snarfed
Copy link
Owner Author

snarfed commented Jul 11, 2024

I wonder if #1063 will mostly or entirely prevent this.

@snarfed
Copy link
Owner Author

snarfed commented Jul 15, 2024

Nope, we're still seeing a trickle.

snarfed added a commit that referenced this issue Jul 24, 2024
snarfed added a commit that referenced this issue Jul 24, 2024
@snarfed
Copy link
Owner Author

snarfed commented Jul 25, 2024

Done! And I fixed (I think) pretty much everyone who hit this in the last 30d or so.

@snarfed snarfed closed this as completed Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant