Open 4erdenko opened 3 months ago
Thanks for reporting this issue! It seems like the obfuscated name has changed in the latest version so the agent injected the wrong place. I will made a fix sometime later today. Probably I will use the method mentioned in issue #2. If there is performance issue caused by the fix, I may change it back to my original method.
For now, you can downgrade to a order version to keep your service up, and then after I fix this issue you can upgrade to the latest version again.
Oh hi! I was tried this:
package icu.lama.artifactory.agent.patches;
import javassist.CtClass;
import javassist.CtField;
import javassist.Modifier;
import javassist.NotFoundException;
import org.jetbrains.annotations.Nullable;
import java.util.Arrays;
public class PatcherLicenseParser extends ClassPatch {
public PatcherLicenseParser() {
super("org.jfrog.license.api.LicenseParser", "org.jfrog.license.api.LicenseManager");
}
@Override
byte[] onTransform(String className, CtClass clazz, byte[] classBuf) throws Throwable {
var overrides = "";
var publicKeyFieldD = tryGetDeclaredField(clazz, "d"); // Было c, стало d
if (publicKeyFieldD != null) {
publicKeyFieldD.setModifiers(Modifier.PRIVATE + Modifier.STATIC);
overrides += "d = icu.lama.artifactory.agent.AgentMain.PUBLIC_KEY;";
}
var publicKeyFieldE = tryGetDeclaredField(clazz, "e"); // Было d, стало e
if (publicKeyFieldE != null) {
publicKeyFieldE.setModifiers(Modifier.PRIVATE + Modifier.STATIC);
overrides += "e = icu.lama.artifactory.agent.AgentMain.PUBLIC_KEY;";
}
var publicKeyFieldF = tryGetDeclaredField(clazz, "f"); // Новое поле f
if (publicKeyFieldF != null) {
publicKeyFieldF.setModifiers(Modifier.PRIVATE + Modifier.STATIC);
overrides += "f = icu.lama.artifactory.agent.AgentMain.PUBLIC_KEY;";
}
var publicKeyFieldNObf = tryGetDeclaredField(clazz, "jfrogPublicKey");
if (publicKeyFieldNObf != null) {
publicKeyFieldNObf.setModifiers(Modifier.PRIVATE + Modifier.STATIC);
overrides += "jfrogPublicKey = icu.lama.artifactory.agent.AgentMain.PUBLIC_KEY;";
}
var clinitMethod = Arrays.stream(clazz.getDeclaredBehaviors()).filter((it) -> "<clinit>".equals(it.getMethodInfo().getName())).findAny();
if (!clinitMethod.isPresent()) {
throw new Throwable("Corrupted class!");
}
clinitMethod.get().insertAfter(overrides);
clazz.detach();
return clazz.toBytecode();
}
private @Nullable CtField tryGetDeclaredField(CtClass clazz, String field) {
try {
return clazz.getDeclaredField(field);
} catch (NotFoundException e) {
return null;
}
}
}
Its works but get some error when init
`artifactory-ha-0.license.key`. Not trying again (exceeded number of attempts (5))
2024-08-07T20:26:15.096Z [1;32m[jfrt ][0;39m [1;31m[ERROR][0;39m [8214905df05069a1] [o.a.l.v.log:334 ] [art-init ] - Failed to activate license
java.util.concurrent.ExecutionException: org.jfrog.common.ExecutionFailed: Last retry failed: Could not update configuration for key `artifactory-ha-0.license.key`. Not trying again (exceeded number of attempts (5))
at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:396)
at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2073)
at io.vavr.control.Try.of(Try.java:75)
at org.jfrog.access.client.platformconfig.GrpcPlatformConfigClientImpl.updateConfig(GrpcPlatformConfigClientImpl.java:169)
at org.jfrog.access.client.platformconfig.GrpcPlatformConfigClientImpl.setConfig(GrpcPlatformConfigClientImpl.java:247)
at org.jfrog.access.client.platformconfig.LicenseClientImpl.add(LicenseClientImpl.java:31)
at org.artifactory.security.access.AccessServiceImpl.sendLicenseToAccess(AccessServiceImpl.java:2003)
at org.artifactory.security.access.AccessServiceImpl.onLicenseLoaded(AccessServiceImpl.java:1847)
at java.base/java.util.LinkedHashMap$LinkedValues.forEach(LinkedHashMap.java:647)
at org.artifactory.addon.LicenseAddonsManagerImpl.activateLicense(Artifactory:322)
at org.artifactory.addon.LicenseAddonsManagerImpl.prepareAddonManager(Artifactory:148)
at org.artifactory.addon.AddonsManagerImpl.prepareAddonManager(Artifactory:109)
at org.artifactory.addon.AddonsManagerImpl.onBeforeContextCreated(Artifactory:578)
at org.artifactory.spring.ArtifactoryApplicationContext.onBeforeContextCreated(ArtifactoryApplicationContext.java:392)
at org.artifactory.spring.ArtifactoryApplicationContext.refresh(ArtifactoryApplicationContext.java:310)
at org.artifactory.spring.ArtifactoryApplicationContext.<init>(ArtifactoryApplicationContext.java:183)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
at org.artifactory.lifecycle.webapp.servlet.ArtifactoryContextConfigListener.configure(ArtifactoryContextConfigListener.java:272)
at org.artifactory.lifecycle.webapp.servlet.ArtifactoryContextConfigListener$1.run(ArtifactoryContextConfigListener.java:127)
Caused by: org.jfrog.common.ExecutionFailed: Last retry failed: Could not update configuration for key `artifactory-ha-0.license.key`. Not trying again (exceeded number of attempts (5))
at org.jfrog.common.ExecutionUtils.handleStopError(ExecutionUtils.java:307)
at org.jfrog.common.ExecutionUtils.handleFunctionExecution(ExecutionUtils.java:197)
at org.jfrog.common.ExecutionUtils.lambda$generateExecutionRunnable$1(ExecutionUtils.java:135)
at org.jfrog.common.ExecutionUtils$MDCRunnableDecorator.run(ExecutionUtils.java:323)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:131)
at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:76)
at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:82)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: org.jfrog.common.RetryException: Could not update configuration for key `artifactory-ha-0.license.key`
at org.jfrog.access.client.platformconfig.GrpcPlatformConfigClientImpl.lambda$getConfigApplier$11(GrpcPlatformConfigClientImpl.java:186)
at io.vavr.API$Match$Case0.apply(API.java:5135)
at io.vavr.API$Match.option(API.java:5105)
at io.vavr.control.Try.mapFailure(Try.java:602)
at org.jfrog.access.client.platformconfig.GrpcPlatformConfigClientImpl.getConfigApplier(GrpcPlatformConfigClientImpl.java:184)
at org.jfrog.access.client.platformconfig.GrpcPlatformConfigClientImpl.lambda$updateConfig$5(GrpcPlatformConfigClientImpl.java:168)
at org.jfrog.common.ExecutionUtils.handleFunctionExecution(ExecutionUtils.java:190)
... 9 common frames omitted
Caused by: io.grpc.StatusRuntimeException: INTERNAL: Cannot invoke "org.jfrog.access.server.service.license.License.getProducts()" because "license" is null
at io.grpc.stub.ClientCalls.toStatusRuntimeException(ClientCalls.java:268)
at io.grpc.stub.ClientCalls.getUnchecked(ClientCalls.java:249)
at io.grpc.stub.ClientCalls.blockingUnaryCall(ClientCalls.java:167)
at org.jfrog.access.proto.generated.PlatformConfigResourceGrpc$PlatformConfigResourceBlockingStub.setConfig(PlatformConfigResourceGrpc.java:498)
at org.jfrog.access.client.platformconfig.GrpcPlatformConfigClientImpl.lambda$getConfigApplier$9(GrpcPlatformConfigClientImpl.java:182)
at io.vavr.control.Try.mapTry(Try.java:634)
at io.vavr.control.Try.map(Try.java:585)
at org.jfrog.access.client.platformconfig.GrpcPlatformConfigClientImpl.getConfigApplier(GrpcPlatformConfigClientImpl.java:180)
... 11 common frames omitted
2024-08-07T20:26:16.980Z [1;32m[jfrt ][0;39m [1;31m[ERROR][0;39m [8214905df05069a1] [o.j.c.ExecutionUtils:305 ] [jf-common-pool-0 ] - Last retry failed: Could not update configuration for key `artifactory-ha-0.license.key`. Not trying again (exceeded number of attempts (5))
2024-08-07T20:26:16.981Z [1;32m[jfrt ][0;39m [1;31m[ERROR][0;39m [8214905df05069a1] [o.a.l.v.log:334 ] [art-init ] - Failed to activate license
java.util.concurrent.ExecutionException: org.jfrog.common.ExecutionFailed: Last retry failed: Could not update configuration for key `artifactory-ha-0.license.key`. Not trying again (exceeded number of attempts (5))
at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:396)
at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2073)
at io.vavr.control.Try.of(Try.java:75)
at org.jfrog.access.client.platformconfig.GrpcPlatformConfigClientImpl.updateConfig(GrpcPlatformConfigClientImpl.java:169)
at org.jfrog.access.client.platformconfig.GrpcPlatformConfigClientImpl.setConfig(GrpcPlatformConfigClientImpl.java:247)
at org.jfrog.access.client.platformconfig.LicenseClientImpl.add(LicenseClientImpl.java:31)
at org.artifactory.security.access.AccessServiceImpl.sendLicenseToAccess(AccessServiceImpl.java:2003)
at org.artifactory.security.access.AccessServiceImpl.onLicenseLoaded(AccessServiceImpl.java:1847)
at java.base/java.util.LinkedHashMap$LinkedValues.forEach(LinkedHashMap.java:647)
at org.artifactory.addon.LicenseAddonsManagerImpl.activateLicense(Artifactory:322)
at org.artifactory.addon.LicenseAddonsManagerImpl.prepareAddonManager(Artifactory:148)
at org.artifactory.addon.LicenseAddonsManagerImpl.onBeforeContextCreated(Artifactory:1188)
at org.artifactory.spring.ArtifactoryApplicationContext.onBeforeContextCreated(ArtifactoryApplicationContext.java:392)
at org.artifactory.spring.ArtifactoryApplicationContext.refresh(ArtifactoryApplicationContext.java:310)
at org.artifactory.spring.ArtifactoryApplicationContext.<init>(ArtifactoryApplicationContext.java:183)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
at org.artifactory.lifecycle.webapp.servlet.ArtifactoryContextConfigListener.configure(ArtifactoryContextConfigListener.java:272)
at org.artifactory.lifecycle.webapp.servlet.ArtifactoryContextConfigListener$1.run(ArtifactoryContextConfigListener.java:127)
Caused by: org.jfrog.common.ExecutionFailed: Last retry failed: Could not update configuration for key `artifactory-ha-0.license.key`. Not trying again (exceeded number of attempts (5))
at org.jfrog.common.ExecutionUtils.handleStopError(ExecutionUtils.java:307)
at org.jfrog.common.ExecutionUtils.handleFunctionExecution(ExecutionUtils.java:197)
at org.jfrog.common.ExecutionUtils.lambda$generateExecutionRunnable$1(ExecutionUtils.java:135)
at org.jfrog.common.ExecutionUtils$MDCRunnableDecorator.run(ExecutionUtils.java:323)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:131)
at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:76)
at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:82)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: org.jfrog.common.RetryException: Could not update configuration for key `artifactory-ha-0.license.key`
at org.jfrog.access.client.platformconfig.GrpcPlatformConfigClientImpl.lambda$getConfigApplier$11(GrpcPlatformConfigClientImpl.java:186)
at io.vavr.API$Match$Case0.apply(API.java:5135)
at io.vavr.API$Match.option(API.java:5105)
at io.vavr.control.Try.mapFailure(Try.java:602)
at org.jfrog.access.client.platformconfig.GrpcPlatformConfigClientImpl.getConfigApplier(GrpcPlatformConfigClientImpl.java:184)
at org.jfrog.access.client.platformconfig.GrpcPlatformConfigClientImpl.lambda$updateConfig$5(GrpcPlatformConfigClientImpl.java:168)
at org.jfrog.common.ExecutionUtils.handleFunctionExecution(ExecutionUtils.java:190)
... 9 common frames omitted
Caused by: io.grpc.StatusRuntimeException: INTERNAL: Cannot invoke "org.jfrog.access.server.service.license.License.getProducts()" because "license" is null
at io.grpc.stub.ClientCalls.toStatusRuntimeException(ClientCalls.java:268)
at io.grpc.stub.ClientCalls.getUnchecked(ClientCalls.java:249)
at io.grpc.stub.ClientCalls.blockingUnaryCall(ClientCalls.java:167)
at org.jfrog.access.proto.generated.PlatformConfigResourceGrpc$PlatformConfigResourceBlockingStub.setConfig(PlatformConfigResourceGrpc.java:498)
at org.jfrog.access.client.platformconfig.GrpcPlatformConfigClientImpl.lambda$getConfigApplier$9(GrpcPlatformConfigClientImpl.java:182)
at io.vavr.control.Try.mapTry(Try.java:634)
at io.vavr.control.Try.map(Try.java:585)
at org.jfrog.access.client.platformconfig.GrpcPlatformConfigClientImpl.getConfigApplier(GrpcPlatformConfigClientImpl.java:180)
... 11 common frames omitted
Thanks for the report. I will investigate on this. Can you also provide the license as well?
Sure. Im not changing Keygen, so:
eyJzaWduYXR1cmUiOiJLZG5TNXRIVnBSbDJTa1hCUHF6d1NPUzdhOWs4SnV3U2pBMXZnSHh5b1lR
dVZ4Y2FCTmNwV2FHZ3VneFNma1lWaFVlK0NFYW5DNVJ2V2cyMzVVa3RQQ2JEK0owMHlJZkVBM3cx
eEdwTG5mVEUvNjNJMysxVVNZdzdnU2g2VVRDRnA3UWhMaDVLVXBLbnVSd3BzSlJRMGJJZUozdzVn
eW9JdWZVZFBWS0VaQm5LUmdFZmh6VVhzV0FKUkxGTWdxVkdkZlkrbXdlV0IwZENPV1hiVjFHbSt1
RW1MbTQvNmpqUXJZVEMxaVFkMUo0T1ZNQ3NEWGtmbWdBMTB3elhDUVhzMXdxSSt3RVV5c29ZRWFs
VkF5OEMveDRWc1dZbXM3ZkgwQlphMkZxK0J0dTNxZ1BXVjU1ZjBkenRncU85QVhTN0d1b21EV2Y4
S1lZQVBuSytEZmZiYkhqOXk3Y0NKSW1xQmppVUlTVWR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eFRtTnNWV3R4YUZaUE5HdEViMjR2WmpCVEsxSTNaMUUwTWtORWN6WlZhRTlDYjI5VGFrVlZWSFpI
YmpBOUNuWmhiR2xrWVhSbFQyNXNhVzVsT2lCbVlXeHpaUXAyWlhKemFXOXVPaUF5Q2c9PSJ9
I pass the licenses in advance in values.yaml (via HELM). Therefore, they are initialized immediately and, despite the error, they work in version 7.90.5. Now I'm trying in 7.90.6.
942ef8d should work on the latest version. However, I have trouble deploying Artifactory, so I can't really test it. I will keep this issue open until I or maybe you can help me tested out.
@Lama3L9R I compiled new jar files, created new keys, and deployed them. The keys, just like in my version where I only changed the patcher file, worked and were added.
But there is still an error in the logs. I pass the keys in advance in 1 file during deployment.
The first block of the error in the file is related to the keys that I pass in advance in the file. The second block, which is slightly lower and larger, is related to how I added another key through the UI. Visually, the process does not complete, but the key is added. artifactory2.log
Thanks for reporting! Since I had trouble deploying the server, I can't debug those errors, since I have never got a chance to let Artifactpry verify my license. When I run Artifactory on my machine, the router component seems malfunctioning, which caused /ui/
to return a 404 error. Currently, I still didn't figure it out. I will try run the server in a clean virtual machine.
Thanks for reporting! Since I had trouble deploying the server, I can't debug those errors, since I have never got a chance to let Artifactpry verify my license. When I run Artifactory on my machine, the router component seems malfunctioning, which caused
/ui/
to return a 404 error. Currently, I still didn't figure it out. I will try run the server in a clean virtual machine.
Yes, I am using a separate server for this. I can suggest this compose file that I initially checked. It will be easier than Helm in K8s.
services:
postgres:
image: postgres:13
container_name: artifactory-postgres
environment:
POSTGRES_DB: artifactory
POSTGRES_USER: artifactory
POSTGRES_PASSWORD: password
volumes:
- postgres-data:/var/lib/postgresql/data
ports:
- "5432:5432"
artifactory:
image: releases-docker.jfrog.io/jfrog/artifactory-pro:7.90.6
container_name: artifactory
ports:
- "8081:8081"
- "8082:8082"
depends_on:
- postgres
volumes:
- artifactory-data:/var/opt/jfrog/artifactory
- ./ArtifactoryAgent-1.0-SNAPSHOT-all.jar:/opt/jfrog/artifactory/var/bootstrap/ArtifactoryAgent-1.0-SNAPSHOT-all.jar
environment:
- JF_ROUTER_ENTRYPOINTS_EXTERNALPORT=8082
- JF_SHARED_DATABASE_TYPE=postgresql
- JF_SHARED_DATABASE_DRIVER=org.postgresql.Driver
- JF_SHARED_DATABASE_URL=jdbc:postgresql://postgres:5432/artifactory
- JF_SHARED_DATABASE_USERNAME=artifactory
- JF_SHARED_DATABASE_PASSWORD=password
- EXTRA_JAVA_OPTIONS=-javaagent:/opt/jfrog/artifactory/var/bootstrap/ArtifactoryAgent-1.0-SNAPSHOT-all.jar
restart: unless-stopped
ulimits:
nproc: 65535
nofile:
soft: 32000
hard: 40000
volumes:
artifactory-data:
postgres-data:
By the way, the agent's position inside the container doesn't actually matter; it can be run from other locations as well.
@Lama3L9R Hey! How its going ? Can i help you?
@Lama3L9R Hi Would you mind to release latest version binaries for testing? Weak in Java to build it myself :(
Sorry, I was so busy these days. I really want focus on this project but I have to do other things. I will post the agent fix binaries later today. Maybe for that error, if it doesn't really affect anything, let's just ignore it for now.
Sorry, I was so busy these days. I really want focus on this project but I have to do other things. I will post the agent fix binaries later today. Maybe for that error, if it doesn't really affect anything, let's just ignore it for now.
I am ready to actively collaborate in testing; we could exchange Telegram contacts, for example. The error doesn't seem to have an impact, but I still don't fully understand it. I add the keys in advance during deployment.
Hi I've managed to build .jar files, but in debt on how the .war files was built? Internet says: there should be some SpringBootServletInitializer subclass, which I can't find in the source code
There shouldn't be any war files at all. Use the agent as a Java Agent (java -javaagent:/path/to/agent.jar
). Old keygen will work.
Oops, accidentally pressed on close with comment. This issue will mainly focus on those weird exceptions from now.
Sorry, I was so busy these days. I really want focus on this project but I have to do other things. I will post the agent fix binaries later today. Maybe for that error, if it doesn't really affect anything, let's just ignore it for now.
I am ready to actively collaborate in testing; we could exchange Telegram contacts, for example. The error doesn't seem to have an impact, but I still don't fully understand it. I add the keys in advance during deployment.
Sure, @hereLamadaemon on Telegram
With Agent from master it works on 7.90.5. However console.log contains license-related WARN:
2024-08-25T09:20:01.042Z [jfac ] [WARN ] [48ffc605f055e3a5] [l.LegacyLicenseServiceImpl:274] [c-default-executor-1] - Invalid license.
org.jfrog.license.exception.LicenseException: Failed to decrypt license: last block incomplete in decryption
at org.jfrog.license.legacy.LegacyLicenseManager.decrypt(LegacyLicenseManager.java:145)
at org.jfrog.license.legacy.LegacyLicenseManager.load(LegacyLicenseManager.java:89)
at org.jfrog.license.api.LicenseManager.loadLegacyLicense(LicenseManager.java:250)
at org.jfrog.license.api.LicenseManager.loadLicense(LicenseManager.java:108)
at org.jfrog.access.server.service.license.LegacyLicenseServiceImpl.loadLicense(LegacyLicenseServiceImpl.java:272)
at org.jfrog.access.server.service.license.LicenseRegistratorHandlerEventListener.lambda$getLicensesAndHashes$5740e2c0$1(LicenseRegistratorHandlerEventListener.java:143)
at io.vavr.control.Try.of(Try.java:75)
at org.jfrog.access.server.service.license.LicenseRegistratorHandlerEventListener.lambda$getLicensesAndHashes$8(LicenseRegistratorHandlerEventListener.java:143)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
at java.base/java.util.AbstractList$RandomAccessSpliterator.forEachRemaining(AbstractList.java:720)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
at org.jfrog.access.server.service.license.LicenseRegistratorHandlerEventListener.getLicensesAndHashes(LicenseRegistratorHandlerEventListener.java:148)
at org.jfrog.access.server.service.license.LicenseRegistratorHandlerEventListener.handleLicenseConfigUpdate(LicenseRegistratorHandlerEventListener.java:55)
at org.jfrog.access.server.service.license.LicenseRegistratorHandlerEventListener.listenToLicenseChanges(LicenseRegistratorHandlerEventListener.java:49)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.springframework.context.event.ApplicationListenerMethodAdapter.doInvoke(ApplicationListenerMethodAdapter.java:344)
at org.springframework.context.event.ApplicationListenerMethodAdapter.processEvent(ApplicationListenerMethodAdapter.java:229)
at org.springframework.context.event.ApplicationListenerMethodAdapter.onApplicationEvent(ApplicationListenerMethodAdapter.java:166)
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:178)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:171)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:145)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:430)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:400)
at org.jfrog.access.server.service.platformconfig.PlatformConfigService.publishConfigUpdate(PlatformConfigService.java:157)
at org.jfrog.access.server.service.platformconfig.PlatformConfigService.publishUpdateEvents(PlatformConfigService.java:143)
at org.jfrog.access.server.service.platformconfig.PlatformConfigService.publishUpdateEvents(PlatformConfigService.java:139)
at org.jfrog.access.server.service.platformconfig.PlatformConfigService.updateConfiguration(PlatformConfigService.java:104)
at org.jfrog.access.server.rpc.service.PlatformConfigServiceDelegate.lambda$setConfig$0(PlatformConfigServiceDelegate.java:45)
at org.jfrog.access.server.rpc.service.GrpcResponseUtils.respond(GrpcResponseUtils.java:19)
at org.jfrog.access.server.rpc.service.PlatformConfigServiceDelegate.setConfig(PlatformConfigServiceDelegate.java:42)
at org.jfrog.access.server.rpc.service.RpcPlatformConfigResource.lambda$setConfig$0(RpcPlatformConfigResource.java:46)
at org.jfrog.access.server.rpc.service.RpcPlatformConfigResource.setErrorInResObserverIfJfconfigEnabled(RpcPlatformConfigResource.java:86)
at org.jfrog.access.server.rpc.service.RpcPlatformConfigResource.setConfig(RpcPlatformConfigResource.java:45)
at org.jfrog.access.proto.generated.PlatformConfigResourceGrpc$MethodHandlers.invoke(PlatformConfigResourceGrpc.java:677)
at io.grpc.stub.ServerCalls$UnaryServerCallHandler$UnaryServerCallListener.onHalfClose(ServerCalls.java:182)
at io.grpc.PartialForwardingServerCallListener.onHalfClose(PartialForwardingServerCallListener.java:35)
at io.grpc.ForwardingServerCallListener.onHalfClose(ForwardingServerCallListener.java:23)
at io.grpc.ForwardingServerCallListener$SimpleForwardingServerCallListener.onHalfClose(ForwardingServerCallListener.java:40)
at io.grpc.PartialForwardingServerCallListener.onHalfClose(PartialForwardingServerCallListener.java:35)
at io.grpc.ForwardingServerCallListener.onHalfClose(ForwardingServerCallListener.java:23)
at io.grpc.ForwardingServerCallListener$SimpleForwardingServerCallListener.onHalfClose(ForwardingServerCallListener.java:40)
at org.jfrog.access.server.rpc.service.WrappingSimpleForwardingCallListener.lambda$onHalfClose$0(WrappingSimpleForwardingCallListener.java:15)
at org.jfrog.access.server.rpc.service.interceptor.TokenServerInterceptor$AuthenticationWrappingSimpleForwardingCallListener.wrap(TokenServerInterceptor.java:87)
at org.jfrog.access.server.rpc.service.WrappingSimpleForwardingCallListener.onHalfClose(WrappingSimpleForwardingCallListener.java:15)
at io.grpc.PartialForwardingServerCallListener.onHalfClose(PartialForwardingServerCallListener.java:35)
at io.grpc.ForwardingServerCallListener.onHalfClose(ForwardingServerCallListener.java:23)
at io.grpc.ForwardingServerCallListener$SimpleForwardingServerCallListener.onHalfClose(ForwardingServerCallListener.java:40)
at io.grpc.Contexts$ContextualizedServerCallListener.onHalfClose(Contexts.java:86)
at io.grpc.PartialForwardingServerCallListener.onHalfClose(PartialForwardingServerCallListener.java:35)
at io.grpc.ForwardingServerCallListener.onHalfClose(ForwardingServerCallListener.java:23)
at io.grpc.ForwardingServerCallListener$SimpleForwardingServerCallListener.onHalfClose(ForwardingServerCallListener.java:40)
at org.jfrog.access.server.rpc.service.interceptor.ExceptionHandler$ExceptionHandlingServerCallListener.onHalfClose(ExceptionHandler.java:56)
at io.grpc.PartialForwardingServerCallListener.onHalfClose(PartialForwardingServerCallListener.java:35)
at io.grpc.ForwardingServerCallListener.onHalfClose(ForwardingServerCallListener.java:23)
at io.grpc.ForwardingServerCallListener$SimpleForwardingServerCallListener.onHalfClose(ForwardingServerCallListener.java:40)
at org.jfrog.access.server.rpc.service.WrappingSimpleForwardingCallListener.lambda$onHalfClose$0(WrappingSimpleForwardingCallListener.java:15)
at org.jfrog.access.server.rpc.service.interceptor.TracerServerInterceptor$ContextServerCallListener.wrap(TracerServerInterceptor.java:80)
at org.jfrog.access.server.rpc.service.WrappingSimpleForwardingCallListener.onHalfClose(WrappingSimpleForwardingCallListener.java:15)
at io.grpc.PartialForwardingServerCallListener.onHalfClose(PartialForwardingServerCallListener.java:35)
at io.grpc.ForwardingServerCallListener.onHalfClose(ForwardingServerCallListener.java:23)
at io.grpc.ForwardingServerCallListener$SimpleForwardingServerCallListener.onHalfClose(ForwardingServerCallListener.java:40)
at io.grpc.Contexts$ContextualizedServerCallListener.onHalfClose(Contexts.java:86)
at io.grpc.internal.ServerCallImpl$ServerStreamListenerImpl.halfClosed(ServerCallImpl.java:356)
at io.grpc.internal.ServerImpl$JumpToApplicationThreadServerStreamListener$1HalfClosed.runInContext(ServerImpl.java:861)
at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:133)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: javax.crypto.IllegalBlockSizeException: last block incomplete in decryption
at org.bouncycastle.jcajce.provider.symmetric.util.BaseBlockCipher.engineDoFinal(Unknown Source)
at java.base/javax.crypto.Cipher.doFinal(Cipher.java:2205)
at org.jfrog.license.legacy.LegacyLicenseManager.decrypt(LegacyLicenseManager.java:142)
... 78 common frames omitted
I think this is probably because there are two copies of LicenseManager in Artifactory, and one of them is obfuscated version and another one is the normal one. I found this when I first released this crack, but at that time, if you don't patch the normal one, it will not work. In the current version, this is not a problem. So my point is, this issue is probably because Artifactory's code is terribly bad.As long as the agent is working, it should be fine.