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

Error when trying to verify Email #168

Open
Blaubeeree opened this issue Nov 29, 2024 · 2 comments
Open

Error when trying to verify Email #168

Blaubeeree opened this issue Nov 29, 2024 · 2 comments

Comments

@Blaubeeree
Copy link

I recently set up a PDS with docker, but when I try to send a verification code to my email I always get the error "A request body was provided when none was expected".

image

Would be cool if someone could help me out here. If u need any other information from me just ask.

Logs:
56883/04/23 10:29AM 30 pid=8 hostname=1a829314528b name=pds req={"id":45,"method":"POST","url":"/xrpc/com.atproto.server.requestEmailConfirmation","query":{},"params":{},"headers":{"host":"bsky.blaubeeree.dns64.de","user-agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:133.0) Gecko/20100101 Firefox/133.0","transfer-encoding":"chunked","accept":"/","accept-encoding":"gzip, deflate, br, zstd","accept-language":"en-US,en;q=0.5","atproto-accept-labelers":"did:plc:ar7c4by46qjdydhdevvrndac;redact, did:plc:r55ow3tocux5kafs5dq445fy;redact","authorization":"Bearer did:plc:aenqtxknfdhqwjdglls3qdb7","dnt":"1","origin":"https://bsky.app","priority":"u=0","referer":"https://bsky.app/","sec-fetch-dest":"empty","sec-fetch-mode":"cors","sec-fetch-site":"cross-site","sec-gpc":"1","x-forwarded-for":"172.26.0.1","x-forwarded-host":"bsky.blaubeeree.dns64.de","x-forwarded-proto":"https","x-forwarded-server":"zoraxy-c371555c-64e8-4932-b118-d9c9b21db60b","x-real-ip":"172.26.0.1"}} res={"statusCode":400,"headers":{"x-powered-by":"Express","access-control-allow-origin":"*","cache-control":"private","vary":"Authorization, Accept-Encoding","content-type":"application/json; charset=utf-8","content-length":"89","etag":"W/"59-WLt4gQmGLWobaBLj3pBXg1SK9jU""}} responseTime=13 msg=request completed

docker-compose:

version: "3"

volumes:
  bluesky-data:

services:
  bluesky:
    image: ghcr.io/bluesky-social/pds:latest
    container_name: bluesky
    environment:
      LOG_ENABLED: true
      PDS_EMAIL_SMTP_URL: "smtps://resend:xxx@smtp.resend.com:465/"
      PDS_EMAIL_FROM_ADDRESS: "admin@blaubeeree.dns64.de"
      PDS_HOSTNAME: "bsky.blaubeeree.dns64.de"
      PDS_DATA_DIRECTORY: "/pds"
      PDS_BLOBSTORE_DISK_LOCATION: "/pds/blocks"
      PDS_BLOBSTORE_DISK_TMP_LOCATION: "/pds/temp"
      PDS_PLC_ROTATION_KEY_K256_PRIVATE_KEY_HEX: "xxx"
      PDS_JWT_SECRET: "xxx"
      PDS_ADMIN_PASSWORD: "xxx"
      PDS_DID_PLC_URL: "https://plc.directory"
      PDS_BSKY_APP_VIEW_URL: "https://api.bsky.app"
      PDS_BSKY_APP_VIEW_DID: "did:web:api.bsky.app"
      PDS_REPORT_SERVICE_URL: "https://mod.bsky.app"
      PDS_REPORT_SERVICE_DID: "did:plc:ar7c4by46qjdydhdevvrndac"
      PDS_CRAWLERS: "https://bsky.network"
    ports:
      - 1003:3000
    volumes:
      - bluesky-data:/pds
    restart: unless-stopped
@mmraz
Copy link

mmraz commented Dec 12, 2024

I ran into this problem as well. It appears to be non-breaking to the process as clicking the buttons still took the expected actions. I did note you do have an SMTP configuration defined. The URL for my relay does not end in a trailing /. Seems minor, but may be worth checking.

PDS_EMAIL_SMTP_URL="smtps://smtp-relay.gmail.com:465"

The error thrown is from an input validator for the email validation API call https://github.com/bluesky-social/atproto/blob/13636ba963225407f63c20253b983a92dcfe1bfa/packages/xrpc-server/src/util.ts#L92-L97

@Blaubeeree
Copy link
Author

Thanks for the link, I managed to debug it a bit further. The API seems to use the transfer-encoding header to check if the request body is empty and Zoraxy, the reverse proxy I use, adds transfer-encoding: chunked to the request which results in the error message.

With my limited knowledge in that topic I find it a little bit weird to use this header for checking for an empty request body and I couldn't find out why Zoraxy adds the header or how to disable it.

I managed to work around it for now by switching temporary to another reverse proxy to do the email verification. If anyone has a better solution please share it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants