Skip to content

WebSocket connection succeeds but no AIS messages are ever received #30

Open

Description

@fl-pires

Hi,

I'm experiencing an issue with the AISStream WebSocket service.

The client successfully connects to the WebSocket endpoint and sends the subscription message, but it never receives any AIS messages. The connection remains open indefinitely without any errors or data.

Environment:
Operating System: Windows Server
Python: 3.13
websockets: latest version
FastAPI + Uvicorn (although the same behavior occurs in a standalone Python script)

Endpoint:
wss://stream.aisstream.io/v0/stream
Subscription
{
"APIKey": "<valid_api_key>",
"BoundingBoxes": [[[-90, -180], [90, 180]]],
"FilterMessageTypes": ["PositionReport"]
}

I also tested without FilterMessageTypes and with specific MMSI filters. The behavior is exactly the same.

Observed behavior:
WebSocket connection is established successfully.
Subscription message is sent successfully.
The connection remains open.
No exceptions are raised.
No messages are ever received.
The server does not close the connection.

Application log:
AISstream: bbox=[[[-90.0, -180.0], [90.0, 180.0]]] | types=['PositionReport'] | mmsis=all vessels
SUBSCRIBE: {"APIKey":"","BoundingBoxes":[[[-90.0,-180.0],[90.0,180.0]]],"FilterMessageTypes":["PositionReport"]}
Connected to AISstream

At this point the client waits indefinitely. The async for raw in websocket: loop is never entered because no frames are received.

Additional tests:
Tested from multiple Windows machines.
Internet connectivity is working.
TCP connection to stream.aisstream.io:443 succeeds.
WebSocket handshake succeeds.
The same behavior occurs using both:
a minimal Python example from the documentation;
a production application.
Expected behavior

After sending the subscription message, the server should start streaming AIS messages matching the subscription.

Question:
Has there been any recent change to the WebSocket API, authentication, or subscription protocol that could explain this behavior?
Is there any known service issue, account restriction, or additional requirement that would cause the connection to remain open while delivering no messages?

Thank you.

Activity

  1. TritonTechnical-BusinessSystems commented on Aug 11, 2026

    @TritonTechnical-BusinessSystems

    I'm hitting this exact same issue — independently, on a completely different stack (Node.js 22 / TypeScript, native WebSocket, Linux), so this doesn't look environment-specific.

    Symptom, precisely: WebSocket handshake succeeds, subscription message sends successfully, connection stays open (well past the documented 3-second "no subscription received" auto-close, so the subscription is apparently being accepted), and then — nothing. No error frame, no AIS messages, ever. Have to close the connection myself after a timeout.

    What I've ruled out, to save you some diagnostic back-and-forth:

    Not a request-format bug — cross-checked every field name/structure in my subscription message against your auto-generated OpenAPI models (ais-message-models) and the working golang/main.go reference in this repo. Both confirm APIKey, BoundingBoxes in [lat,lon] order, MetaData, etc. are exactly what I'm sending.
    Not a filter issue — reproduces identically with zero filters at all (just APIKey + a fully global BoundingBoxes), which per your docs should be a ~300 msg/s firehose. Also reproduces with FiltersShipMMSI set to real MMSIs, and with FilterMessageTypes set/unset.
    Not a stale/bad key — reproduces on two separately-generated API keys (rotated one to rule out a key-specific problem). Neither ever returned the documented {"error": "Api Key Is Not Valid"} response, so both appear to be accepted as valid.
    Not a client library quirk — reproduces identically with both Node's native WebSocket and the ws npm package.
    Not firewall/network — TCP + TLS + WS handshake completes cleanly every time; this is on a normal cloud VM with unrestricted outbound access.
    Given all of that, it really looks like something account/backend-side rather than a client bug. Happy to email logs and both API keys to support@aisstream.io if that's the fastest path to diagnosing it — let me know.

  2. abdulkerimakten commented on Aug 11, 2026

    @abdulkerimakten

    Hi, I am experiencing the same issue.

    The WebSocket connection is established successfully and the subscription message is sent, but no AIS messages are received afterward. The script just waits indefinitely / produces no output.

    I tested with:

    • Valid API key loaded from .env
    • wss://stream.aisstream.io/v0/stream
    • Example bounding boxes from the repository
    • Without message filters
    • With FilterMessageTypes: ["PositionReport"]
    • On both Ubuntu and Windows

    In all cases, the connection succeeds but raw_count remains 0 and no messages are received.

    Example output:

    connected
    subscription sent
    30s timeout: no AIS message received yet, still waiting...
    raw_count: 0
    parsed_count: 0

    Is this related to API key activation, account approval, or a server-side stream issue?

  3. dmonizer commented on Aug 12, 2026

    @dmonizer

    +1 exactly the same symptoms. connection succeeded, no signals for the whole world. fresh api key.

  4. able-macaroni-pacemaker commented on Aug 13, 2026

    @able-macaroni-pacemaker

    1+, starting around 2026-08-05 13:30 UTC

  5. dmonizer commented on Aug 14, 2026

    @dmonizer

    is there something we as the community can help with?

  6. able-macaroni-pacemaker commented on Aug 17, 2026

    @able-macaroni-pacemaker

    I have been receiving data again since 2026-08-17 07:49 UTC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions