AWS lambda – não consigo conectar ao banco RDS, apenas localmente

Estou tentando conectar a uma instância RDS a partir de uma lambda. Eu fiz e testei a lambda localmente, funcionou perfeitamente. Porém, quando fiz o deploy para a AWS o código é executado normalmente até a parte em que é feita a conexão com o banco. A partir disso, nem mesmo as mensagens de log aparecem.

Obs: Estou usando context.callbackWaitsForEmptyEventLoop = false;

Obs2: Não estou usando VPC na lambda.

Obs3: Tenho lambdas mais antigas que funcionam normal, apenas as novas estão com este problema, por mais que as configurações sejam iguais.

Essa é a parte relevante do código:

if (body && body.modality_id) {              console.log('Just debugging...')              DB.query("call sp_create_transaction (?)",[body.modality_id])                 .then(results => {                     if (results[0][0]) {                         if (results[0][0].Error) {                             helper.body = { 'message': results[0][0].Error };                             console.log('Error:' + results[0][0].Error);                         }                         else {                             helper.statusCode = 200;                             helper.body = results[0];                             console.log(helper.body);                             console.log('EXECUTION SUCCESS:');                         }                     }                     else {                         helper.statusCode = 401;                         helper.body = { 'message': 'Falha ao buscar taxas.' };                         console.log('Error: Rates not found.');                     }                     callback(null, helper.response);                 })                 .catch(err => {                     helper.statusCode = 500;                     helper.body = { 'message': 'Por favor, informa ao time de suporte técnico o código DAN-54.' };                     console.log('Error: DAN-54');                     console.log(err);                     callback(null, helper.response);                 });         } 

Aqui é a saída do log:

START RequestId: fb134979-7d0e-4fa3-b7c8-4192f4765ea8 Version: $  LATEST 2019-05-28T23:47:26.609Z fb134979-7d0e-4fa3-b7c8-4192f4765ea8 INFO Just debugging... END RequestId: fb134979-7d0e-4fa3-b7c8-4192f4765ea8 REPORT RequestId: fb134979-7d0e-4fa3-b7c8-4192f4765ea8 Duration: 1273.33 ms Billed Duration: 1300 ms Memory Size: 128 MB Max Memory Used: 79 MB  

Como selecciono la base de datos a la que me quiero conectar en Nodejs?

Tengo 2 Bases de Datos y una app desarrollada con nodejs, expressjs,sequelize angular y SqlServer. Necesito que al momento de acceder a la app yo pueda seleccionar la base de datos a la que quiero acceder. Por ejemplo: Tengo las bases de datos DB2018 y DB2019 al momento de acceder a la app necesito poder seleccionar la base de datos a la que quiero acceder.

Stunnel – Problemas al conectar

Intento conectar desde una aplicacion desarrollada en python a un servidor remoto que admite lo siguiente:

$  > openssl s_client host-remoto:4431  No client certificate CA names sent Peer signing digest: SHA256 Peer signature type: RSA Server Temp Key: ECDH, P-256, 256 bits --- SSL handshake has read 3340 bytes and written 419 bytes Verification error: unable to get local issuer certificate --- New, TLSv1.2, Cipher is ECDHE-RSA-AES128-GCM-SHA256 Server public key is 2048 bit Secure Renegotiation IS supported Compression: NONE Expansion: NONE No ALPN negotiated SSL-Session:     Protocol  : TLSv1.2     Cipher    : ECDHE-RSA-AES128-GCM-SHA256     Session-ID: 78776BC02D9A3F8520FEB0ED57A3A6CD53A711D9FF1F159D42D9C045A4B3765D     Session-ID-ctx:     Master-Key: 3FC35C05B8DBE4C93D6524DD80358B03E219907047CF7B681595B6D856C29D70A5D5042D280E7F1F89DA3B5ADAF44C72     PSK identity: None     PSK identity hint: None     SRP username: None     Start Time: 1558366240     Timeout   : 7200 (sec)     Verify return code: 20 (unable to get local issuer certificate)     Extended master secret: yes 

configuracion de stunnel

debug = 7 output = stunnel.log cert = stunnel.pem  client=yes  [TCP] accept=127.0.0.1:4431 connect=host-remoto:4431  

Log de stunnel

