Error when opening home page in business central when using PLANNER_AND_RULES profile - drools

I'm trying out RedHat's Business Central using a docker-compose file as described in https://github.com/jboss-dockerfiles/business-central. At startup it runs a kie-server (quay.io/kiegroup/kie-server-showcase:7.67.0.Final) and a business-central webserver (quay.io/kiegroup/business-central-workbench-showcase:7.67.0.Final).
Because I'm only interested in the drools part and not the jbpm part, I starting the business-central server with -Dorg.kie.workbench.profile=PLANNER_AND_RULES as described in https://docs.jboss.org/drools/release/7.67.0.Final/drools-docs/html_single/#_selecting_a_profile
After login with admin I receive the following error:
business-central_1 | 18:11:13,321 ERROR [org.kie.workbench.common.services.backend.logger.GenericErrorLoggerServiceImpl] (default task-2) Error from user: admin Error ID: -1427996616 Location: HomePerspective|org.kie.workbench.common.screens.home.client.HomePresenter Exception: Uncaught exception: Client-side exception occurred although RPC call succeeded. Caused by: The profile is not expected and profile to define product name
Below, you can find the docker-compose file used:
version: "3.2"
services:
business-central:
image: quay.io/kiegroup/business-central-workbench-showcase:7.67.0.Final
ports:
- "8090:8080"
- "8091:8001"
environment:
KIE_SERVER_LOCATION: http://kie-server:8080/kie-server/services/rest/server
JAVA_OPTS: "-Xms256m -Xmx2048m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=512m -Djava.net.preferIPv4Stack=true -Dfile.encoding=UTF-8 -Dorg.kie.workbench.profile=PLANNER_AND_RULES"
kie-server:
image: quay.io/kiegroup/kie-server-showcase:7.67.0.Final
environment:
KIE_SERVER_ID: sample-server
KIE_SERVER_LOCATION: http://kie-server:8080/kie-server/services/rest/server
KIE_SERVER_CONTROLLER: http://business-central:8080/business-central/rest/controller
KIE_MAVEN_REPO: http://business-central:8080/business-central/maven2
ports:
- "8092:8080"
depends_on:
- business-central
volumes:
business-central_data:
UPDATE: on 2022-04-07
I also looked at the source code in github but couldn't find any reference to PLANNER_AND_RULES. I looked at several repo's in https://github.com/kiegroup/:
https://github.com/kiegroup/drools
https://github.com/kiegroup/droolsjbpm-build-bootstrap
https://github.com/kiegroup/droolsjbpm-knowledge
https://github.com/kiegroup/kie-soup
I have no idea how where to look for ;-(.
I found a very disturbing picture on explaining all the repo's that are being used, but it would be good if someone pointed out what repo to look for :-).

Related

Failed to load advanced configuration file "/etc/rabbitmq/advanced.config": unknown POSIX error

I'm getting error when configuration file is set.
My host is a Ubuntu 22.04
Inside the docker container the user is rabbitmq, using id -u rabbitmq the $UID is 999
I changed the file using: chown 999 advanced.config
But the same error still persists.
Failed to load advanced configuration file "/etc/rabbitmq/advanced.config": unknown POSIX error
Error during startup: {error,failed_to_read_advanced_configuration_file}
version: "3.2"
services:
rabbitmq2:
image: rabbitmq:3-management
hostname: rabbitmq2
container_name: 'rabbitmq2'
ports:
- "5672:5672"
- "15672:15672"
- "5552:5552"
volumes:
- ./advanced/rabbitmq2/advanced.config:/etc/rabbitmq/advanced.config
# or using:
# - type: bind
# source: $PWD/advanced/rabbitmq2/advanced.config
# target: /etc/rabbitmq/advanced.config
environment:
- RABBITMQ_ADVANCED_CONFIG_FILE=/etc/rabbitmq/advanced.config
If I use another place to put the file, or another file name, the container runs, but Rabbitmq doesn't load the configuration file.
I changed the content of the file and it didn't work (rabbitmq can't load the file), I tried using blank file, and using some configurations, for example:
[
%% 4 replicas by default, only makes sense for nine node clusters
{rabbit, [{quorum_cluster_size, 4},
{quorum_commands_soft_limit, 512}]}
]
Be sure the format is correct:
[
%% 4 replicas by default, only makes sense for nine node clusters
{rabbit, [{quorum_cluster_size, 4},
{quorum_commands_soft_limit, 512}]}
].
Note the trailing period.
NOTE: the RabbitMQ team monitors the rabbitmq-users mailing list and only sometimes answers questions on StackOverflow.

