I am trying to move an existing web application from Windows to run in a Docker container. I started with Centos 7 and OpenJDK 11 as a starting point. Put Tomcat 9 on top and to starts fine. I started adding the pieces for my web application with all the pieces for our current Windows deployment (war file, jaas.config, setenv.sh, etc.). The docker container starts fine but when I try to log in I get the following error..
04-Jan-2021 13:27:30.381 SEVERE [http-nio-8080-exec-9] org.apache.catalina.realm.JAASRealm.authenticate Unexpected error
java.lang.SecurityException: java.io.IOException: /opt/tomcat/latest/conf/jaas.config
(No such file or directory)
at java.base/sun.security.provider.ConfigFile$Spi.<init>(ConfigFile.java:137)
I stop the container and start in interactive mode I confirm that the file is in that location.
root#eac3366e9b83:/# ls -ltr /opt/tomcat/latest/conf/
total 236
-rwxrwxrwx 1 root root 107 Jul 13 2019 jaas.config
What could be causing the problem?
The problem was that the jaas.config file and setenv.sh that were copied from windows to the docker image and contained windows line termination. So when tomcat tried to load the jaas config file, the name had extra character at end and failed in File.exists. Once the file contents were fixed, the authentication module loaded fine.
Related
I'm following a google video to start a google cloud project with vscode and it throws me an error and I can't solve it
this is the video just in case https://youtu.be/EtMIEtLQNa0?t=298
Starting to run the app using configuration 'Cloud Run: Run/Debug Locally' from .vscode/launch.json...
To view more detailed logs, go to Output channel : "Cloud Run: Run/Debug Locally - Detailed"
Dependency check started
Dependency check succeeded
Unpausing minikube
The minikube profile 'cloud-run-dev-internal' has been scheduled to stop automatically after exiting Cloud Code. To disable this on future deployments, set autoStop to false in your launch configuration c:\Users\Franco\Desktop\proyecto\Proyecto Agenda Web\.vscode\launch.json
Configuring minikube gcp-auth addon
Using GCP project 'proyecto-agenda-web' with minikube gcp-auth
invalid skaffold config: source: C:\Users\Franco\AppData\Local\Temp\cloud-code-cloud-run-iixzxH\skaffold.yaml, in module "proyecto-agenda-web" on line 7 column 14: source: C:\Users\Franco\AppData\Local\Temp\cloud-code-cloud-run-iixzxH\skaffold.yaml, in module "proyecto-agenda-web" on line 7 column 14: invalid image "Proyecto Agenda Web": invalid reference format
source: C:\Users\Franco\AppData\Local\Temp\cloud-code-cloud-run-iixzxH\skaffold.yaml, in module "proyecto-agenda-web" on line 7 column 14: source: C:\Users\Franco\AppData\Local\Temp\cloud-code-cloud-run-iixzxH\skaffold.yaml, in module "proyecto-agenda-web" on line 7 column 14: invalid image "Proyecto Agenda Web": invalid reference format
Skaffold exited with code 1.
Cleaning up...
Finished clean up.```
I've been searching and I can't think of a solution, any ideas?
The error is descriptive:
invalid skaffold config:
source: C:\Users\Franco\AppData\Local\Temp\cloud-code-cloud-run-iixzxH\skaffold.yaml
on line 7
column 14
invalid image "Proyecto Agenda Web"
invalid reference format
You have a folder called skaffold.yaml in that directory.
On line 7, column 14, there's probably something of the form image: Proyecto Agenda Web and Projecto Agenda Web isn't a valid container image.
These are generally of the form some-repo/some-image:some-tag.
You need to correct that. There may be subsequent errors.
I assume (!?) somewhere in the video, there are instructions that explain what value to use there.
I want to deploy Spring Boot applications using Kinesis streams on Kubernetes cluster on AWS.
I used kops in an AWS EC2 (Amazon Linux) instance to create my cluster and deploy it using terraform.
I installed Spring Cloud Data Flow for Kubernetes using Helm chart. All my pods are up and running and I can access to the Spring Cloud Data Flow interface in order to register my dockerized apps. I am using ECR repositories to upload my Docker images.
When I want to deploy the stream (composed of a time-source and a log-sink), a big nice red error message pops up. I checked the log of the Skipper pod and I have the following error message starting with :
org.springframework.cloud.skipper.SkipperException: Could not install AppDeployRequest
and finishing with :
Caused by: java.io.IOException: Cannot run program "docker" (in directory "/tmp/spring-cloud-deployer-5769885450333766520/time-log-kinesis-stream-1539963209716/time-log-kinesis-stream.log-sink-kinesis-app-v1"): error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048) ~[na:1.8.0_111-internal]
at org.springframework.cloud.deployer.spi.local.LocalAppDeployer$AppInstance.start(LocalAppDeployer.java:386) ~[spring-cloud-deployer-local-1.3.7.RELEASE.jar!/:1.3.7.RELEASE]
at org.springframework.cloud.deployer.spi.local.LocalAppDeployer$AppInstance.start(LocalAppDeployer.java:414) ~[spring-cloud-deployer-local-1.3.7.RELEASE.jar!/:1.3.7.RELEASE]
at org.springframework.cloud.deployer.spi.local.LocalAppDeployer$AppInstance.access$200(LocalAppDeployer.java:296) ~[spring-cloud-deployer-local-1.3.7.RELEASE.jar!/:1.3.7.RELEASE]
at org.springframework.cloud.deployer.spi.local.LocalAppDeployer.deploy(LocalAppDeployer.java:199) ~[spring-cloud-deployer-local-1.3.7.RELEASE.jar!/:1.3.7.RELEASE]
... 54 common frames omitted
Caused by: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.forkAndExec(Native Method) ~[na:1.8.0_111-internal]
at java.lang.UNIXProcess.<init>(UNIXProcess.java:247) ~[na:1.8.0_111-internal]
at java.lang.ProcessImpl.start(ProcessImpl.java:134) ~[na:1.8.0_111-internal]
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029) ~[na:1.8.0_111-internal]
... 58 common frames omitted
I already had this error when I tried to deploy on a local k8s cluster on Windows 10 and I thought it was linked to Win10 platform.
I am using spring-cloud-dataflow-server-kubernetes at version 1.6.2.RELEASE.
I really do not have any clues why this error is appearing. Thanks !
It looks like the docker command is not found by the SCDF local deployer's ProcessBuilder when it tries to run the docker exec from this path:
/tmp/spring-cloud-deployer-5769885450333766520/time-log-kinesis-stream-1539963209716/time-log-kinesis-stream.log-sink-kinesis-app-v1
The SCDF sets the above path as its working directory before running the docker command and hence docker is expected to run from this location.
I have found where was the issue. My bad, the problem is always between the keyboard and the chair !
I wanted to remove all the metrics process in the skipper-config.yaml file and I inserted a typo in the configuration file. The JSON env variable data.spring.application.json for the Skipper launch was not valid hence the DeployerInitializationService never saw the properties it needed to add Kubernetes into the repository !
Now in the logs and in the dataflow shell I have the default and the minikube accounts. Thanks for your help anyway :)
I am trying to automatically start a Domain Manager, Device Manager, and waveform at boot on a CENTOS 7 OS using REDHAWK 2.0.7.
First I created a python script -rwxrwxrwx. 1 root root 1518 /usr/local/sbin/rx.py
I verified the script works as intended when run by calling python /usr/local/sbin/rx.py and inspecting the REDHAWK IDE. It works as intended 100%.
Next I created a systemd service -rwxrwxrwx. 1 root root 188 /etc/systemd/system/rx.service
[Unit]
Description=REDHAWK Service
Requires=omniEvents.service
[Service]
Type=idle
ExecStart=/usr/bin/python /usr/local/sbin/rx.py
User=redhawk
[Install]
WantedBy=multi-user.target
Finally I started this service with the following steps:
sudo systemctl daemon-reload
sudo systemctl enable rx.service
sudo systemctl start rx.service
Then I checked the status via systemctl status rx.service and saw it had failed due to:
File "/usr/local/redhawk/core/lib/python/ossie/utils/popen.py", line 59, in Popen
return subprocess.Popen(*args, **kwargs)
File "/usr/lib64/python2.7/subprocess.py", line 711, in __init__
errread, errwrite)
File "/usr/lib64/python2.7/subprocess.py", line 1327 in _execute_child
raise child_exception
TypeError: execv() arg 2 must contain only strings
I have isolated the problematic line to
domain = rh.kickDomain(domain_name="REDHAWK_DEV", kick_device_managers=True, device_managers=['/nodes/NUC1Node/DeviceManager.dcd.xml'])
which comes after the following imports
import sys
import os
from time import sleep
sys.path.append(os.path.abspath("/usr/local/redhawk/core/lib64/python"))
sys.path.append(os.path.abspath("/usr/local/redhawk/core/lib/python"))
from ossie.utils import redhawk as rh
I have tried encapsulating in a try except block to obtain more information, but the error above is the most informative thing I've found and it still doesn't seem to highlight what I'm missing. As I've said, this script runs perfectly when run manually; it is just failing as a systemd service which leads me to believe there is something else the systemd process needs in order to run this properly.
Does anyone know how I can fix this process of starting a REDHAWK Domain Manager at boot, or have a different working method that I could adapt and implement?
I repeated your setup but had systemd source a script(runRx.sh) instead of running the python command directly. When I didn't source the /etc/profile.d/redhawk-sdrroot.sh file, I got the same error.
The working runRx.sh file contained:
#!/bin/bash
source /etc/profile.d/redhawk.sh
source /etc/profile.d/redhawk-sdrroot.sh
/usr/bin/python /usr/local/sbin/rx.py
REDHAWK 2.1.3 contains a new redhawk-adminservice rpm that is meant to assist in automatically starting up domains, nodes and waveforms on both CentOS 6 and CentOS 7. See https://redhawksdr.github.io/2.1.3/manual/appendices/adminservice/ for more information.
I am running my Wildfly 10.1.0 server on Linux OS on Amazon EC2 instance. I have written start and stop scripts for the server. Whenever I stop my server and re-start after some time I get the following exception -
WFLYCTL0013: Operation ("add") failed - address: ([("deployment" => "rapid.ear")]) - failure description: "WFLYSRV0137: No deployment content with hash dd66eee901c4bf79dd6659873df918e1b639bc1b is available in the deployment content repository for deployment 'rapid.ear'. This is a fatal boot error. To correct the problem, either restart with the --admin-only switch set and use the CLI to install the missing content or remove it from the configuration, or remove the deployment from the xml configuration file and restart."
When I remove the entry for that WAR from standalone.xml I am able to restart the server, but I need a more permanent solution.
The start script written is -
nohup /data/wildfly-10.1.0.Final/bin/standalone.sh -Djavax.net.ssl.trustStore="/usr/java/jdk1.8.0_121/jre/lib/security/jssecacerts" --server-config=standalone.xml &
And the stop script is -
sh /data/wildfly-10.1.0.Final/bin/jboss-cli.sh --connect command=:shutdown
It may not be quite as efficient in terms of I/O but if you've got a standalone instance I've just taken advantage of the deployment scanner. I have:
<subsystem xmlns="urn:jboss:domain:deployment-scanner:2.0">
<deployment-scanner name="myapp" path="/home/wildfly/sites/www.mysite.tld" scan-interval="60000" auto-deploy-exploded="true"/>
</subsystem>
in my standalone-full.xml (you may or may not need the "-full" part). I then deploy my webapp to "/home/wildfly/sites/www.mysite.tld" and can update it as needed. The code I show only reads the directory once a minute so it isn't terrible on I/O.
Again, your deployment may be different than mine.
I have done this by the book multiple times and have also tried using someone else's WAR to deploy, but I keep getting the same error. I am running JBoss 4.2.3 and have tried this on multiple installations (of 4.2.3)
I have verified that the supposed missing file file exists.
19:19:15,853 INFO [ContextLoader] Root WebApplicationContext: initialization completed in 54014 ms
19:19:18,172 ERROR [STDERR] javax.servlet.ServletException: The configuration file cound not be found at /WEB-INF/cfform/flex-config.xml
19:19:18,174 ERROR [STDERR] at flex.server.j2ee.cache.CacheFilter.setupFlexService(CacheFilter.java:93)
This error results in failure of the WAR to deploy:
--- MBeans waiting for other MBeans ---
ObjectName: jboss.web.deployment:war=cfusion.war,id=611163449
State: FAILED
Reason: org.jboss.deployment.DeploymentException: URL file:/jee/workspace/tools/server/default/deploy/cfusion.war/ deployment failed
Any ideas?
I found a solution. It's insane, but it's worked twice now (on OS X, at least).
copy the WEB-INF directory to your file system root.
Ex: cp -R ./cfusion.war/WEB-INF /
start the instance. Everything works.
Delete the newly copied file system root /WEB-INF folder.
From now on, it will work. Crazy, but there you go.
I've seen this one a million times. It's usually when I forget a file in the WEB-INF of my war. Is flex-config.xml in your WEB-INF?