Connection failed: Buffer is not defined - Error when subscribing to AWS Amplify (graphql) Subscriptions after update to v4.7.0 - aws-amplify

I have just updated from Amplify-cli 4.0.0 to 4.7.0 and now I am getting these errors when attempting to listen for my subscriptions.
{provider: AWSAppSyncRealTimeProvider, error: {…}}
provider: AWSAppSyncRealTimeProvider {_config: {…}, socketStatus: 0, keepAliveTimeout: 300000, subscriptionObserverMap: Map(0), promiseArray: Array(0), …}
error:
errors: Array(1)
0:
message: "Connection failed: Buffer is not defined"
__proto__: Object
length: 1
__proto__: Array(0)
__proto__: Object
__proto__: Object
I am using Ionic 4, and just before the update everything was working just fine.

Please refer to the below link: Looks like you need to polyfill buffer.
https://github.com/agoncal/swagger-ui-angular6/issues/2

Related

SequelizeConnectionRefusedError - Trying to access my deployed web app with Firebase/Google Cloud SQL

I set-up a web app with Firebase and Google Cloud SQL but I always get the same error. Can you help me?
{ SequelizeConnectionRefusedError: connect ECONNREFUSED /cloudsql/pet-hotel-275016:us-central1:pet-hotel/.s.PGSQL.5432
at connection.connect.err (/srv/node_modules/sequelize/lib/dialects/postgres/connection-manager.js:116:24)
at Connection.connectingErrorHandler (/srv/node_modules/pg/lib/client.js:140:14)
at emitOne (events.js:116:13)
at Connection.emit (events.js:211:7)
at Socket.reportStreamError (/srv/node_modules/pg/lib/connection.js:71:10)
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
at emitErrorNT (internal/streams/destroy.js:66:8)
at _combinedTickCallback (internal/process/next_tick.js:139:11)
at process._tickDomainCallback (internal/process/next_tick.js:219:9)
message: 'connect ECONNREFUSED /cloudsql/pet-hotel-275016:us-central1:pet-hotel/.s.PGSQL.5432',
locations: [ { line: 2, column: 3 } ],
path: [ 'settingsFind' ] }
Here's what the console looks like
Console looks like this

Exception 504 when registering the consumer

I've been working with Symfony 2.7 and the RabbitMQBundle to handle some long processes asynchronously.
After facing the issue where the MySQL connection dies after a few minutes, I discovered rabbitmq-cli-consumer, a small app in Go that takes care of consuming the queue, and gives its content to a command.
In my case, I use it with this command: ./rabbitmq-cli-consumer -c configuration-stock.conf --include -V -e 'php app/console amqp:consume:stock --env=prod -vvv', with this configuration file:
[rabbitmq]
host = HOST
username = USERNAME
password = PASSWORD
vhost=/VHOST
port=PORT
queue=stock
compression=Off
[exchange]
name=exports
type=direct
durable=On
[queuesettings]
routingkey=stock
messagettl=10000
deadLetterExchange=exports.dl
deadLetterroutingkey=stock
priority=10
To handle errors, I intend to use RabbitMQ's x-dead-letter-exchange and x-dead-letter-routing-key configuration, to be able to retry the message later (in case something went temporarly wrong).
My issue is that, when I define my queues in RabbitMQBundle's configuration, rabbitmq-cli-consumer is unable to consume the queue, throwing this error:
2018/04/23 11:35:54 Connecting RabbitMQ...
2018/04/23 11:35:54 Connected.
2018/04/23 11:35:54 Opening channel...
2018/04/23 11:35:54 Done.
2018/04/23 11:35:54 Setting QoS...
2018/04/23 11:35:54 Succeeded setting QoS.
2018/04/23 11:35:54 Declaring queue "stock"...
2018/04/23 11:35:54 Registering consumer...
2018/04/23 11:35:54 failed to register a consumer: Exception (504) Reason: "channel/connection is not open"
Here is the configuration I use for RabbitMQBundle:
old_sound_rabbit_mq:
producers:
exports:
connection: default
exchange_options:
name: 'exports'
type: direct
exports_dl:
connection: default
exchange_options:
name: 'exports.dl'
type: direct
consumers:
stock_dead_letter:
connection: default
exchange_options:
name: exports.dl
type: direct
queue_options:
name: stock.dl
routing_keys:
- stock
arguments:
x-dead-letter-exchange: ['S', 'exports']
x-dead-letter-routing-key: ['S', 'stock']
x-message-ttl: ['I', 60000]
callback: amqp.consumers.exports.stock
multiple_consumers:
exports:
connection: default
exchange_options:
name: 'exports'
type: direct
queues:
stock:
name: stock
callback: amqp.consumers.exports.stock
routing_keys:
- stock
arguments:
x-dead-letter-exchange: ['S', 'exports.dl']
x-dead-letter-routing-key: ['S', 'stock']
Has anyone ever encountered something similar ? And how did you solve it ?

