Websocket connection error code 7 undefined
See original GitHub issueDear aws contributors,
{[DEBUG] 05:15.670 AuthClass - getting session failed: "No userPool"}
ConsoleLogger.js:84 [DEBUG] 05:15.672 Credentials - setting credentials for guest
ConsoleLogger.js:84 [DEBUG] 05:15.673 Credentials - No Cognito Federated Identity pool provided
ConsoleLogger.js:100 {[DEBUG] 05:15.691 AWSPinpointProvider - ensure credentials error: "No Cognito Federated Identity pool provided"}
ConsoleLogger.js:100 {[DEBUG] 05:15.691 AWSPinpointProvider - ensure credentials error: "No Cognito Federated Identity pool provided"}
ConsoleLogger.js:84 [DEBUG] 05:15.693 AWSPinpointProvider - cannot send events without credentials, applicationId or region
ConsoleLogger.js:84 [DEBUG] 05:15.695 AWSPinpointProvider - cannot send events without credentials, applicationId or region
paho-mqtt.js:1050 WebSocket connection to 'wss://a12t2jth1f5u55.iot.us-east-2.amazonaws.com/mqtt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=***us-east-2%2Fiotdevicegateway%2Faws4_request&X-Amz-Date=20180918T150516Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=0fe9185dda08b65f607bb5865f6298dbd2997d3a8c7bb32408849464c204b782&X-Amz-Security-Token=***' failed: Error in connection establishment: net::ERR_CERT_SYMANTEC_LEGACY
LibraryFactory.ClientImpl._doConnect @ paho-mqtt.js:1050
LibraryFactory.ClientImpl.connect @ paho-mqtt.js:886
Client.connect @ paho-mqtt.js:2025
(anonymous) @ subscription-handshake-link.js:117
SubscriptionHandshakeLink._this.connect @ subscription-handshake-link.js:116
SubscriptionHandshakeLink._this.connectAll @ subscription-handshake-link.js:105
localhost/:1 Uncaught (in promise) {invocationContext: undefined, errorCode: 7, errorMessage: "AMQJS0007E Socket error:undefined."}
paho-mqtt.js:1050 WebSocket connection to 'wss://a12t2jth1f5u55.iot.us-east-2.amazonaws.com/mqtt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=***us-east-2%2Fiotdevicegateway%2Faws4_request&X-Amz-Date=20180918T150516Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=fade74ad9480e7f09d5012e87cbc59208d05c8d554d72404a04024a58fd0bccc&X-Amz-Security-Token=***' failed: Error in connection establishment: net::ERR_CERT_SYMANTEC_LEGACY
LibraryFactory.ClientImpl._doConnect @ paho-mqtt.js:1050
LibraryFactory.ClientImpl.connect @ paho-mqtt.js:886
Client.connect @ paho-mqtt.js:2025
(anonymous) @ subscription-handshake-link.js:117
SubscriptionHandshakeLink._this.connect @ subscription-handshake-link.js:116
SubscriptionHandshakeLink._this.connectAll @ subscription-handshake-link.js:105
localhost/:1 Uncaught (in promise) {invocationContext: undefined, errorCode: 7, errorMessage: "AMQJS0007E Socket error:undefined."}
ConsoleLogger.js:84 [DEBUG] 05:21.345 Credentials - getting credentials
ConsoleLogger.js:84 [DEBUG] 05:21.346 Credentials - picking up credentials
ConsoleLogger.js:84 [DEBUG] 05:21.346 Credentials - getting new cred promise
ConsoleLogger.js:84 [DEBUG] 05:21.347 Credentials - checking if credentials exists and not expired
ConsoleLogger.js:84 [DEBUG] 05:21.347 Credentials - need to get a new credential or refresh the existing one
ConsoleLogger.js:84 [DEBUG] 05:21.348 AuthClass - Getting current user credentials
ConsoleLogger.js:84 [DEBUG] 05:21.349 AuthClass - Getting current session
ConsoleLogger.js:100 {[DEBUG] 05:21.349 AuthClass - getting session failed: "No userPool"}
ConsoleLogger.js:84 [DEBUG] 05:21.350 Credentials - setting credentials for guest
ConsoleLogger.js:84 [DEBUG] 05:21.350 Credentials - No Cognito Federated Identity pool provided
ConsoleLogger.js:100 {[DEBUG] 05:21.350 AWSPinpointProvider - ensure credentials error: "No Cognito Federated Identity pool provided"}
ConsoleLogger.js:84 [DEBUG] 05:21.351 AWSPinpointProvider - cannot send events without credentials, applicationId or region
Anyone got this error too ?? Can’t figure out why, I have checked in other issues…
We are using the latest reactjs packages, still the subscription fails approx. 1 over 3 for every page refresh: A.
package.json:
"dependencies": {
"@babel/runtime": "^7.0.0",
"apollo-client": "^2.4.2",
"aws-amplify": "^1.1.1",
"aws-amplify-react": "^2.0.2",
"aws-appsync": "^1.3.4",
"aws-appsync-react": "^1.1.4",
"aws-sdk": "^2.316.0",
"enzyme": "^3.6.0",
"enzyme-adapter-react-16": "^1.5.0",
"graphql": "^14.0.2",
"graphql-tag": "^2.9.2",
"node-sass-chokidar": "^1.3.3",
"npm-run-all": "^4.1.3",
"react": "^16.5.1",
"react-apollo": "^2.1.11",
"react-dom": "^16.5.1",
"react-router-dom": "^4.3.1",
"react-scripts": "^1.1.5"
},
Result.js:
import OnCreate from "./GraphQL/OnCreate";
import QueryWithIndex from "./GraphQL/QueryWithIndex";
import { Component } from "react";
import { compose, graphql } from "react-apollo";
class ResultsT extends Component {
render() {
return (null);
}
}
const Results = compose(
graphql(
QueryWithIndex, {
props: ({ data: { subscribeToMore } }) => subscribeToMore({ document: OnCreate }),
})
)(ResultsT);
export default Results;
App.js
import AppSync from "./AppSync";
import awsmobile from './aws-exports';
import Results from './Results';
import Amplify from 'aws-amplify';
import AWSAppSyncClient from "aws-appsync";
import { Rehydrated } from "aws-appsync-react";
import React, { Component } from "react";
import { ApolloProvider } from "react-apollo";
Amplify.configure(awsmobile);
window.LOG_LEVEL='DEBUG';
const client = new AWSAppSyncClient({
url : AppSync.graphqlEndpoint,
region : AppSync.region,
auth: {
type: AppSync.authenticationType,
apiKey: AppSync.apiKey
},
disableOffline: true
});
class App extends Component {
render() {
return (
<Results />
);
}
}
const WithProvider = () => (
<ApolloProvider client={client}>
<Rehydrated>
<App />
</Rehydrated>
</ApolloProvider>
);
export default WithProvider;
Index.js
import App from './App';
import React from 'react';
import ReactDOM from 'react-dom';
ReactDOM.render( <App />, document.getElementById('root') )
export default gql(`
subscription {
onCreate {
__typename
id
awsIdentityId
}
}`
);
export default gql(`
query($limit: Int, $nextToken: String) {
queryWithIndex(limit: $limit, nextToken: $nextToken) {
items {
__typename
id
awsIdentityId
}
nextToken
}
}
`);
Issue Analytics
- State:
- Created 5 years ago
- Comments:16 (3 by maintainers)
Top Results From Across the Web
WebSocket connection to 'ws://localhost:9090/' failed: Error in ...
I tried to run websocket with the url var wsUri = "ws://localhost:55195/" and it says WebSocket connection to 'ws://localhost:55195/' failed: Have been looking ......
Read more >Connect failed: AMQJS0007E Socket error:undefined - HiveMQ
I got the error message: Connect failed: AMQJS0007E Socket error:undefined. I have the MQTTX client works with the mosquitto broker/server.
Read more >WebSocket: error event - Web APIs | MDN
The error event is fired when a connection with a WebSocket has been closed due to an error (some data couldn't be sent...
Read more >408078 – Client throws exception on connect error - Bugs
ERROR : WebSocket connection to 'ws://127.0.0.1/mqtt' failed: Unexpected ... Status code 404, Not Found undefined 7:AMQJS0007E Socket error:undefined.
Read more >Using MQTT Over WebSockets with Mosquitto
MQTT over websockets allows you to send data to an MQTT broker from a ... On connect I receive error 7, “AMQJS0007E Socket...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
confirmed using
ws
lib version^4.0.0
and it works fine. but not with^5.0.0
, I guess it is related with some major version breaking changesThanks for the info. I’m looking into it to figure out what’s going on.