2019.05.20 13:35:53 LOG7[main]: Found 1 ready file descriptor(s) 2019.05.20 13:35:53 LOG7[main]: FD=512 ifds=r-x ofds=r-- 2019.05.20 13:35:53 LOG7[main]: Dispatching a signal from the signal pipe 2019.05.20 13:35:53 LOG7[main]: Processing SIGNAL_RELOAD_CONFIG 2019.05.20 13:35:53 LOG7[main]: Running on Windows 6.2 2019.05.20 13:35:53 LOG5[main]: Reading configuration from file stunnel.conf 2019.05.20 13:35:53 LOG5[main]: UTF-8 byte order mark detected 2019.05.20 13:35:53 LOG7[main]: Compression disabled 2019.05.20 13:35:53 LOG7[main]: No PRNG seeding was required 2019.05.20 13:35:53 LOG6[main]: Initializing service [TCP] 2019.05.20 13:35:53 LOG7[main]: Ciphers: HIGH:!aNULL:!SSLv2:!DH:!kDHEPSK 2019.05.20 13:35:53 LOG7[main]: TLSv1.3 ciphersuites: TLS_CHACHA20_POLY1305_SHA256:TLS_AES_256_GCM_SHA384:TLS_AES_128_GCM_SHA256 2019.05.20 13:35:53 LOG7[main]: TLS options: 0x02100004 (+0x00000000, -0x00000000) 2019.05.20 13:35:53 LOG6[main]: Loading certificate from file: stunnel.pem 2019.05.20 13:35:53 LOG6[main]: Certificate loaded from file: stunnel.pem 2019.05.20 13:35:53 LOG6[main]: Loading private key from file: stunnel.pem 2019.05.20 13:35:53 LOG6[main]: Private key loaded from file: stunnel.pem 2019.05.20 13:35:53 LOG7[main]: Private key check succeeded 2019.05.20 13:35:53 LOG4[main]: Service [TCP] needs authentication to prevent MITM attacks 2019.05.20 13:35:53 LOG5[main]: Configuration successful 2019.05.20 13:35:53 LOG7[main]: Deallocating section defaults 2019.05.20 13:35:53 LOG5[main]: Logging to C:\Users\jescalona\AppData\Local\stunnel.log 2019.05.20 13:35:53 LOG7[main]: Binding service [TCP] 2019.05.20 13:35:53 LOG7[main]: Listening file descriptor created (FD=648) 2019.05.20 13:35:53 LOG7[main]: Setting accept socket options (FD=648) 2019.05.20 13:35:53 LOG7[main]: Option SO_EXCLUSIVEADDRUSE set on accept socket 2019.05.20 13:35:53 LOG6[main]: Service [TCP] (FD=648) bound to 127.0.0.1:4431 2019.05.20 13:36:33 LOG7[main]: Found 1 ready file descriptor(s) 2019.05.20 13:36:33 LOG7[main]: FD=512 ifds=r-x ofds=--- 2019.05.20 13:36:33 LOG7[main]: Service [TCP] accepted (FD=1444) from 127.0.0.1:53699 2019.05.20 13:36:33 LOG7[main]: Creating a new thread 2019.05.20 13:36:33 LOG7[main]: New thread created 2019.05.20 13:36:33 LOG7[4]: Service [TCP] started 2019.05.20 13:36:33 LOG7[4]: Setting local socket options (FD=1444) 2019.05.20 13:36:33 LOG7[4]: Option TCP_NODELAY set on local socket 2019.05.20 13:36:33 LOG5[4]: Service [TCP] accepted connection from 127.0.0.1:53699 2019.05.20 13:36:33 LOG6[4]: s_connect: connecting host-remoto:4431 2019.05.20 13:36:33 LOG7[4]: s_connect: s_poll_wait host-remoto:4431: waiting 10 seconds 2019.05.20 13:36:38 LOG7[main]: Found 1 ready file descriptor(s) 2019.05.20 13:36:38 LOG7[main]: FD=512 ifds=r-x ofds=r-- 2019.05.20 13:36:38 LOG7[main]: Dispatching a signal from the signal pipe 2019.05.20 13:36:38 LOG5[main]: Active connections: 2019.05.20 13:36:38 LOG5[main]: Service [TCP]: 0 byte(s) sent to TLS, 0 byte(s) sent to socket 2019.05.20 13:36:38 LOG5[main]: Service [TCP]: 0 byte(s) sent to TLS, 0 byte(s) sent to socket 2019.05.20 13:36:38 LOG5[main]: Service [TCP]: 0 byte(s) sent to TLS, 0 byte(s) sent to socket 2019.05.20 13:36:38 LOG5[main]: Service [TCP]: 0 byte(s) sent to TLS, 0 byte(s) sent to socket 2019.05.20 13:36:38 LOG5[main]: Service [TCP]: 0 byte(s) sent to TLS, 0 byte(s) sent to socket  

