RabbitMQ bad_ssl_dist_optfile - docker

so I'm working on getting RabbitMQ up in a clustered setting, and I "think" I have the configuration to have the cluster nodes talk to each other over SSL, but when running the nodes, I get this error:
rmq-node-1 | {{shutdown,
rmq-node-1 | {failed_to_start_child,ssl_dist_sup,
rmq-node-1 | {'EXIT',
rmq-node-1 | {{bad_ssl_dist_optfile,
rmq-node-1 | 16:36:58.591 [error] {failed_to_start_child,ssl_dist_sup,
rmq-node-1 | 16:36:58.592 [error] {'EXIT',
rmq-node-1 | 16:36:58.592 [error] {{bad_ssl_dist_optfile,
rmq-node-1 | ["/etc/rabbitmq/inter_node_tls.config"]},
rmq-node-1 | [{ssl_dist_sup,consult,1,
rmq-node-1 | [{file,"ssl_dist_sup.erl"},{line,105}]},
rmq-node-1 | 16:36:58.593 [error] ["/etc/rabbitmq/inter_node_tls.config"]},
rmq-node-1 | {ssl_dist_sup,start_link,0,
rmq-node-1 | [{file,"ssl_dist_sup.erl"},{line,45}]},
The gist of the error is the line that says bad_ssl_dist_optfile and I'm thinking the configuration is part of the problem. I've been following this guide: Securing Cluster Communications - Option 2 - config files
I also generated the pem files with the recommended "easy" solution. (also did the same with easy-rsa and got the same issues.) automated certificate generation
I've setup my folder structure like so:
I've created a compose file to include all the files, variables, and configuration:
I've created a rabbitmq.conf, rabbitmq-env.conf, and inter_node_tls.config to complete the setup:
RabbitMQ Config
RabbitMQ Env
Inter Node SSL
Am I missing a piece of the configuration? or is there some issue with formatting on the inter node configuration?
EDIT: I did catch the file name issue with the TLS config file, but got the same issue.

Related

"orderer" node / docker container exited few seconds after running docker-compose.cli

I am new to hyperledger fabric. I used the byfn example and it worked fine and I am now working on my own network. I created crypto-config, config.tx all docker files (including base) as the byfn example.
Every thing works fine untill I run the command "docker-compose -f docker-compose-cli.yaml up -d"
all the nodes are generated but the order node fails within a few seconds.
I think the problem could be in my artifacts/genesis.block file, but I could not solve it.
orderer.expleoFabric.com | 2020-05-21 16:17:59.624 UTC [orderer.common.server] initializeServerConfig -> INFO 003 Starting orderer with TLS enabled
orderer.expleoFabric.com | 2020-05-21 16:17:59.741 UTC [orderer.common.server] Main -> PANI 004 Failed validating bootstrap block: initializing configtx manager failed: bad channel ID: 'Orderer-channel' contains illegal characters
orderer.expleoFabric.com | panic: Failed validating bootstrap block: initializing configtx manager failed: bad channel ID: 'Orderer-channel' contains illegal characters
orderer.expleoFabric.com |
This is from my logs but I could not find Ordrer-channel in any of my files.
channel ID can only contain lowercase alphabetical character.
for more information : https://github.com/hyperledger/fabric/blob/0c3f3f78178f8a639374fba1a12344f381877459/common/configtx/validator.go#L72..L74

Getting Internal Server Error on prisma deploy

I have a Postgres database on Heroku, upon deploying the data model by doing prisma deploy often times the following error is produced.
ERROR: Whoops. Looks like an internal server error. Search your server logs for request ID: local:cjxrmcnpx00hq0692zuwttqwv
{
"data": {
"addProject": null
},
"errors": [
{
"message": "Whoops. Looks like an internal server error. Search your server logs for request ID: local:cjxrmcnpx00hq0692zuwttqwv",
"path": [
"addProject"
],
"locations": [
{
"line": 2,
"column": 9
}
],
"requestId": "local:cjxrmcnpx00hq0692zuwttqwv"
}
],
"status": 200
}
and on checking the Docker logs I am seeing this erorr:
Jul 14, 2019 12:18:34 PM org.postgresql.Driver connect
prisma_1 | SEVERE: Connection error:
prisma_1 | org.postgresql.util.PSQLException: FATAL: too many connections for role "bcueventxumaik"
prisma_1 | at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2433)
prisma_1 | at org.postgresql.core.v3.QueryExecutorImpl.readStartupMessages(QueryExecutorImpl.java:2566)
prisma_1 | at org.postgresql.core.v3.QueryExecutorImpl.<init>(QueryExecutorImpl.java:131)
prisma_1 | at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:210)
prisma_1 | at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49)
prisma_1 | at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:195)
prisma_1 | at org.postgresql.Driver.makeConnection(Driver.java:452)
prisma_1 | at org.postgresql.Driver.connect(Driver.java:254)
prisma_1 | at slick.jdbc.DriverDataSource.getConnection(DriverDataSource.scala:101)
prisma_1 | at slick.jdbc.DataSourceJdbcDataSource.createConnection(JdbcDataSource.scala:68)
prisma_1 | at slick.jdbc.JdbcBackend$BaseSession.<init>(JdbcBackend.scala:453)
prisma_1 | at slick.jdbc.JdbcBackend$DatabaseDef.createSession(JdbcBackend.scala:46)
prisma_1 | at slick.jdbc.JdbcBackend$DatabaseDef.createSession(JdbcBackend.scala:37)
prisma_1 | at slick.basic.BasicBackend$DatabaseDef.acquireSession(BasicBackend.scala:249)
prisma_1 | at slick.basic.BasicBackend$DatabaseDef.acquireSession$(BasicBackend.scala:248)
prisma_1 | at slick.jdbc.JdbcBackend$DatabaseDef.acquireSession(JdbcBackend.scala:37)
prisma_1 | at slick.basic.BasicBackend$DatabaseDef$$anon$2.run(BasicBackend.scala:274)
prisma_1 | at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
prisma_1 | at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
prisma_1 | at java.lang.Thread.run(Thread.java:748)
prisma_1 |
prisma_1 | Exception in thread "main" org.postgresql.util.PSQLException: FATAL: too many connections
prisma_1 | at org.postgresql.core.v3.QueryExecutorImpl.readStartupMessages(QueryExecutorImpl.java:2566)prisma_1 | at org.postgresql.core.v3.QueryExecutorImpl.<init>(QueryExecutorImpl.java:131)prisma_1 | at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:210)
prisma_1 | at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49)prisma_1 | at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:195)
prisma_1 | at org.postgresql.Driver.makeConnection(Driver.java:452)
prisma_1 | at org.postgresql.Driver.connect(Driver.java:254)prisma_1 | at slick.jdbc.DriverDataSource.getConnection(DriverDataSource.scala:101)
prisma_1 | at slick.jdbc.DataSourceJdbcDataSource.createConnection(JdbcDataSource.scala:68)
prisma_1 | at slick.jdbc.JdbcBackend$BaseSession.<init>(JdbcBackend.scala:453)
prisma_1 | at slick.jdbc.JdbcBackend$DatabaseDef.createSession(JdbcBackend.scala:46)
prisma_1 | at slick.jdbc.JdbcBackend$DatabaseDef.createSession(JdbcBackend.scala:37)
prisma_1 | at slick.basic.BasicBackend$DatabaseDef.acquireSession(BasicBackend.scala:249)
prisma_1 | at slick.basic.BasicBackend$DatabaseDef.acquireSession$(BasicBackend.scala:248)
prisma_1 | at slick.jdbc.JdbcBackend$DatabaseDef.acquireSession(JdbcBackend.scala:37)
prisma_1 | at slick.basic.BasicBackend$DatabaseDef$$anon$2.run(BasicBackend.scala:274)
prisma_1 | at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
prisma_1 | at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
prisma_1 | at java.lang.Thread.run(Thread.java:748)
prisma_prisma_1 exited with code 1
The error is saying too many connections but I am firing prisma deploy from only one terminal and at the same time I am able to connect to the database using PgAdmin4. Moreover, the database seems to be perfectly reachable as I am able to ping the database from inside the container.
PS. Updated the docker logs as earlier on running docker logs -f processid I was getting older logs but now upon building the container again using docker-compose up I got the lastest logs
As the error clearly states there are too many connections to the database. So we need to investigate how many connections there are, who is creating them and why they are created. In order to either limit the consumers or increase the amount of available connections.
First we can start by using the heroku CLI to check the amount of used and available connections:
$ heroku pg:info
=== DATABASE_URL
Plan: Private 2
Status: Available
HA Status: Available
Data Size: 2.23 GB
Tables: 83
PG Version: 10.1
Connections: 26/400
Connection Pooling: Available
For more information on how to investigate heroku postgres databases see: https://devcenter.heroku.com/articles/heroku-postgresql#pg-info
To further investigate who is connected to your database you can either use psql or pgAdmin. If using pgAdmin you can select the database, click on the dashboard tab and select the server activity panel on the bottom of the page revealing all connected sessions. If using psql you could write a select like this:
SELECT pid as process_id,
usename as username,
datname as database_name,
client_addr as client_address,
application_name,
backend_start,
state,
FROM pg_stat_activity;
For a more detailed how to see: https://dataedo.com/kb/query/postgresql/list-database-sessions
By now you probably identified who is creating the connections to your database and can limit the client to use less (or increase the amount of available database connections).
One possible consumer of database connections is the prisma server itself of course. The prisma config luckily provides a setting to limit database connections.
The connectionLimit property in PRISMA_CONFIG determines the number of
database connections a Prisma service is going to use.
You can read more about it here: https://www.prisma.io/docs/prisma-server/database-connector-POSTGRES-jgfr/#managing-database-connections
If you are using heroku to run the docker container with your prisma server a PRISMA_CONFIG could look like this:
port: $PORT
managementApiSecret: ${PRISMA_MANAGEMENT_API_SECRET}
databases:
default:
connector: postgres
migrations: true
connectionLimit: 2
uri: ${DATABASE_URL}?ssl=1
I hope this structured approach helped. Let me know if you need more clarification. If so please provide details regarding the nature of the existing database connections.
run this command
docker logs <YOUR_PRISMA_CONTAINER_NAME>
use pooling:
import dotenv from 'dotenv'
dotenv.config()
import { PrismaClient } from '#prisma/client'
// add prisma to the NodeJS global type
interface CustomNodeJsGlobal extends NodeJS.Global {
prisma: PrismaClient
}
// Prevent multiple instances of Prisma Client in development
declare const global: CustomNodeJsGlobal
const prisma = global.prisma || new PrismaClient()
if (process.env.NODE_ENV === 'development') global.prisma = prisma
export default prisma
plus use:
await prisma.$disconnect()

WSFW004 Access Denied for getUser method (UserWS)

[WSFW004]Access DeniedAccess to this resource is prohibited. (system.useradmin.generic.VIEW)
I am encountering Access Error whenever calling UserWS.getUser() method from my buildng block.
The code snippet is as follows:
UserFilter uf = new UserFilter();
uf.setId(lstEnrolledIds);
uf.setFilterType(2); // GET_USER_BY_ID_WITH_AVAILABILITY
UserWS uWS = UserWSFactory.getUserWSForTool();
UserVO[] lstUserVO = uWS.getUser(uf);
The error details are:
INFO | jvm 1 | 2018/04/11 09:31:02 | SEVERE: Servlet.service() for servlet [jsp] in context with path [/webapps/ntu-hdlgrade-BBLEARN] threw exception [java.lang.RuntimeException: [WSFW004]<b>Access Denied</b><br>Access to this resource is prohibited. (system.useradmin.generic.VIEW)] with root cause
INFO | jvm 1 | 2018/04/11 09:31:02 | blackboard.platform.security.AccessException: <b>Access Denied</b><br>Access to this resource is prohibited. (system.useradmin.generic.VIEW)
INFO | jvm 1 | 2018/04/11 09:31:02 | at blackboard.platform.security.SecurityUtil.checkEntitlement(SecurityUtil.java:199)
INFO | jvm 1 | 2018/04/11 09:31:02 | at blackboard.platform.ws.AxisHelpers.logAndValidateMethodCallBefore(AxisHelpers.java:273)
INFO | jvm 1 | 2018/04/11 09:31:02 | at blackboard.platform.ws.WebServiceWrapper.invoke(WebServiceWrapper.java:146)
INFO | jvm 1 | 2018/04/11 09:31:02 | at com.sun.proxy.$Proxy939.getUser(Unknown Source)
INFO | jvm 1 | 2018/04/11 09:31:02 | at org.apache.jsp.process_005fpreview_jsp._jspService(process_005fpreview_jsp.java:134)
Resolved.
You can give "system.user.VIEW" entitlement in bb-manifest.xml.
Or you can directly give permission on your JSP page. .

What is Thread-12 error in Grails Project while run the application

Exception in thread "Thread-12"
Error |
java.lang.IllegalStateException: No file extensions list found for path not being watched
Error |
at org.codehaus.groovy.grails.compiler.WatchServiceDirectoryWatcher.run(WatchServiceDirectoryWatcher.java:87)
Error |
at org.codehaus.groovy.grails.compiler.DirectoryWatcher.run(DirectoryWatcher.java:154)
Error |
at org.codehaus.groovy.grails.project.compiler.GrailsProjectWatcher.run(GrailsProjectWatcher.java:161)

Embedded GlassFish inside Grails

I'm using Grails 2.2.3 together with the Grails GlassFish plugin: http://grails.org/plugin/glassfish
So far, everything works as expected (run-app), except integration testing that in my understanding should startup/tear down a GlassFish instance as well.
When I try to run integration tests, I get a weird exception (see below).
It seems like if I run test-app :integration, the GlassFish instance is not started by Grails.
Any ideas?
Here's the exception:
Testing started at 18:58 ...
| Loading Grails 2.2.3
| Configuring classpath
| Error SLF4J: Class path contains multiple SLF4J bindings.
| Error SLF4J: Found binding in [jar:file:/Users/markus/.grails/ivy-cache/org.slf4j/slf4j-log4j12/jars/slf4j-log4j12-1.6.6.jar!/org/slf4j/impl/StaticLoggerBinder.class]
| Error SLF4J: Found binding in [jar:file:/Users/markus/.grails/ivy-cache/org.glassfish.main.extras/glassfish-embedded-all/jars/glassfish-embedded-all-3.1.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
| Error SLF4J: Found binding in [jar:file:/Users/markus/.grails/ivy-cache/org.grails/grails-plugin-log4j/jars/grails-plugin-log4j-2.2.3.jar!/org/slf4j/impl/StaticLoggerBinder.class]
| Error SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
| Error SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
| Configuring classpath.
| Environment set to test
| Environment set to test.
| Environment set to test..
| Environment set to test...
| Environment set to test....
| Environment set to test.....
| Packaging Grails application
| Packaging Grails application.
| Packaging Grails application..
| Packaging Grails application...
| Packaging Grails application....
| Packaging Grails application.....
26.06.2013 18:58:44 com.sun.enterprise.v3.server.CommonClassLoaderServiceImpl findDerbyClient
INFO: Cannot find javadb client jar file, derby jdbc driver will not be available by default.
| Packaging Grails application
| Packaging Grails application.
| Packaging Grails application..
| Packaging Grails application...
| Packaging Grails application...
| Packaging Grails application....
| Packaging Grails application.....
| Error org.omg.CORBA.COMM_FAILURE: FEIN: IOP00410001: Connection failure: socketType: IIOP_CLEAR_TEXT; hostname: localhost; port: 3700 vmcid: OMG minor code: 1 completed: No
| Error at sun.reflect.GeneratedConstructorAccessor51.newInstance(Unknown Source)
| Error at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
| Error at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
| Error at com.sun.corba.ee.spi.orbutil.logex.corba.CorbaExtension.makeException(CorbaExtension.java:248)
| Error at com.sun.corba.ee.spi.orbutil.logex.corba.CorbaExtension.makeException(CorbaExtension.java:95)
| Error at com.sun.corba.ee.spi.orbutil.logex.WrapperGenerator.handleFullLogging(WrapperGenerator.java:387)
| Error at com.sun.corba.ee.spi.orbutil.logex.WrapperGenerator.access$400(WrapperGenerator.java:107)
| Error at com.sun.corba.ee.spi.orbutil.logex.WrapperGenerator$2.invoke(WrapperGenerator.java:511)
| Error at com.sun.corba.ee.spi.orbutil.proxy.CompositeInvocationHandlerImpl.invoke(CompositeInvocationHandlerImpl.java:99)
| Error at com.sun.proxy.$Proxy32.connectFailure(Unknown Source)

Resources