Internal Server Error - 500 when trying to host a Full Stack Next JS application on AWS amplify with connected database as postgresql RDS instance - postgresql

I am new to the next JS platform but have prior knowledge on react JS, I have a problem when trying to host the created full stack next JS application on AWS using AWS Amplify and for database created a RDS instance with PostgreSQL setup I am getting error status code of 500 (Internal Server Error) but running in the local environment seems fine and the code is functional in the local environment.
The link to code on Git-Hub click here
On the hosted application following error gets console
Client side exception has occurred see here for more info: https://nextjs.org/docs/messages/client-side-exception-occurred
when checked with the logs of the RDS instance, The following log gets issued in the Viewing-Log error PostgreSQL
`2023-01-29 17:00:44 UTC:49.37.216.33(65214):Master name #DB Name:[8768]:LOG: could not receive data from client: Connection reset by peer`

Related

Auth0 not connecting to MongoDB. Load Balancing Error

I am encountering an error with linking my custom database (mongoDB) to the application i've built. Whenever I run the create script (or login script or verify script, these are all given to you by them out of the box), with the proper mongoDB credentials filled, I get this error: [MongoError] 354 - The server is being accessed through a load balancer, but this driver does not have load balancing enabled
For instructions on setting this all up, I followed this video exactly: https://www.youtube.com/watch?v=TXnDFU4sG0A
Saving and trying the scripts is where the error occurs.

Is There a Way to Get Spring Cloud Dataflow Server and Skipper Working with GCP Cloud SQL (MySQL or Postgresql)

I'm currently using helm charts from bitnami (Here) and trying to use a Cloud SQL instance in GCP. No matter what connection string I build, I get various connection errors connecting to the database. This causes the initial pod startup to fail, and never fully initialize.
It does not appear that spring-cloud-dataflow comes bundled with spring-cloud-gcp so it cannot be configured via Instance Name, so I assume we need to use the Private IP address, which fails every time.
For the below tests, a Cloud SQL MySQL instance was created, and a Cloud SQL Postgresql instance was created.
Chart configuration 1 for MySQL instance: (username and password omitted for brevity)
mariadb.enabled=false
externalDatabase.dataflow.url=jdbc:mysql://<privateip>/dataflow?useSSL=false
externalDatabase.dataflow.username=root
externalDatabase.driver=org.mariadb.jdbc.Driver
Results in (using port 0 or port 3306):
java.sql.SQLNonTransientConnectionException: Could not connect to address=(host=<private IP>)(port=0)(type=master) : Could not connect to <private IP>:0 : unexpected end of stream, read 0 bytes from 4 (socket was closed by server)
Caused by: java.io.EOFException: unexpected end of stream, read 0 bytes from 4 (socket was closed by server)
Chart configuration 2 (postgresql instance):
mariadb.enabled=false
externalDatabase.dataflow.url=jdbc:postgresql://<Private IP>:5432/
externalDatabase.dataflow.username=postgres
externalDatabase.driver=org.postgresql.Driver
Results in:
org.postgresql.util.PSQLException: The connection attempt failed.
Caused by: java.net.SocketException: Connection reset
I've verified that I can reach the databases via jdbc through Squirrel SQL (for postgresql) and MySQL workbench.
Will this never work unless spring-cloud-dataflow ships with spring-cloud-gcp?
You'll need to use the Cloud SQL Proxy or the Cloud SQL Java Connector.
There are a couple of answers here that show how to do that:
Connecting to Cloud SQL from Dataflow Job
Is it safe to connect DataFlow job to Cloud MySQL with proxy (by os.system)
Also, if your Cloud SQL instance is private IP only, you'll need to make sure your Data Flow deployment is in the same VPC as your Cloud SQL instance. For Public IP instances, using the Java connector or the proxy alone should be fine.

Deploying ASP.NET Core Web API to Azure - with Azure Key Vault and SQL Database dependency