El problema parece ser que stunnel no envía ningún dato y la conexión no se establece, no veo la negociación de certificados

Me conecto desde mi app a 127.0.0.1:4431 esperando llegar a host-remoto:4431

No se si el problema es del stunnel o algo externo. Version de stunnel 5.54 win64

——————————————————————————–

———————————————-a-

No puedo conectar al WebSocket del servidor

Estoy intentando conectar al WebSocket del servidor, pero me sale el siguiente error: no pudo establecer una conexión con el servidor en ws://localhost:25003/public/node/dist/php/ws.php.

del lado del cliente (JS):

  ws = new WebSocket(`ws://localhost:25003/public/node/dist/php/ws.php`)   ws.onopen = e => {     console.log('Conectado al WebSocket correctamente.')   }   ws.onerror = e => {     console.log(e)   }   ws.onmessage = e => {     console.log(e.data)   }  btnSale.addEventListener('click', e => {   e.preventDefault()   const data = {     type: 'sale',     product: parseInt(product.value, 10),     quantity: parseInt(quantity.value, 10)   }   ws.send(JSON.stringify(data)) }) 

del lado del servidor (PHP):

set_time_limit(0);    $  address = "127.0.0.1";   $  port = "25003";    $  socket = socket_create(AF_INET, SOCK_STREAM, getprotobyname("tcp")) or die("Could not create socket\n");   echo socket_strerror(socket_last_error());   socket_bind($  socket, $  address, $  port);   socket_listen($  socket);   $  i = 0;   while (true) {     $  client[++$  i] = socket_accept($  socket);     $  msg = socket_read($  client[$  i], 1024);     echo $  msg;     socket_write($  client[$  i],$  msg,strlen($  msg));     socket_close($  client[$  i]);   }    socket_close($  socket); 

Fallo al conectar a una BBDD en Access al actualizar a Office 365

Tenía mi conector de python a Access funcionando correctamente para la versión de Access 2007.

conn = pyodbc.connect('Driver={Microsoft Access Driver (*.mdb, *.accdb)};Dbq='+archivo+';') 

Funcionaba todo correctamente pero al actualizar a Office 365, cuando hago la misma llamada, obtengo el siguiente error:

conn = pyodbc.connect('Driver={Microsoft Access Driver (*.mdb, *.accdb)};Dbq='+archivo+';') 

pyodbc.InterfaceError: (‘IM002’, ‘[IM002] [Microsoft][Administrador de controladores ODBC] No se encuentra el nombre del origen de datos y no se especificó ningún controlador predeterminado (0) (SQLDriverConnect)’)

Error al Conectar mi BackEnd NodeJs con MariaDB

Tengo una PC Virtual con Debian 9, en ella instale el node v8.16.0 y el mariadb Ver 15.1 Distrib 10.1.37-MariaDB . Al correr mi backend me sale este error:

Error: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MariaDB client

Al googlearlo me indican que ejecute este comando logeado desde mysql: ALTER USER ‘user’@’localhost’ IDENTIFIED WITH mysql_native_password BY ‘mypass’;

Y al ejecutarlo me lanza este error:

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘USER ‘placetas’@’localhost’ IDENTIFIED WITH mysql_native_password BY ‘Ubuser55” at line 1

Y a mi dbConfig le agregue insecureAuth : true dbConfig: { //connectionLimit: 10, host: ‘localhost’, user: ‘placetas’, password: ‘Ubuser55’, database: ‘placetas_database’, insecureAuth : true } Me estoy quedando sin ideas necesito que alguien me indique el norte. Esto funciona perfectamente en Windows con mi Wampserver 2.2 Gracias de antemano.

no puedo conectar a tfs 2013 desde vs 2008

tengo la siguiente situación en mi pc win10, instale el vs2008 y vs2017 ahora necesito conectarme desde el vs2008 a un tfs2013 , resulta que he tratado de instalar el team explorer MSSCCI 2013, pero no quiere instalar pporque no tiene instalado el vs2013 en mi pc,.. he intentado de todo y no logro hacer q mi vs2008 se conecte con el tfs, alguna idea?