Node mssql module error on AWS Lambda - sql-server

I am facing an issue with the mssql node module, it is working very well in the local environment but when I deployed the code base into AWS lambda and from there if I execute the function it is failing for some reason below is the error.
START RequestId: 5ea5fc6b-9d45-11e7-9dca-ffdf71e8f823
Version: $LATEST2017-09-19T14:18:28.733Z 5ea5fc6b-9d45-11e7-9dca-ffdf71e8f823
SQL connection error { ConnectionError: Failed to connect to 10.71.12.16:49001 in 15000ms
at Connection.tedious.once.err
Note: even in local it should be in the allocated network to get the response.
Any help would be appreciated.

Related

Keycloak 19 docker can't find suitable driver for sqlserver

I deployed keycloak 19 in azure app service using the quay.io/keycloak/keycloak:19.0.1 image; It's working fine when using the dev file database; but I'm having trouble when I tried to connect on my SQL server database, I followed the instruction here but I'm getting the error below
ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) ERROR: No suitable driver found for jdbc:sqlserver://MySDBServer:1433;databaseName=MyDatabaseName
Here's my Setup in app settings configurations
KC_DB:mssql
KC_DB_URL_HOST:[MyDatabaseServer]
KC_DB_PASSWORD:[MyDatabasePassword]
KC_DB_USERNAME:[MyDatatabaseUsername]
KC_DB_URL_DATABASE:[MydatabaseName]
KC_PROXY:edge
Passing the --optimized parameter to the start should fix it.
bin/kc.[sh|bat] start --optimized
In case of a Dockerfile, your ENTRYPOINT will look like:
ENTRYPOINT ["/opt/keycloak/bin/kc.sh", "start", "--optimized"]
You can read about the --optimized parameter at the links given below.
Optimize the Keycloak startup
Changes to the server configuration and startup

Could Not Connect my react app via ip4 address

This is my first time making react project.
After I run my project with npm run start, I can connect to it via localhost:3000 and 127.0.0.1:3000 without any problem.
But when I try to connect it with my LAN address on the same computer it shows
Could Not Connect
Description: Could not connect to the requested server host.
It also shown an error on browser console.
Failed to load resource: the server responded with a status of 502 (internal error - server connection terminated)
This same project can be open via ip4 if I run it on my laptop. I can even open it from my mobile in the same wifi.
My computer is own by company so I think something might block it.
Please give me your suggestions on how to fix this problem. What could possibly cause this problem.
Any insight would be helpful.
Thank you.
Run HOST=0.0.0.0 npm run start
Check your IP. <your-ip>:3000 would work.
https://create-react-app.dev/docs/advanced-configuration/ for setting HOST environment variables.

Failed to connect to Database - Setting up GCP app engine

I'm trying to setup an instance on my phoenix app. I'm actually able to generate the app but I'm getting an error when trying to connect to the DB:
ERROR:
21:11:31.017 [error] Postgrex.Protocol (#PID<0.2223.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (/tmp/cloudsql/statcasters:us-central1:statcastersdb): no such file or directory - :enoent
I'm not sure what is wrong? The file seems to exist but it seems to say it doesn't:
prod.secret.exs:
config :statcasters, Statcasters.Repo,
username: "postgres",
password: System.get_env("DATABASE_PASSWORD"),
database: "statcasters_prod",
socket: "/tmp/cloudsql/statcasters:us-central1:statcastersdb",
pool_size: 20
I'm not sure what more information I can give? Does anybody know what I could be missing here?
There are 2 flavors of App Engine so please see the instructions linked here: https://cloud.google.com/sql/docs/postgres/connect-app-engine
The socket name appears to include a redundant "/tmp" prefix and should start with "/cloudsql/..." for App Engine standard.

Connect to cassandra on Google Cloud Compute

I deployed a Cassandra cluster through their launcher: https://cloud.google.com/launcher/explore?q=cassandra
I can connect to the VM fine, through SSH/PuTTY.
Then when I try to connect with for example DBeaver I get:
com.datastax.driver.core.exceptions.NoHostAvailableExeption: All host(s) tried for query failed(tried: /x.x.x.x:9160)
com.datastax.driver.core.ConnectionExption:[/x.x.x.x:9160] Unexpected error during transport initialization. Connection has been closed
Or with cassandra-driver (nodejs), I get:
All host(s) tried for query failed. First host tried, x.x.x.x:9160: Error: read ECONNRESET. See innerErrors.
InnerErrors: { 'x.x.x.x:9160': { [Error: read ECONNRESET] code: 'ECONNRESET', errno: 'ECONNRESET', syscall: 'read' } }
Info: Represents an error when a query cannot be performed because no host is available or could be reached by the driver.
I've forwarded the 9160 port in the google developer console and it seems to work because when I stop the cassandra server on the VM it gives a different error, indicating connection is refused:
All host(s) tried for query failed. First host tried, x.x.x.x:9160: Error: connect ECONNREFUSED. See innerErrors.
InnerErrors: { 'x.x.x.x:9160':
{ [Error: connect ECONNREFUSED]
code: 'ECONNREFUSED',
errno: 'ECONNREFUSED',
syscall: 'connect' } }
Info: Represents an error when a query cannot be performed because no host is available or could be reached by the driver.
Now, I've tried editing the cassandra.yaml rcp_adress to the actual external address instead of 0.0.0.0.
I've also tried the internal serverfarm address.
I've not changed the default authentication (but also tried with auth):
authenticator: AllowAllAuthenticator
# authenticator: PasswordAuthenticator
authorizer: AllowAllAuthorizer
# authorizer: CassandraAuthorizer
I'm at a loss, the connection seems to work, but cassandra seems to not allow a login or reset the connection?
You are trying to connect on the thrift port (9160). You should be using the native protocol port (9042).

Task failed to execute on Development server

On Development Server, whenever I add an taskqueue
taskqueue.add(queue_name='default', url='/_tasks/do_something', params={'key': 1})
The following error occurred
taskqueue_stub.py:1974] Task task1 failed to execute. This task will retry in 819.200 seconds
After getting some hint from this post:
http://www.rogerthat.net/2012/03/27/google-app-engine-push-task-queues-the-development-environment/
I suspect it could be something to do with the hostname. I am using http://test.me:8088 (where test.me point to 127.0.0.1 using host file). The problem goes away when I change the hostname (test.me) to "localhost".
I can't just use localhost due to some app configuration issue.
The code edit rogerthat.net point out is no longer valid.
Any other solution?

Resources