webdriver io crashes inside a jade template on rendered function

I am testing my meteor app's UI with some browser tests. I use http://webdriver.io and a selenium chrome https://hub.docker.com/r/selenium/standalone-chrome/ node.
I use the webdriver.io testrunner for tests and mocha as the test framework.
When I enter this block inside a jade template (by opening the corresponding page):
Template.boardBody.onRendered(function() {
let imagePath = new ReactiveVar('');
this.autorun(() => {
imagePath.set(Meteor.settings.public.backgroundPath[1]);
//document.getElementsByClassName('board-wrapper')[0].style.backgroundImage = "url('" + imagePath.get() + "')";
$('.board-wrapper').css('background-image', "url('" + path + "')");
});
}
The headless chrome crashes with this error:
{ Error: An unknown server-side error occurred while processing the command.
at BoardPage.open (tests/board.page.js:20:5)
at Context.<anonymous> (tests/board.test.js:22:17)
at Promise.F (node_modules/core-js/library/modules/_export.js:35:28)
at execute(<Function>) - at BoardPage.open (tests/page.js:11:13)
message: 'unknown error: session deleted because of page crash\nfrom tab crashed',
type: 'RuntimeError',
screenshot: 'Just a black page',
seleniumStack:
{ status: 13,
type: 'UnknownError',
message: 'An unknown server-side error occurred while processing the command.',
orgStatusMessage: 'unknown error: session deleted because of page crash\nfrom tab crashed\n (Session info: chrome=59.0.3071.115)\n (Driver info: chromedriver=2.30.477691 (6ee44a7247c639c0703f291d320bdf05c1531b57),platform=Linux 4.4.4-200.fc22.x86_64 x86_64) (WARNING: The server did not provide any stacktrace information)\nCommand duration or timeout: 4.13 seconds\nBuild info: version: \'3.4.0\', revision: \'unknown\', time: \'unknown\'\nSystem info: host: \'f362d8ab8951\', ip: \'172.17.0.1\', os.name: \'Linux\', os.arch: \'amd64\', os.version: \'4.4.4-200.fc22.x86_64\', java.version: \'1.8.0_131\'\nDriver info: org.openqa.selenium.chrome.ChromeDriver\nCapabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, networkConnectionEnabled=false, chrome={chromedriverVersion=2.30.477691 (6ee44a7247c639c0703f291d320bdf05c1531b57), userDataDir=/tmp/.org.chromium.Chromium.NUsUeZ}, takesHeapSnapshot=true, pageLoadStrategy=normal, databaseEnabled=false, handlesAlerts=true, hasTouchScreen=false, version=59.0.3071.115, platform=LINUX, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true, unexpectedAlertBehaviour=}]\nSession ID: f1e261ec57fde3697e98945af051d236' },
shotTaken: true }
I use chai.expect for my assertion statements and i have a feeling that the promises are somehow messing up the headless chrome.
Anyone knows why this is happening?

When I am trying to execute azure template with extension? I am getting below error?

New - AzureRmResourceGroupDeployment: 5: 33: 31 PM - Resource Microsoft.Compute / virtualMachines / extensions 'dataLin1030Vm/script'
failed with message
{
"status": "Failed",
"error": {
"code": "ResourceDeploymentFailure",
"message": "The resource operation completed with terminal provisioning state 'Failed'.",
"details": [{
"code": "VMExtensionProvisioningError",
"message": "VM has reported a failure when processing extension 'script'. Error message: \"Script returned an
error.\n-- - stdout-- - \n\ n-- - errout-- - \nhg - mysql - mongo - instalation.sh: 6: hg - mysql - mongo - instalation.sh: Syntax error: newline unexpected\ n\ n\ "."
}]
}
}
This:
https://github.com/harish-kumar-garg/JsonTemplates/blob/master/Templates/hg-appAndDbVMCreation.json#L687
Should be pointing to the raw location, e.g.
https://raw.githubusercontent.com/harish-kumar-garg/MyShellScripts/master/Scripts/hg-mysql-mongo-instalation.sh

"node.js: throw e; // process.nextTick error," while trying browserid

I'm not going to use other module like request, how about writing this with http,
What should I consider while seeding post to browserid?
error:
$ coffee server.coffee
info - socket.io started
to send
to write
end?
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: getaddrinfo ENOENT
at errnoException (dns.js:31:11)
at Object.onanswer [as oncomplete] (dns.js:140:16)
source:
ll = console.log
fs = require 'fs'
page = fs.readFileSync 'page.html', 'utf-8'
query = require 'querystring'
client = fs.readFileSync 'client.coffee', 'utf-8'
page = page.replace '###', client
handler = (req, res) ->
res.writeHead 200, 'Content-Type': 'text/html'
res.end page
http = require 'http'
app = http.createServer handler
app.listen 8000
io = (require 'socket.io').listen app
io.set 'log level', 1
io.sockets.on 'connection', (socket) ->
socket.emit 'ready', 'go'
socket.on 'assertion', (data) ->
msg = query.stringify
assertion: data
audience: 'localhost:8000'
options =
host: 'https://browserid.org'
path: '/verify'
method: 'POST'
headers:
'Content-Type': 'application/x-www-form-urlencoded'
'Content-Length': msg.length
ll 'to send'
request = http.request options, (response) ->
str = ''
ll 'prepare'
response.on 'data', (chunk) ->
str += chunk
ll str
response.on 'end', ->
ll str
request.write msg
ll 'to write'
request.end()
ll 'end?'
with long-stack-traces:
$ coffee server.coffee
info - socket.io started
to send
to write
end?
Uncaught Error: getaddrinfo ENOENT
at errnoException (dns.js:31:11)
at Object.onanswer [as oncomplete] (dns.js:140:16)
----------------------------------------
at EventEmitter.on
at Array.<anonymous> (http.js:1147:12)
at EventEmitter._tickCallback (node.js:192:40)
----------------------------------------
at EventEmitter.nextTick
at ClientRequest.onSocket (http.js:1115:11)
at Agent.addRequest (http.js:938:9)
at new ClientRequest (http.js:1068:16)
at Object.request (http.js:1331:10)
at Socket.<anonymous> (/home/chen/code/home/git/docview/learning/coffee/browserid/server.coffee:52:22)
at Socket.$emit (events.js:67:17)
at SocketNamespace.handlePacket (/usr/lib/nodejs/socket.io/lib/namespace.js:335:22)
----------------------------------------
at EventEmitter.on
at SocketNamespace.<anonymous> (/home/chen/code/home/git/docview/learning/coffee/browserid/server.coffee:37:19)
at SocketNamespace.$emit (events.js:88:20)
at connect (/usr/lib/nodejs/socket.io/lib/namespace.js:292:10)
at /usr/lib/nodejs/socket.io/lib/namespace.js:308:13
at SocketNamespace.authorize (/usr/lib/nodejs/socket.io/lib/namespace.js:252:5)
at SocketNamespace.handlePacket (/usr/lib/nodejs/socket.io/lib/namespace.js:302:14)
at Manager.handleClient (/usr/lib/nodejs/socket.io/lib/manager.js:669:30)
----------------------------------------
at EventEmitter.on
at Object.<anonymous> (/home/chen/code/home/git/docview/learning/coffee/browserid/server.coffee:35:14)
at Object.<anonymous> (/home/chen/code/home/git/docview/learning/coffee/browserid/server.coffee:71:4)
at Module._compile (module.js:441:26)
at Object.run (/usr/lib/nodejs/coffee-script/lib/coffee-script/coffee-script.js:68:25)
at /usr/lib/nodejs/coffee-script/lib/coffee-script/command.js:135:29
at /usr/lib/nodejs/coffee-script/lib/coffee-script/command.js:110:18
at [object Object].<anonymous> (fs.js:115:5)
at [object Object].emit (events.js:64:17)
Uncaught undefined
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
Looking at the http.request documentation, we find:
Options:
host: A domain name or IP address of the server to issue the request to. Defaults to 'localhost'.
hostname: To support url.parse() hostname is preferred over host
port: Port of remote server. Defaults to 80.
You might try these options instead:
options =
hostname: 'browserid.org'
port: 443
path: '/verify'
method: 'POST'
headers:
'Content-Type': 'application/x-www-form-urlencoded'
'Content-Length': msg.length
Edit: http.request doesn't work for SSL requests, for this, you need to use https.request. Changing to that fixes your other error as well, and the default port is 443 so you can omit that from the options if you wish.

Resources