I’m trying to setup Harness CD Community in my home lab for testing. I installed harness via docker-compose on an Ubuntu 20.04 VM. When I go to add a delegate via docker method it never connects. I am using launch-harness-delegate.sh script to launch delegate.
am not sure how to get the ACCOUNT_SECRET but I created a new delegate token and using the same in below script.
#!/bin/bash -e
sudo docker pull harness/delegate:latest
sudo docker run -d --restart unless-stopped --hostname=$(hostname -f)
-e ACCOUNT_ID=Wr4V3RtORYmdSZaRvDuEdA
-e ACCOUNT_SECRET=70b67cdaf6828a097dc8f474350bcdf5
-e MANAGER_HOST_AND_PORT=https://app.harness.io/gratis
-e WATCHER_STORAGE_URL=https://app.harness.io/storage/wingswatchers
-e WATCHER_CHECK_LOCATION=watcherprod.txt
-e DELEGATE_STORAGE_URL=https://app.harness.io/storage/wingsdelegates
-e DELEGATE_CHECK_LOCATION=delegatefree.txt
-e DEPLOY_MODE=KUBERNETES
-e PROXY_HOST=10.158.100.1
-e PROXY_PORT=8080
-e PROXY_SCHEME=HTTP
-e PROXY_USER=
-e PROXY_PASSWORD=
-e NO_PROXY=
-e PROXY_MANAGER=true
-e POLL_FOR_TASKS=false
-e HELM_DESIRED_VERSION=
-e CF_PLUGIN_HOME=
-e MANAGER_TARGET=app.harness.io
-e MANAGER_AUTHORITY=gratis-manager-grpc-app.harness.io
harness/delegate:latest
log details:
rsioned - at io.harness.security.TokenGenerator.makeEncrypter(TokenGenerator.java:115)
2022-12-04 19:57:41,292 [1.0.77209-000] 44 [Thread-17] ERROR io.harness.watcher.service.WatcherServiceImpl.DelegateStartScriptVersioned - … 24 more
2022-12-04 19:57:41,283 [1.0.77609-000] 245 [main] ERROR io.harness.delegate.app.DelegateApplication - Delegate process initialization failed
com.google.inject.CreationException: Unable to create injector, see the following errors:
- An exception was caught and reported. Message: Failed to initialize token generator
at io.harness.delegate.app.modules.DelegateAgentModule.configure(DelegateAgentModule.java:58) (via modules: io.harness.delegate.app.modules.DelegateAgentModule → io.harness.delegate.app.modules.common.DelegateTokensModule)
1 error
at com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:554)
at com.google.inject.internal.InternalInjectorCreator.initializeStatically(InternalInjectorCreator.java:161)
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:108)
at com.google.inject.Guice.createInjector(Guice.java:87)
at com.google.inject.Guice.createInjector(Guice.java:69)
at com.google.inject.Guice.createInjector(Guice.java:59)
at io.harness.delegate.app.DelegateApplication.run(DelegateApplication.java:116)
at io.harness.delegate.app.DelegateApplication.main(DelegateApplication.java:105)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:108)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:58)
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88)
Caused by: io.harness.exception.EncryptDecryptException: Failed to initialize token generator
at io.harness.security.TokenGenerator.makeEncrypter(TokenGenerator.java:118)
at io.harness.security.TokenGenerator.(TokenGenerator.java:56)
at io.harness.delegate.app.modules.common.DelegateTokensModule.configure(DelegateTokensModule.java:23)
at com.google.inject.AbstractModule.configure(AbstractModule.java:61)
at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:347)
at com.google.inject.AbstractModule.install(AbstractModule.java:103)
at io.harness.delegate.app.modules.DelegateAgentModule.configure(DelegateAgentModule.java:58)
at com.google.inject.AbstractModule.configure(AbstractModule.java:61)
at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:347)
at com.google.inject.spi.Elements.getElements(Elements.java:104)
at com.google.inject.internal.InjectorShell$Builder.build(InjectorShell.java:137)
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:105)
… 13 common frames omitted
Caused by: org.apache.commons.codec.DecoderException: Illegal hexadecimal character N at index 0
at org.apache.commons.codec.binary.Hex.toDigit(Hex.java:369)
at org.apache.commons.codec.binary.Hex.decodeHex(Hex.java:107)
at org.apache.commons.codec.binary.Hex.decodeHex(Hex.java:77)
at io.harness.security.TokenGenerator.makeEncrypter(TokenGenerator.java:115)
… 24 common frames omitted
if ACCOUNT_SECRET value is the issue here then please guide how to find the correct details to update the same in config.