Closed tszebeni-asml closed 3 weeks ago
Hello @tszebeni-asml
Can you share an example of the JAVA_TOOL_OPTIONS that you are using?
Did you add it like the following:
JAVA_TOOL_OPTIONS="-Dhttp.proxyHost=your.proxy.net -Dhttp.proxyPort=8080 -Dhttp.nonProxyHosts=XXXXX -Dhttps.proxyHost=your.proxy.net -Dhttps.proxyPort=8080 -Dhttps.nonProxyHosts=XXXXX"
Not sure if your issue is related to this https://github.com/reactor/reactor-netty/issues/887#issuecomment-549439355
In this part of the code:
Hi @alfespa17 , I believe that is related. I'm using the proxy config as in your example, and proxy works for other requests I could see in the application.
Hello @tszebeni-asml I created a small fix but not sure if that will work because I dont have a proxy to test. You can use the following version to validate if my fix solved your issues.
https://github.com/AzBuilder/terrakube/releases/tag/2.21.1-proxy-fix
If that works for you I will merge the change to the main branch
@alfespa17 I was with the same problem and the fix in the 2.21.1-proxy-fix fixed for me. Is is applied in the latest version?
@alfespa17 I was with the same problem and the fix in the 2.21.1-proxy-fix fixed for me. Is is applied in the latest version?
I never merged the PR, because I never got any confirmation and I didn't have a way to test it
@alfespa17 I was with the same problem and the fix in the 2.21.1-proxy-fix fixed for me. Is is applied in the latest version?
I never merged the PR, because I never got any confirmation and I didn't have a way to test it
@gfranco-nos
I imagined this looking the release notes, but works great!
I imagined this looking the release notes, but works great!
In that case I will fix the merge issue and merge that change to main branch, maybe tomorrow
Bad news.. Not working in the workspace routines:
2024-10-10T21:27:06.802Z ERROR 1 --- [nio-8080-exec-8] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed: org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: org.terrakube.api.rs.Organization.template: could not initialize proxy - no Session] with root cause
org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: org.terrakube.api.rs.Organization.template: could not initialize proxy - no Session
at org.hibernate.collection.spi.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:635) ~[hibernate-core-6.2.22.Final.jar:6.2.22.Final]
at org.hibernate.collection.spi.AbstractPersistentCollection.withTemporarySessionIfNeeded(AbstractPersistentCollection.java:218) ~[hibernate-core-6.2.22.Final.jar:6.2.22.Final]
at org.hibernate.collection.spi.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:615) ~[hibernate-core-6.2.22.Final.jar:6.2.22.Final]
at org.hibernate.collection.spi.AbstractPersistentCollection.read(AbstractPersistentCollection.java:136) ~[hibernate-core-6.2.22.Final.jar:6.2.22.Final]
at org.hibernate.collection.spi.PersistentBag.iterator(PersistentBag.java:371) ~[hibernate-core-6.2.22.Final.jar:6.2.22.Final]
at org.terrakube.api.plugin.vcs.WebhookService.createWorkspaceWebhook(WebhookService.java:159) ~[classes/:2.21.1-proxy-fix]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Unknown Source) ~[na:na]
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343) ~[spring-aop-6.0.18.jar:6.0.18]
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:196) ~[spring-aop-6.0.18.jar:6.0.18]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-6.0.18.jar:6.0.18]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:751) ~[spring-aop-6.0.18.jar:6.0.18]
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123) ~[spring-tx-6.0.18.jar:6.0.18]
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:391) ~[spring-tx-6.0.18.jar:6.0.18]
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119) ~[spring-tx-6.0.18.jar:6.0.18]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184) ~[spring-aop-6.0.18.jar:6.0.18]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:751) ~[spring-aop-6.0.18.jar:6.0.18]
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:703) ~[spring-aop-6.0.18.jar:6.0.18]
at org.terrakube.api.plugin.vcs.WebhookService$$SpringCGLIB$$0.createWorkspaceWebhook(<generated>) ~[classes/:2.21.1-proxy-fix]
at org.terrakube.api.rs.hooks.workspace.WorkspaceManageHook.execute(WorkspaceManageHook.java:58) ~[classes/:2.21.1-proxy-fix]
at org.terrakube.api.rs.hooks.workspace.WorkspaceManageHook.execute(WorkspaceManageHook.java:18) ~[classes/:2.21.1-proxy-fix]
at com.yahoo.elide.core.lifecycle.LifeCycleHook.execute(LifeCycleHook.java:45) ~[elide-core-7.0.5.jar:na]
at com.yahoo.elide.core.lifecycle.LifecycleHookInvoker.lambda$onNext$0(LifecycleHookInvoker.java:43) ~[elide-core-7.0.5.jar:na]
at java.base/java.util.ArrayList.forEach(Unknown Source) ~[na:na]
at com.yahoo.elide.core.lifecycle.LifecycleHookInvoker.onNext(LifecycleHookInvoker.java:42) ~[elide-core-7.0.5.jar:na]
at com.yahoo.elide.core.RequestScope.lambda$notifySubscribers$4(RequestScope.java:258) ~[elide-core-7.0.5.jar:na]
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Unknown Source) ~[na:na]
at java.base/java.util.stream.ReferencePipeline$2$1.accept(Unknown Source) ~[na:na]
at java.base/java.util.Iterator.forEachRemaining(Unknown Source) ~[na:na]
at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Unknown Source) ~[na:na]
at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source) ~[na:na]
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source) ~[na:na]
at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Unknown Source) ~[na:na]
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Unknown Source) ~[na:na]
at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source) ~[na:na]
at java.base/java.util.stream.ReferencePipeline.forEach(Unknown Source) ~[na:na]
at com.yahoo.elide.core.RequestScope.notifySubscribers(RequestScope.java:257) ~[elide-core-7.0.5.jar:na]
at com.yahoo.elide.core.RequestScope.runQueuedPostCommitTriggers(RequestScope.java:300) ~[elide-core-7.0.5.jar:na]
at com.yahoo.elide.jsonapi.JsonApi.handleRequest(JsonApi.java:294) ~[elide-core-7.0.5.jar:na]
at com.yahoo.elide.jsonapi.JsonApi.post(JsonApi.java:129) ~[elide-core-7.0.5.jar:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Unknown Source) ~[na:na]
at org.springframework.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:281) ~[spring-core-6.0.18.jar:6.0.18]
at org.springframework.cloud.context.scope.GenericScope$LockedScopedProxyFactoryBean.invoke(GenericScope.java:482) ~[spring-cloud-context-4.1.2.jar:4.1.2]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184) ~[spring-aop-6.0.18.jar:6.0.18]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:751) ~[spring-aop-6.0.18.jar:6.0.18]
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:703) ~[spring-aop-6.0.18.jar:6.0.18]
at com.yahoo.elide.jsonapi.JsonApi$$SpringCGLIB$$0.post(<generated>) ~[elide-core-7.0.5.jar:na]
at com.yahoo.elide.spring.controllers.JsonApiController$2.call(JsonApiController.java:112) ~[elide-spring-boot-autoconfigure-7.0.5.jar:na]
at com.yahoo.elide.spring.controllers.JsonApiController$2.call(JsonApiController.java:102) ~[elide-spring-boot-autoconfigure-7.0.5.jar:na]
at org.springframework.web.context.request.async.WebAsyncManager.lambda$startCallableProcessing$4(WebAsyncManager.java:354) ~[spring-web-6.0.18.jar:6.0.18]
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[na:na]
at java.base/java.util.concurrent.FutureTask.run(Unknown Source) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) ~[na:na]
at java.base/java.lang.Thread.run(Unknown Source) ~[na:na]
That is a different error try using the latest stable version please.
Ok, let me set up a local instance here and skip this proxy steps to know if I'm doing everything as I should..
Ok! It's working in the proxy-fix version. The issue was related with the no_proxy variable without the terrakube-*
hosts :)
@alfespa17 every time I create a workspace using the API, it returns to me a 500 Error, and looking into the logs, it raises:
2024-10-15T14:41:37.415Z ERROR 1 --- [nio-8080-exec-2] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed: org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: org.terrakube.api.rs.Organization.template: could not initialize proxy - no Session] with root cause
org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: org.terrakube.api.rs.Organization.template: could not initialize proxy - no Session
at org.hibernate.collection.spi.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:635) ~[hibernate-core-6.2.22.Final.jar:6.2.22.Final]
at org.hibernate.collection.spi.AbstractPersistentCollection.withTemporarySessionIfNeeded(AbstractPersistentCollection.java:218) ~[hibernate-core-6.2.22.Final.jar:6.2.22.Final]
at org.hibernate.collection.spi.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:615) ~[hibernate-core-6.2.22.Final.jar:6.2.22.Final]
at org.hibernate.collection.spi.AbstractPersistentCollection.read(AbstractPersistentCollection.java:136) ~[hibernate-core-6.2.22.Final.jar:6.2.22.Final]
at org.hibernate.collection.spi.PersistentBag.iterator(PersistentBag.java:371) ~[hibernate-core-6.2.22.Final.jar:6.2.22.Final]
at org.terrakube.api.plugin.vcs.WebhookService.createWorkspaceWebhook(WebhookService.java:159) ~[classes/:2.21.1-proxy-fix]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Unknown Source) ~[na:na]
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343) ~[spring-aop-6.0.18.jar:6.0.18]
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:196) ~[spring-aop-6.0.18.jar:6.0.18]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-6.0.18.jar:6.0.18]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:751) ~[spring-aop-6.0.18.jar:6.0.18]
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123) ~[spring-tx-6.0.18.jar:6.0.18]
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:391) ~[spring-tx-6.0.18.jar:6.0.18]
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119) ~[spring-tx-6.0.18.jar:6.0.18]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184) ~[spring-aop-6.0.18.jar:6.0.18]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:751) ~[spring-aop-6.0.18.jar:6.0.18]
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:703) ~[spring-aop-6.0.18.jar:6.0.18]
at org.terrakube.api.plugin.vcs.WebhookService$$SpringCGLIB$$0.createWorkspaceWebhook(<generated>) ~[classes/:2.21.1-proxy-fix]
at org.terrakube.api.rs.hooks.workspace.WorkspaceManageHook.execute(WorkspaceManageHook.java:58) ~[classes/:2.21.1-proxy-fix]
at org.terrakube.api.rs.hooks.workspace.WorkspaceManageHook.execute(WorkspaceManageHook.java:18) ~[classes/:2.21.1-proxy-fix]
at com.yahoo.elide.core.lifecycle.LifeCycleHook.execute(LifeCycleHook.java:45) ~[elide-core-7.0.5.jar:na]
at com.yahoo.elide.core.lifecycle.LifecycleHookInvoker.lambda$onNext$0(LifecycleHookInvoker.java:43) ~[elide-core-7.0.5.jar:na]
at java.base/java.util.ArrayList.forEach(Unknown Source) ~[na:na]
at com.yahoo.elide.core.lifecycle.LifecycleHookInvoker.onNext(LifecycleHookInvoker.java:42) ~[elide-core-7.0.5.jar:na]
at com.yahoo.elide.core.RequestScope.lambda$notifySubscribers$4(RequestScope.java:258) ~[elide-core-7.0.5.jar:na]
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Unknown Source) ~[na:na]
at java.base/java.util.stream.ReferencePipeline$2$1.accept(Unknown Source) ~[na:na]
at java.base/java.util.Iterator.forEachRemaining(Unknown Source) ~[na:na]
at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Unknown Source) ~[na:na]
at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source) ~[na:na]
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source) ~[na:na]
at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Unknown Source) ~[na:na]
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Unknown Source) ~[na:na]
at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source) ~[na:na]
at java.base/java.util.stream.ReferencePipeline.forEach(Unknown Source) ~[na:na]
at com.yahoo.elide.core.RequestScope.notifySubscribers(RequestScope.java:257) ~[elide-core-7.0.5.jar:na]
at com.yahoo.elide.core.RequestScope.runQueuedPostCommitTriggers(RequestScope.java:300) ~[elide-core-7.0.5.jar:na]
at com.yahoo.elide.jsonapi.JsonApi.handleRequest(JsonApi.java:294) ~[elide-core-7.0.5.jar:na]
at com.yahoo.elide.jsonapi.JsonApi.post(JsonApi.java:129) ~[elide-core-7.0.5.jar:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Unknown Source) ~[na:na]
at org.springframework.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:281) ~[spring-core-6.0.18.jar:6.0.18]
at org.springframework.cloud.context.scope.GenericScope$LockedScopedProxyFactoryBean.invoke(GenericScope.java:482) ~[spring-cloud-context-4.1.2.jar:4.1.2]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184) ~[spring-aop-6.0.18.jar:6.0.18]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:751) ~[spring-aop-6.0.18.jar:6.0.18]
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:703) ~[spring-aop-6.0.18.jar:6.0.18]
at com.yahoo.elide.jsonapi.JsonApi$$SpringCGLIB$$0.post(<generated>) ~[elide-core-7.0.5.jar:na]
at com.yahoo.elide.spring.controllers.JsonApiController$2.call(JsonApiController.java:112) ~[elide-spring-boot-autoconfigure-7.0.5.jar:na]
at com.yahoo.elide.spring.controllers.JsonApiController$2.call(JsonApiController.java:102) ~[elide-spring-boot-autoconfigure-7.0.5.jar:na]
at org.springframework.web.context.request.async.WebAsyncManager.lambda$startCallableProcessing$4(WebAsyncManager.java:354) ~[spring-web-6.0.18.jar:6.0.18]
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[na:na]
at java.base/java.util.concurrent.FutureTask.run(Unknown Source) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) ~[na:na]
at java.base/java.lang.Thread.run(Unknown Source) ~[na:na]
Seens to be something related to the proxy issue, or is it something else that was fixed in the latest versions? I'm using the proxy-fix image due to the proxy requirement of my network.
Use the latest image please 2.23.2, I will merge https://github.com/AzBuilder/terrakube/pull/931 once I fix the conflicts, I guess the proxy image has another bugs that we fixed in later versions.
I merged the changes, this feature can be tested using the following version.
2.24.0-beta.1
Feel free to leave any comment or suggestion testing that version
Bug description 🐞
When a proxy is being used, via JAVA_TOOL_OPTIONS environment variables in a docker-compose environment, I noticed that when VCS integration is made, the following error occurs. It cannot connect terrakube to github:
Steps to reproduce
Deploy application without internet access and configure proxy. Other functionalities seems working, as respects the configuration to use proxy. From the vm the code is deployed I verified that github.com is reachable through the proxy.
Expected behavior
NIO requests should also use the proxy service.
Example repository
No response
Anything else?
No response