spring cloud config server cannot bind to gitlab - spring-cloud-config

I am using Spring springCloudVersion, "2021.0.3" to setup a Config Server that uses my gitlab account for its files. I created a deploy token with premissions:
read_repository, read_registry, write_registry, read_package_registry, write_package_registry
and then I use those in the spring server application.properties:
spring.application.name=config-server
spring.application.version=0.1.0
server.port=8012
spring.cloud.config.server.git.uri=https://gitlab.com/[account]/[repo]
spring.cloud.config.server.git.skip-ssl-validation=true
spring.cloud.config.server.git.clone-on-start=true
spring.cloud.config.server.git.default-label=main
spring.cloud.config.server.git.basedir=https://gitlab.com/[account]/[repo]
spring.cloud.config.server.git.username=[my-token-username]
spring.cloud.config.server.git.password=[my-token-password]
I was getting errors on startup about not binding the base directory until I put the same uri there as in spring.cloud.config.server.git.uri (they are now identical but it feels wrong)
When I try to startup my ConfigServerApplication I get the following:
ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'defaultEnvironmentRepository' defined in class path resource [org/springframework/cloud/config/server/config/DefaultRepositoryConfiguration.class]: Unsatisfied dependency expressed through method 'defaultEnvironmentRepository' parameter 1; nested exception is org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name 'multipleJGitEnvironmentProperties': Could not bind properties to 'MultipleJGitEnvironmentProperties' : prefix=spring.cloud.config.server.git, ignoreInvalidFields=false, ignoreUnknownFields=true; nested exception is org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'spring.cloud.config.server.git.basedir' to java.io.File
2022-06-30 12:04:53.020 INFO 1594 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2022-06-30 12:04:53.026 INFO 1594 --- [ main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2022-06-30 12:04:53.033 ERROR 1594 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :
***************************
APPLICATION FAILED TO START
***************************
Description:
Failed to bind properties under 'spring.cloud.config.server.git.basedir' to java.io.File:
Property: spring.cloud.config.server.git.basedir
Value: https://gitlab.com/[account]/[repo]
Origin: class path resource [application.properties] - 9:40
Reason: failed to convert java.lang.String to java.io.File (caused by java.lang.IllegalStateException: Could not retrieve file for URL [https://gitlab.com/[account]/[repo]]: URL [https://gitlab.com/[account]/[repo]] cannot be resolved to absolute file path because it does not reside in the file system: https://gitlab.com/[account]/[repo]
I don't know what file it is trying to access - in that repo I have
README.md
application.properties
and I would think the properties files is what it is trying to access?
I have tried using both my account credentials and the deploy token with the same results. I did not try the deploy key because this will not be access locally, but via cloud.

Finally tracked it down - I had to add:
spring.profiles.active=native
and remove
spring.cloud.config.server.git.basedir

Related

kafka connect to s3 fails to start

I'm trying to configure the kafka-connect to send my data from kafka to s3.
I'm newbie in aspect of kafka, and I'm trying to implement this flow without any ssl encryptions just to get the hang of it.
kafka version : 2.12-2.2.0
kafka-connect : 4.1.1 (https://api.hub.confluent.io/api/plugins/confluentinc/kafka-connect-s3/versions/4.1.1/archive)
In the server.properties file the only change that I did is setting the advertised.listeners to my ec2 IP:
advertised.listeners=PLAINTEXT://ip:9092
kafka-connect properties :
# Kafka broker IP addresses to connect to
bootstrap.servers=localhost:9092
# Path to directory containing the connector jar and dependencies
plugin.path=/root/kafka_2.12-2.2.0/plugins/
# Converters to use to convert keys and values
key.converter=org.apache.kafka.connect.storage.StringConverter
value.converter=org.apache.kafka.connect.storage.StringConverter
# The internal converters Kafka Connect uses for storing offset and configuration data
internal.key.converter=org.apache.kafka.connect.json.JsonConverter
internal.value.converter=org.apache.kafka.connect.json.JsonConverter
internal.key.converter.schemas.enable=false
internal.value.converter.schemas.enable=false
offset.storage.file.filename=/tmp/connect.offsets
security.protocol=SASL_PLAINTEXT
consumer.security.protocol=SASL_PLAINTEXT
my s3-sink.properties file :
name=s3.sink
connector.class=io.confluent.connect.s3.S3SinkConnector
tasks.max=1
topics=my_topic
s3.region=us-east-1
s3.bucket.name=my_bucket
s3.part.size=5242880
flush.size=3
storage.class=io.confluent.connect.s3.storage.S3Storage
format.class=io.confluent.connect.s3.format.json.JsonFormat
schema.generator.class=io.confluent.connect.storage.hive.schema.DefaultSchemaGenerator
partitioner.class=io.confluent.connect.storage.partitioner.DefaultPartitioner
schema.compatibility=NONE
I'm launcing kafka-connect with the following command :
connect-standalone.sh kafka-connect.properties s3-sink.properties
At first I got the following error :
Caused by: java.lang.IllegalArgumentException: Could not find a 'KafkaClient' entry in the JAAS configuration. System property 'java.security.auth.login.config' is not set
From other posts I saw that I need to create a jaas config file so that what I did :
cat config/kafka_server_jass.conf
KafkaClient {
org.apache.kafka.common.security.plain.PlainLoginModule required
username="userName"
serviceName="kafka"
password="password";
};
and :
export KAFKA_OPTS="-Djava.security.auth.login.config=/root/kafka_2.12-2.2.0/config/kafka_server_jass.conf"
Now I'm getting the following error :
Caused by: org.apache.kafka.common.errors.SaslAuthenticationException: Failed to configure SaslClientAuthenticator
Caused by: org.apache.kafka.common.KafkaException: Principal could not be determined from Subject, this may be a transient failure due to Kerberos re-login
help :)
You might also need to define principal and keytab inside your jaas configuration:
KafkaClient {
org.apache.kafka.common.security.plain.PlainLoginModule required
username="userName"
serviceName="kafka"
password="password";
useKeyTab=true
keyTab="/etc/security/keytabs/kafka_server.keytab"
principal="kafka/kafka1.hostname.com#EXAMPLE.COM";
};

Error resolving template "instances" when running on weblogic

I'm probably missing some configuration, but I cannot find out which one.
I have working client app and running monitoring app, everyting works when both executed as a "standalone" apps, meaning, that they do not run in any application server.
But I'm trying to run them also under weblogic. Both app are deployed, registration is ok, regular updates of app status shows that monitored app is UP. However in UI no registered app are shown. When checking network in chrome development console, I can see, that:
GET http://localhost:7001/cchAdmin/applications 500 (Internal Server Error)
failed. Checking monitoring app logs, one can find
Looking up handler method for path /cchAdmin/applications
2019-01-07 16:59:18.022 DEBUG 13460 --- [ (self-tuning)'] .b.a.s.w.s.AdminControllerHandlerMapping : Did not find handler method for [/cchAdmin/applications]
2019-01-07 16:59:18.023 DEBUG 13460 --- [ (self-tuning)'] .b.a.s.w.s.AdminControllerHandlerMapping : Looking up handler method for path /cchAdmin/applications
2019-01-07 16:59:18.023 DEBUG 13460 --- [ (self-tuning)'] .b.a.s.w.s.AdminControllerHandlerMapping : Did not find handler method for [/cchAdmin/applications]
2019-01-07 16:59:19.178 DEBUG 13460 --- [ (self-tuning)'] .b.a.s.w.s.AdminControllerHandlerMapping : Looking up handler method for path /instances
2019-01-07 16:59:19.178 DEBUG 13460 --- [ (self-tuning)'] .b.a.s.w.s.AdminControllerHandlerMapping : Returning handler method [public reactor.core.publisher.Mono<org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, de.codecentric.boot.admin.server.domain.values.InstanceId>>> de.codecentric.boot.admin.server.web.InstancesController.register(de.codecentric.boot.admin.server.domain.values.Registration,org.springframework.web.util.UriComponentsBuilder)]
2019-01-07 16:59:19.179 DEBUG 13460 --- [ (self-tuning)'] .b.a.s.w.s.AdminControllerHandlerMapping : Looking up handler method for path /instances
2019-01-07 16:59:19.180 DEBUG 13460 --- [ (self-tuning)'] .b.a.s.w.s.AdminControllerHandlerMapping : Returning handler method [public reactor.core.publisher.Mono<org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, de.codecentric.boot.admin.server.domain.values.InstanceId>>> de.codecentric.boot.admin.server.web.InstancesController.register(de.codecentric.boot.admin.server.domain.values.Registration,org.springframework.web.util.UriComponentsBuilder)]
2019-01-07 16:59:19.181 DEBUG 13460 --- [ (self-tuning)'] d.c.b.a.server.web.InstancesController : Register instance Registration(name=XXX, managementUrl=http://localhost:7001/XXX/actuator, healthUrl=http://localhost:7001/XXX/actuator/health, serviceUrl=http://localhost:7001/XXX, source=http-api)
2019-01-07 16:59:19.183 ERROR 13460 --- [ (self-tuning)'] org.thymeleaf.TemplateEngine : [THYMELEAF][[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'] Exception processing template "instances": Error resolving template "instances", template might not exist or might not be accessible by any of the configured Template Resolvers
org.thymeleaf.exceptions.TemplateInputException: Error resolving template "instances", template might not exist or might not be accessible by any of the configured Template Resolvers
at org.thymeleaf.engine.TemplateManager.resolveTemplate(TemplateManager.java:870)
at org.thymeleaf.engine.TemplateManager.parseAndProcess(TemplateManager.java:607)
at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1098)
at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1072)
at org.thymeleaf.spring5.view.ThymeleafView.renderFragment(ThymeleafView.java:354)
...
from which I'd thought, that application context path got somewhat lost, and maybe the app should query cchAdmin/instances instead of /instances.
"Disappearing" context path, if that's the case, is set via <context-root>/cchAdmin</context-root> in weblogic.xml, while there insn't any configuration for spring-boot-admin. Only spring-boot-client got some configuration, but that one seems to be working.
any ideas what could be wrong here? I don't see any way to specify context-path for admin project, spring.boot.admin.context-path does something else, and spring.boot.admin.ui.public-url does not help. Spring boot admin version is: 2.0.4

What causes this "Unexpected element" that throws XMLStreamValidationException in JBoss config?

I am trying to migrate some software from JBoss 5 to JBoss 7. I am stuck, as my deployment fails with the below exceptions. Keep in mind that the software is working in JBoss 5, so anything that is not working should be because of differences between JBoss 5/7, I assume.
The line in question (line 12, as pointed to in the exception), is the following:
<application-policy xmlns="urn:jboss:security-beans:1.0" name="MyProjectDatabaseLogin">
The errors/exceptions are:
ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC000001: Failed to start service jboss.deployment.unit."myear.ear".PARSE: org.jboss.msc.service.StartException in service jboss.deployment.unit."myear.ear".PARSE: WFLYSRV0153: Failed to process phase PARSE of deployment "myear.ear"
[stack trace omitted]
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYPOJO0038: Exception while parsing POJO descriptor file: "/content/myear.ear/META-INF/myproject-auth-jboss-beans.xml"
[stack trace omitted]
Caused by: org.projectodd.vdx.core.XMLStreamValidationException: ParseError at [row,col]:[12,4]
Message: ParseError at [row,col]:[12,4]
Message: WFLYCTL0198: Unexpected element '{urn:jboss:security-beans:1.0}application-policy' encountered
[stack trace omitted]
ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "myear.ear")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"myear.ear\".PARSE" => "WFLYSRV0153: Failed to process phase PARSE of deployment \"myear.ear\"
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYPOJO0038: Exception while parsing POJO descriptor file: \"/content/myear.ear/META-INF/myproject-auth-jboss-beans.xml\"
Caused by: org.projectodd.vdx.core.XMLStreamValidationException: ParseError at [row,col]:[12,4]
Message: ParseError at [row,col]:[12,4]
Message: WFLYCTL0198: Unexpected element '{urn:jboss:security-beans:1.0}application-policy' encountered"}}
Why is application-policy (or the xmlns value for it) unexpected here? What is causing this exception?
I had to manually type the above xml line and errors/exceptions, so it is possible there could be some typos not actually present in the original which do not contribute to the problem, though I have reread my question here several times and I don't think I typo'd the above.
I eventually figured out that these configurable items are no longer supposed to be in the same file. This information is now supposed to be in the server's configuration file, so you will probably put it into either the domain.xml file or the standalone.xml file.
This is a security application policy, so the contents of this tag now go into the <security-domains> section in a <security-domain> tag.
So it would be like the following. Notice that <application-policy ...> is now <security-domain ...> and it is within <security-domains>. Also, my security application-policy from before had two <login-module> within it, but if the new elytra security system is used, then only 1 <login-module> tag is allowed in the security-domain...
...
<security-domains> <!-- Search for this in the file and put the migrated part into here -->
<security-domain name="MySecurityDomain">
... all the stuff that used to be in the security application policy
... note that some of the stuff you put in here might need to change depending on the security system used
</security-domain>
</security-domains>
...

Spinnaker: URLRedirection cannot recognize subpath

I know its experimental, I am trying to setup use docker-compose to build Spinnaker. I am seeing an error when trying to browse localhost:9000. Its trying to redirect to this page.
http://localhost:8084/auth/redirectto=http%3A%2F%2Flocalhost%3A9000%2F%23%2Finfrastructure
Looks like either its a fiat or gate issue. Tried adding proxy to apache2.
Errors in Fiat:
RetrofitError: unexpected url: front50/serviceAccounts
2017-09-15 19:24:31.642 WARN 1 --- [ont50Service-10]
c.n.s.f.p.internal.Front50Service : [] Falling back to service
account cache. Cause: unexpected url: front50/serviceAccounts
2017-09-15 19:24:31.645 WARN 1 --- [ecutionAction-1]
c.n.s.fiat.roles.UserRolesSyncer : [] User permission sync
failed. Server status is DOWN. Trying again in 10000 ms. Cause:
(Provider: DefaultServiceAccountProvider) retrofit.RetrofitError:
unexpected url: front50/serviceAccounts
Errors in gate:
2017-09-15 19:18:19.386 ERROR 1 --- [ost-startStop-1]
o.s.b.b.PropertiesConfigurationFactory : Properties configuration
failed validation
2017-09-15 19:18:19.394 ERROR 1 --- [ost-startStop-1]
o.s.b.b.PropertiesConfigurationFactory : Field error in object
'target' on field 'services[ORCA_HOST]': rejected value [orca]; codes
For errors in fiat, you can configure the environment variable in docker compose to
environment:
- "SERVICES_CLOUDDRIVER_BASEURL=http://clouddriver:7002"
- "SERVICES_FRONT50_BASEURL=http://front50:8080"
Update: This workaround work for Gate
environment:
- "services.clouddriver.host=clouddriver"
- "services.echo.host=echo"
- "services.front50.host=front50"
- "services.igor.host=igor"
- "services.orca.host=orca"
- "services.rosco.host=rosco"

Apache Axis2 rahas-1.6.2.mar toSAXParseException when Axis2 is deploying rahas

I amy writing an Apache Axis2 client to call some remote web services.
I can get it to work but I also need to deploy the rahas model because the remote server is using security. When I add rahas-1.6.2.mar to my $Axis_Home/repository/module I get the exception below. If I remove it then I do not get the exception.
Does anyone know how to fix this?
2012/11/29 20:45:43:567 GMT [ERROR] XMLConfigurator - Configuration
file does not validate against schema org.xml.sax.SAXParseException: UndeclaredPrefix:
Cannot resolve 'xt:DEFAULT' as a QName: the prefix 'xt' is not
declared. at
com.sun.org.apache.xerces.internal.jaxp.validation.Util.toSAXParseException(Util.java:109)
at
com.sun.org.apache.xerces.internal.jaxp.validation.ErrorHandlerAdaptor.error(ErrorHandlerAdaptor.java:104)
at
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:382)
at
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:316)
at
com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:429)
at
com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3185)
at
com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.processOneAttribute(XMLSchemaValidator.java:2799)
at
com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.processAttributes(XMLSchemaValidator.java:2735)
at
com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:2094)
at
com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:705)
at
com.sun.org.apache.xerces.internal.jaxp.validation.ValidatorHandlerImpl.startElement(ValidatorHandlerImpl.java:335)
at
org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1072)
at
org.apache.xml.serializer.TreeWalker.startNode(TreeWalker.java:357)
at org.apache.xml.serializer.TreeWalker.traverse(TreeWalker.java:143)
at
org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:389)
at
com.sun.org.apache.xerces.internal.jaxp.validation.ValidatorImpl.process(ValidatorImpl.java:220)
at
com.sun.org.apache.xerces.internal.jaxp.validation.ValidatorImpl.validate(ValidatorImpl.java:141)
at javax.xml.validation.Validator.validate(Validator.java:82) at
org.opensaml.xml.XMLConfigurator.validateConfiguration(XMLConfigurator.java:373)
at org.opensaml.xml.XMLConfigurator.load(XMLConfigurator.java:162)
at org.opensaml.xml.XMLConfigurator.load(XMLConfigurator.java:142)
at
org.opensaml.DefaultBootstrap.initializeXMLTooling(DefaultBootstrap.java:199)
at
org.apache.rahas.RampartSAMLBootstrap.bootstrap(RampartSAMLBootstrap.java:79)
at org.apache.rahas.Rahas.init(Rahas.java:41) at
org.apache.axis2.context.ConfigurationContextFactory.initModules(ConfigurationContextFactory.java:252)
at
org.apache.axis2.context.ConfigurationContextFactory.init(ConfigurationContextFactory.java:230)
at
org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:93)
at
org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContextFromFileSystem(ConfigurationContextFactory.java:210)