I was able to deploy my Web API to Azure. I had to configure for 'Azure Key Vault', 'Azure SQL DB' and 'Microsoft Identity platform' before deployment as they were dependencies.
I configured Azure Key Vault and while configuring for SQL database, I selected the option to save connection string value in 'Azure Key Vault' instead of 'Azure app settings' (please see screenshot below).
When i press configure for 'Microsoft identify platform', the page shows loading symbol but never finshes and doesnt show any tenant id or details for configuration. Please see screenshot below.
So I had to ignore configuring Microsoft Identity Platform for now.
I was able to deploy the app to Azure, but when I try accessing the Azure endpoint, I get an error
HTTP ERROR 500 (Trouble retrieving data from database).
Log file message below while accessing the Azure endpoint:
An error occurred using the connection to database 'databasename' on server 'servername'.
An exception occurred while iterating over the results of a query for context type 'ItemApp.Infrastructure.Repository.ItemDBContext'.
Microsoft.Data.SqlClient.SqlException (0x80131904):
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections...
Can anyone point where I am going wrong? Thanks in advance.
Check to see if your database engine can handle remote connections:
Start > All Programs > SQL Server 2005 > Configuration Tools > SQL
Server Surface Area Configuration
Click on Surface Area Configuration for Services and Connections
Select the instance that is having a problem > Database Engine >
Remote Connections
Enable local and remote connections
Restart instance
Check if your SQL server services is up and running properly:
Go to All Programs > Microsoft SQL Server 2008 > Configuration Tools > SQL
Server Configuration Manager > SQL Server Services
Check to make sure SQL Server service status is Running.
In addition, ensure that your remote server is in the same network.
Run sqlcmd -L to ascertain if your server is included in your network list.
You may need to create an exception on the firewall for the SQL Server instance and port you are using:
Start > Run > Firewall.cpl
Click on exceptions tab
Add sqlservr.exe (typically located in C:\Program Files
(x86)\Microsoft SQL Server\MSSQL.x\MSSQL\Bin, check your installs for
the actual folder path) and port (default is 1433)
Check your connection string as well
Please check the MSFT Document to troubleshoot the error: Here.

Cloud Foundry: Node-Red app crashing with 500 Error: Failed to establish a backside connection

I have created an application in IBM cloud - using the Node-Red starter. The app has been running with no errors for 2 weeks.
I have installed an additional node:"node-red-dashboard":"2.9.6", by adding this in the package.json file.
When deploying within Node-Red, the app crashes with error "Cannot connect to server".
Then, the page is no longer reachable with error "500 Error: Failed to establish a backside connection".
I have tried to restart the app, which allows it to run, again until I deploy again.
This could be an intermittent problem with the toolchain or possibly due to the extra memory requirement placed on the build with the additional node.
Is there a reason why you have not used the manage palette option to install the new nodes?
If you are still getting the error, try increasing the memory allocated to node-red in the manifest.yml file, or try removing the additional node to get node-red to rebuild.

Creating a linked server from SQL Server 2008r2 to Access 2003

I've written a web app in ASP.NET that stores all of it's data in SQL Server 2008r2 and runs everything via stored procedures. The app is collecting data for a department who wants 2-3 pieces of that data pushed to an old app they use which has a Microsoft Access 2003 backend (.MDB file). My thought was to create a linked server to Access so my app can push everything to SQL server and it can handle it from there (seemed simple enough). Based on info from MSDN (here and here), I was using the following SQL command to create the linked server:
EXEC sys.sp_addlinkedserver #server = N'CMPtesting' ,
#datasrc = N'\\srv.local\SHAREDOCS\MPS\CMPdata.mdb' ,
#srvproduct = N'Access' ,
#provider = N'Microsoft.Jet.OLEDB.4.0'
This completes successfully, and I can see my CMPtesting server listed under Server Objects -> Linked Servers. However, if I try to verify the server using this:
SELECT name FROM [CMPtesting].master.sys.databases
or even just view the tables, I get an error:
OLE DB provider 'Microsoft.Jet.OLEDB.4.0' cannot be used for distributed queries because the provider is configured to run in
single-threaded apartment mode. (Microsoft SQL Server, Error: 7308)
Researching that error led me to "SQL to Access linked server" which suggested installing some different Access drivers and then using #provider = N'Microsoft.ACE.OLEDB.12.0' instead of the Jet driver. Again, this completes successfully, but attempting to view the tables produces a different error:
Cannot create an instance of OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "CMPtesting". (Microsoft
SQL Server, Error: 7302)
I know this is not simply an invalid driver error, because if I just make up a provider name I get this instead:
The OLE DB provider "foobar" has not been registered. (Microsoft SQL Server, Error: 7403)
I'm not sure what else to try because all my searches just turn up more rehashing of how to run sp_addlinkedserver without any additional details or help with these errors.