Errors

All errors result in the connection being broken and require the below fixes before connecting again.

Table 13-4 Potential Streaming API Errors and Fixes

Error Returned How does this Happen? How to Fix Error Type

429 Too Many Requests

Sending more than 150 requests to upgrade to WebSocket and sending the requests within 2 minutes from the same application.

Retry after 2 minutes.

HTTP

499

The client disconnected before the server was able to send a response to the initial HTTP upgrade, so the WebSocket was not opened.

Ensure your calling architecture is leaving the connection open long enough for the server to reply.

HTTP

1000 Normal Closure

The WebSocket was disconnected by the caller

Reconnect from the Authentication message.

WebSocket

1001 Going Away: Going away

Maintenance by Oracle

Reconnect from the Authentication message.

WebSocket

1006 Abnormal Closure: Abnormal Closure

Connection broken

Wait 4 seconds and then reconnect from the Authentication message.

WebSocket

Error: Unexpected server response: 400

Incorrect key or URL

  • Check the sha256 hash of the application key is correct.

  • Check that the application key is subscribed to consume events and that the event subscription is approved.

  • Check the URL matches the environment listed in the Developer Portal.

  • Check that the environment is Streaming Enabled.

HTTP

4400 Error: Bad Request - Invalid GraphQL Subscription

Invalid field in subscription message

  • Check the response body which includes details of the invalid field. For example, "Cannot query field XYZ on type ABC" or "Value for <FIELD> is invalid - Expected ABC to match pattern ZYZ."

  • Check that the fields in the subscription request match the OHIP schema Github link.

  • Reconnect from the Authentication message.

WebSocket

4401 Error: Unauthorised - Invalid credentials

Invalid credentials sent in the Authentication message

  • Check you are sending the application key, not the sha256 hash of the application key.

  • Check that the application is subscribed to consume events and that the event subscription is approved.

  • Check that the oAuth token is valid and current.

WebSocket

4403 Error: Forbidden - You are not authorized to access this resource

Invalid chainCode in subscription message

  • Check that the chain code in the subscription message matches the chain code being accessed. This is the value at the start of the integration that the user sent to obtain the oAuth token.

  • Check that streaming is enabled for the environment you are accessing

  • Reconnect from the Authentication message.

WebSocket

4406 Error: Subprotocol not acceptable

Failing to include the WebSocket protocol header.

Include the header "Sec-WebSocket-Protocol: graphql-transport-ws"

WebSocket

4408 Error: Disconnect

Connection initialization time out

Send the Authentication message within 5 seconds of opening the connection.

WebSocket

4409 Too Many Requests

More than one client or process is trying to consume events from the same gateway using the same application key and chain code.

This often happens in the following circumstances:
  1. When consuming events in code and in Postman/GraphiQL.

  2. Where multiple developers are trying to consume events from a single application.

  3. Where an application has spawned additional threads all consuming events from the same gateway, application key, and chain code.

  4. When disconnecting without sending the Complete message.

Ensure that only one client or process consumes events from a given gateway using a given application key and chain code.

Ensure that you send the Complete message before disconnecting from the WebSocket.

WebSocket

4429 Error: Too Many Requests

Resending the subscription message when the connection is already open

Resending the connection_init message when the connection is already open

The WebSocket connection is already open, so it cannot be reopened. Look for the connection_ack message and do not resend connection_init if you have received a connection_ack.

WebSocket

4500 Server Error - No configuration found. If this problem persists, contact Oracle Customer Support at the Customer Support Portal.

A Subscribe message was sent but either there are no events subscribed for this application, or the subscription is not approved by the environment owner.

Check that the application is subscribed to events and shows as approved for that environment.

WebSocket

4500 Unable to find configuration between Application, Chain, and Environment. Please ensure your application has access. If this problem persists, contact Oracle Customer Support at the Customer Support Portal.

A piece of internal configuration might be missing.

Ensure your application is approved to consume events and that the URL you are calling is a streaming enabled gateway. If the problem persists, contact Oracle Customer Support at the Customer Support Portal.

WebSocket

4500 Internal Server Error received 6 minutes after sending the subscribe message.

When subscribing, the consuming application should wait up to 6 minutes before receiving any events. If the subscription is valid and an internal issue has occurred, this message is received 6 minutes after sending the subscribe message.

Reconnect and send the Authentication message and then send the Subscription message.

WebSocket

4501 Socket closed with error 4501 Not Supported Environment for subscriptions

Connecting to an environment that does not support streaming Business Events.

Ensure the environment shows as "Streaming Enabled" on the Environments tab of the developer portal. Streaming Business Events from OPERA requires a minimum of OPERA Cloud version 22.3.0.1.

WebSocket

4504 Socket closed with error 4504 Service Timeout

This error occurs when the OCI Streaming Service goes down for more than 30 seconds.

Try again after 15 seconds. If this problem persists, contact Oracle Customer Support at the Customer Support Portal.

Websocket