Import realm in Keycloak:18.x

I cannot import any realms into Keycloak 18.0.0. That's the Quarkus, and not the Wildfly distribution anymore. Documentation here says it should be pretty simple, and by mounting my exported realm.json file into /opt/keycloak/data/import/...json it actually TRIES to import it, but it ends with :
"[org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) ERROR: Script upload is disabled".
Known to be removed, and the old -Dkeycloak.profile.feature.upload_scripts=enabled won't work anymore. OK.
But then what's the way to do import any realms on startup? That'd be used to distribute a ready-made local stack without any handcrafting needed to launch. I could do it with running SQL commands, but that's way too hacky to my taste.
Compose file :
cp-keycloak:
image: quay.io/keycloak/keycloak:18.0.0
environment:
KC_DB: mysql
KC_DB_URL: jdbc:mysql://cp-keycloak-database:3306/keycloak
KC_DB_USERNAME: root
KC_DB_PASSWORD: root
KC_HOSTNAME: localhost
KEYCLOAK_ADMIN: admin
KEYCLOAK_ADMIN_PASSWORD: admin
ports:
- 8082:8080
volumes:
- ./data/local_stack/init.keycloak.json:/opt/keycloak/data/import/main-realm.json:ro
entrypoint: "/opt/keycloak/bin/kc.sh start-dev --import-realm"
The output :
cp-keycloak_1 | 2022-05-05 14:07:26,801 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) ERROR: Failed to start server in (development) mode
cp-keycloak_1 | 2022-05-05 14:07:26,802 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) ERROR: Failed to import realm: Main-Realm
cp-keycloak_1 | 2022-05-05 14:07:26,803 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) ERROR: Script upload is disabled
Thanks
This might be caused because inside of your realm .json there is references to some configuration that is using the deprecated upload script feature.
Try to removed it, export the json and them try to imported again (this time without the upload script feature.
From the comments (credits to jfrantzius): 
See here for what you either need to remove or replace in your
realm-export.json:
https://github.com/keycloak/keycloak/issues/11664#issuecomment-1111062102
. We had to replace the entries, see also here
https://github.com/keycloak/keycloak/discussions/12041#discussioncomment-2768768

Docker Compose Config Server unreachable by Spring Cloud Data Flow Microservices

The config server is reachable from localhost:8888 but when I deploy my applications on SCDF the following error occurs:
Fetching config from server at : http://localhost:8888
2021-07-30 14:58:53.535 INFO 143 --- [ main] o.s.b.context.config.ConfigDataLoader : Connect Timeout Exception on Url - http://localhost:8888. Will be trying the next url if available
2021-07-30 14:58:53.535 WARN 143 --- [ main] o.s.b.context.config.ConfigDataLoader : Could not locate PropertySource ([ConfigServerConfigDataResource#3de88f64 uris = array<String>['http://localhost:8888'], optional = true, profiles = list['default']]): I/O error on GET request for "http://localhost:8888/backend-service/default": Connection refused (Connection refused); nested exception is java.net.ConnectException: Connection refused (Connection refused)
The application(s) deploy successfully on SCDF apart from the config server connection. The only property I specify in SCDF is the docker network. I'm using spring.config.import and am not using any bootstraps. This all works correctly when deployed locally but the microservices can't connect to the config server when deployed on SCDF.
Spring Boot Version: 2.5.1
app properties
spring.application.name=backend-service
spring.cloud.config.fail-fast=true
spring.cloud.config.retry.max-attempts=6
spring.cloud.config.retry.max-interval=11000
spring.config.import=optional:configserver:http://localhost:8888
config server properties
spring.cloud.config.server.git.uri=...
management.endpoints.web.exposure.include=*
spring.cloud.config.fail-fast=true
spring.cloud.config.retry.max-attempts=6
spring.cloud.config.retry.max-interval=11000
spring.cloud.bus.id=my-config-server
spring.cloud.stream.rabbit.bindings.springCloudBus.consumer.declareExchange=false
spring.rabbitmq.host=127.0.0.1
spring.rabbitmq.port=5672
spring.rabbitmq.username=guest
spring.rabbitmq.password=guest
spring.cloud.bus.enabled=true
spring.cloud.bus.refresh.enabled: true
spring.cloud.bus.env.enabled: true
server.port=8888
docker-compose.yml
version: '3.1'
services:
h2:
...
rabbitmq-container:
image: rabbitmq:3.7.14-management
hostname: dataflow-rabbitmq
expose:
- '5672'
ports:
- "5672:5672"
- "15672:15672"
networks:
- scdfnet
dataflow-server:
...
networks:
- scdfnet
app-import:
...
networks:
- scdfnet
skipper-server:
...
networks:
- scdfnet
configserver-container:
image: ...
ports:
- "8888:8888"
expose:
- '8888'
environment:
- spring_rabbitmq_host=rabbitmq-container
- spring_rabbitmq_port=5672
- spring_rabbitmq_username=guest
- spring_rabbitmq_password=guest
depends_on:
- rabbitmq-container
networks:
- scdfnet
networks:
scdfnet:
external:
name: scdfnet
volumes:
h2-data:
For anyone else having this problem, I have found two ways of solving it. The problem is that once the Spring Boot application is containerized, the localhost referred to in the properties file will cause the program to fetch the localhost of the application container's virtual network and not that of your local machine.
There are numerous Stack Overflow answers for this same error but all center around corrections to bootstrap properties. However, bootstrap context initialization is deprecated since Spring Boot 2.4.
The first solution is to use your IPv4 address instead of localhost.
spring.config.import=configserver:http://<insert IPv4 address>:8888
For Example:
spring.config.import=configserver:http://10.6.39.148:8888
A much better solution than hardwiring addresses is to reference the config server container running in docker compose:
spring.config.import=optional:configserver:http://configserver-container:8888
Make sure that all of the Docker Compose services are running on the same network (scdf_network in my case) and note that this address will only work when running on docker-compose so if you are building the maven file on Eclipse, you may need to remove or disable your tests to build successfully. That might be unnecessary; it could just be that there is some property that I failed to copy to my local application.properties file which is causing the context tests to fail. According to the documentation, the optional label should allow the config client to run even if contact cannot be established with the config server.

docker-compose gives error "cant access the file because it is being used by another process". Not same with docker vanilla

Im running my docker container with
Docker run kalle:anka -p 8888:80 -p 5045:5045 -p 5672:5672
without any problem. But when I try to achieve the same thing with docker-compose I get the error
ERROR: for myapp.api_1 Cannot start service myapp.api: failed to
create endpoint myapp.api_1 on network nat: hnsCall failed in Win32:
The process cannot access the file because it is being used by another
process. (0x20)
The error above seems to have something to do with the port mapping. (When I remove those I get passed that problem.)
... I'll keep this question short, please ask if yo miss any details
Relevant part of my docker-compose.yaml
> version: '3.4'
>
> services: myapp.api:
> image: ${DOCKER_REGISTRY-}myappapi
> ports:
> - "8888:80"
> - "5045:5045"
> - "5672:5672"

How to create stack in tutum with docker-compose.yml file?

I am trying to build a Stack as follows:
redis:
image: redis
ports:
- '6379'
app:
build: .
links:
- redis
when I push "Create Stack" button, I get this error:
Oops!
Service 'app': Value {u'build': u'.', u'links': [u'redis'], u'name': u'app'} for field '<obj>' contains additional property 'build' not defined by 'properties' or 'patternProperties' and additionalProperties is False. See 'https://support.tutum.co/support/solutions/articles/5000583471' for more details
Can someone help me with this please?
The Tutum documentation states the following at the bottom of the page:
Docker-compose non-supported keys
Tutum.yml has been designed with docker-compose.yml in mind to maximize compatibility, but the following keys are not supported:
build
external_links
env_file
This clearly states that build is not a supported key, which is what your error message also says. It looks like you'll have to remove the build key from your file.