Closed arelaxend closed 4 years ago
Hi @arelaxend, could you share the operating system and browser version where you are seeing this error?
Hi @appwiz,
MacBookPro15,1 : macOS 10.13.6 (17G2307), Darwin 17.7.0
Google Chrome: Version 68.0.3440.106 (Build officiel) (64 bits)
It looks like it's working on Safari Version 12.0 (13606.2.11) 👍
Edit: well, I don't know much about the socket library mqttv3.1, so, my contribution won't prob. go any further, and you are 🥇(still, it looks like a very nice api)
Thanks for the info. I'm looking into it to figure out what's going on.
Hi @arelaxend can you paste the keys of what is inside under aws-exports.js file. (so you replace the values with ####s)
@elorzafe Oups.. i've just seen your post. 🔢
// WARNING: DO NOT EDIT. This file is Auto-Generated by AWS Mobile Hub. It will be overwritten.
// Copyright 2017-2018 Amazon.com, Inc. or its affiliates (Amazon). All Rights Reserved.
// Code generated by AWS Mobile Hub. Amazon gives unlimited permission to
// copy, distribute and modify it.
// AWS Mobile Hub Project Constants
const awsmobile = {
'aws_app_analytics': 'enable',
'aws_cloud_logic': 'enable',
'aws_cloud_logic_custom': [{"id":"###","name":"###","description":"","endpoint":"https://###.execute-api.us-east-2.amazonaws.com/prod","region":"us-east-2","paths":["/###"]}],
'aws_cognito_identity_pool_id': '###',
'aws_cognito_region': 'us-east-2',
'aws_content_delivery': 'enable',
'aws_content_delivery_bucket': '###',
'aws_content_delivery_bucket_region': 'us-east-2',
'aws_content_delivery_cloudfront': 'enable',
'aws_content_delivery_cloudfront_domain': '###.cloudfront.net',
'aws_custom_domains': [{"domain":"###.io","apiId":"###"}],
'aws_mobile_analytics_app_id': '###',
'aws_mobile_analytics_app_region': 'us-east-1',
'aws_project_id': '###',
'aws_project_name': '###',
'aws_project_region': 'us-east-2',
'aws_resource_name_prefix': '###',
'aws_user_files': 'enable',
'aws_user_files_s3_bucket': '###',
'aws_user_files_s3_bucket_region': 'us-east-2',
}
export default awsmobile;
got this error when using it on nodejs
Could you paste the stack trace please?
Query and Mutation works fine. But subscription failed.
LibraryFactory.ClientImpl._disconnected(), paho-mqtt.js:1617
LibraryFactory.ClientImpl._on_socket_error(), paho-mqtt.js:1450
anonymous(), paho-mqtt.js:181
onError(), event-target.js:128
emit(), events.js:182
EventEmitter.emit(), domain.js:442
abortHandshake(), websocket.js:648
req.on(), websocket.js:535
emit(), events.js:182
EventEmitter.emit(), domain.js:442
parserOnIncomingClient(), _http_client.js:546
parserOnHeadersComplete(), _http_common.js:109
socketOnData(), _http_client.js:432
emit(), events.js:182
EventEmitter.emit(), domain.js:442
addChunk(), _stream_readable.js:279
readableAddChunk(), _stream_readable.js:264
Readable.push(), _stream_readable.js:219
onread(), net.js:636
Async call from HTTPPARSER
init(), inspector_async_hook.js:27
emitInitNative(), async_hooks.js:137
tickOnSocket(), _http_client.js:619
onSocketNT(), _http_client.js:667
_tickCallback(), next_tick.js:63
Async call from TickObject
init(), inspector_async_hook.js:27
emitInitNative(), async_hooks.js:137
emitInitScript(), async_hooks.js:336
TickObject(), next_tick.js:86
nextTick(), next_tick.js:117
onSocket(), _http_client.js:655
ClientRequest(), _http_client.js:248
request(), https.js:272
get(), https.js:276
initAsClient(), websocket.js:514
WebSocket(), websocket.js:62
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
_tickCallback(), next_tick.js:68
Async call from Promise.then
anonymous(), subscription-handshake-link.js:176
Subscription(), Observable.js:179
subscribe(), Observable.js:258
anonymous(), index.ts:24
_tickCallback(), next_tick.js:68
Async call from Promise.then
anonymous(), index.ts:23
Subscription(), Observable.js:179
subscribe(), Observable.js:258
anonymous(), auth-link.js:192
_tickCallback(), next_tick.js:68
Module.runMain(), loader.js:746
startup(), node.js:238
bootstrapNodeJSCore(), node.js:572
Async call from Promise.then
anonymous(), auth-link.js:191
Subscription(), Observable.js:179
subscribe(), Observable.js:258
anonymous(), complex-object-link.js:88
_tickCallback(), next_tick.js:68
Module.runMain(), loader.js:746
startup(), node.js:238
bootstrapNodeJSCore(), node.js:572
Async call from Promise.then
anonymous(), complex-object-link.js:87
Subscription(), Observable.js:179
subscribe(), Observable.js:258
anonymous(), client.js:120
_tickCallback(), next_tick.js:68
Module.runMain(), loader.js:746
startup(), node.js:238
bootstrapNodeJSCore(), node.js:572
Async call from Promise.then
anonymous(), client.js:119
Subscription(), Observable.js:179
subscribe(), Observable.js:258
anonymous(), QueryManager.ts:958
Subscription(), Observable.js:179
subscribe(), Observable.js:258
anonymous(), request-subscribe-on-update-setting.ts:20
fulfilled(), request-subscribe-on-update-setting.js:4
_tickCallback(), next_tick.js:68
Module.runMain(), loader.js:746
startup(), node.js:238
bootstrapNodeJSCore(), node.js:572
Async call from Promise.then
step(), request-subscribe-on-update-setting.js:6
anonymous(), request-subscribe-on-update-setting.js:7
__awaiter(), request-subscribe-on-update-setting.js:3
exports.default(), request-subscribe-on-update-setting.ts:9
anonymous(), index.ts:125
Module._compile(), loader.js:699
Module._extensions..js(), loader.js:713
Module.load(), loader.js:612
tryModuleLoad(), loader.js:551
Module._load(), loader.js:543
Module.runMain(), loader.js:744
startup(), node.js:238
bootstrapNodeJSCore(), node.js:572
Debugging it further 8 level up from stacktrace on req.on(), ws/lib/websocket.js:535
I got response with statusCode 403 and statusMessage "Forbidden"
Can't figure out why its forbidden on Subscription but success on Query and Mutation
@nicklaros Did you ever figure out why this is happening?
I had to put it on hold for a while. I’m looking again at it this week.
However I’m certain that it’s subscriptions that are failing - I have 4 subscriptions and they all fall over at the same time with 4 error messages.
On 12 Nov 2018, at 09:39, Philipp Beau notifications@github.com wrote:
@nicklaros Did you ever figure out why this is happening?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
If you are running subscriptions in node, try this:
From https://github.com/awslabs/aws-mobile-appsync-sdk-js/issues/286#issuecomment-437992801
This could be the version of the websocket lib you have installed in node as a specific polyfill is needed. If you look here: https://docs.aws.amazon.com/appsync/latest/devguide/building-a-client-app-node.html
You will see "ws": "^3.3.1".
Could you try the instructions listed on that page?
Aahhh!
I’ll try that. Thanks.
I’m building and testing in node but the final version is for Cordova / JavaScript. Will that make a difference?
Kim
On 12 Nov 2018, at 20:43, Manuel Iglesias notifications@github.com wrote:
If you are running subscriptions in node, try this:
From #286 (comment)
This could be the version of the websocket lib you have installed in node as a specific polyfill is needed. If you look here: https://docs.aws.amazon.com/appsync/latest/devguide/building-a-client-app-node.html
You will see "ws": "^3.3.1".
Could you try the instructions listed on that page?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
If you are running subscriptions in node, try this:
From #286 (comment)
This could be the version of the websocket lib you have installed in node as a specific polyfill is needed. If you look here: https://docs.aws.amazon.com/appsync/latest/devguide/building-a-client-app-node.html You will see "ws": "^3.3.1". Could you try the instructions listed on that page?
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 changes
Hi, found this issue when searching for AWS iot net::ERR_CERT_SYMANTEC_LEGACY
If the Symantec certificate distrust error is your problem, you could try to fix it by checking if you're using the old iot endpoint format (xxx.iot.region.amazonaws.com), and replace that with a new one (xxx-ats.iot.region.amazonaws.com): https://aws.amazon.com/blogs/iot/aws-iot-core-ats-endpoints/
I fixed my (unrelated) problem by getting a new endpoint with an Amazon Trust Services url:
$ aws iot describe-endpoint --endpoint-type iot:Data-ATS
Closing this issue because of inactivity, please feel free to create a new issue if the problem persists.
Dear aws contributors,
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:
Result.js:
App.js
Index.js